Ticket #335 (closed enhancement: fixed)

Opened 3 months ago

Last modified 3 months ago

[PATCH] First step to allow case-insensitive font search for subtitles

Reported by: maru Assigned to: astrange
Priority: normal Milestone: 1.2
Component: Subtitles Version: 1.1
Severity: normal Keywords:
Cc:

Description

ATSUFindFontFromName does a case sensitive search for the given fontname.

There are ASS subtitles where the font is all lowercase or uppercase. In this case, the fail-over font is used although the font exists in the MKV file.

I think the best solution would be to use NSFontManager but this means larger changes. The attached patch is just a quick fix that works with the "problem"-files I have here.

Attachments

font.patch (1.0 kB) - added by maru on 04/21/08 13:52:33.
Use NSFontManager in the failover case.
atsu-font.patch (1.4 kB) - added by maru on 04/22/08 13:34:42.
Applied changes as requested by Alex

Change History

04/21/08 11:06:09 changed by astrange

  • owner set to astrange.
  • status changed from new to assigned.
  • milestone set to 1.2.

04/21/08 13:52:33 changed by maru

  • attachment font.patch added.

Use NSFontManager in the failover case.

(follow-up: ↓ 3 ) 04/22/08 00:12:18 changed by astrange

It might be a bad idea to link to AppKit?. Let me ask someone else...

(in reply to: ↑ 2 ) 04/22/08 05:04:10 changed by maru

Replying to astrange:

It might be a bad idea to link to AppKit?. Let me ask someone else...

Well another way of doing this would be to get all Font IDs of the system with "ATSUGetFontIDs" iterate over the list with "ATSUFindFontName" and do a case in-sensitive for the font. I am pretty sure this will take longer than with NSFontManager but on the plus side we do not depend on AppKit? any longer.

04/22/08 12:53:13 changed by astrange

As long as we can only get one name per font, we still need a final ATSFontFindFromName, otherwise the bugs in ATSUI on 10.4 mean we'll never find some fonts. I have an example file for that somewhere...

Still, that's not a problem since it's all done while the file is being opened. I'd like to move some of these arrays into the renderer class instead of the stack, but I'll look at it later.

Other notes: use kFontMicrosoftPlatform and just do 'font = fontIDs[x]'.

04/22/08 13:34:42 changed by maru

  • attachment atsu-font.patch added.

Applied changes as requested by Alex

05/08/08 11:32:17 changed by astrange

  • status changed from assigned to closed.
  • resolution set to fixed.