Changeset 1193

Show
Ignore:
Timestamp:
11/17/09 00:04:23 (4 months ago)
Author:
astrange
Message:

Blacklist DF*.ttc from being imported.

Fixes [BSS]_Darker_Than_Black_-_Gemini_of_the_Meteor_-_02_[1DC03D18].mkv and more.

Reported as radr://7197648 but it didn't help. Closes #453.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/CommonUtils.c

    r1189 r1193  
    2525#import <pthread.h> 
    2626#import <dlfcn.h> 
     27#import <fnmatch.h> 
    2728 
    2829typedef struct LanguageTriplet { 
     
    411412} 
    412413 
     414static int GetSystemMinorVersion() 
     415{ 
     416        long minorVersion; 
     417        Gestalt(gestaltSystemVersionMinor, &minorVersion); 
     418         
     419        return minorVersion; 
     420} 
     421 
    413422int IsTransparentSubtitleHackEnabled() 
    414423{ 
     
    417426        if(forced == -1) 
    418427        { 
    419                 long minorVersion; 
    420                 Gestalt(gestaltSystemVersionMinor, &minorVersion); 
     428                int minorVersion = GetSystemMinorVersion(); 
    421429                 
    422430                if (minorVersion == 5) 
     
    449457} 
    450458 
     459 
     460// this could be a defaults setting, but no real call for it yet 
     461int ShouldImportFontFileName(const char *filename) 
     462{ 
     463        // match DynaFont Labs (1997) fonts, which are in many files 
     464        // and completely break ATSUI on different OS versions 
     465        // FIXME: This font works when in ~/Library/Fonts (!). Check it again with CoreText. 
     466        return !(GetSystemMinorVersion() >= 6 && fnmatch("DF*.ttc", filename, 0) == 0); 
     467} 
     468 
     469 
    451470CFPropertyListRef CopyPreferencesValueTyped(CFStringRef key, CFTypeID type) 
    452471{ 
  • trunk/CommonUtils.h

    r1189 r1193  
    6262int IsAltivecSupported(); 
    6363 
     64// is this font name known to be incompatible with ATSUI? 
     65int ShouldImportFontFileName(const char *filename); 
     66         
    6467// CFPreferencesCopyAppValue() wrapper which checks the type of the value returned 
    6568CFPropertyListRef CopyPreferencesValueTyped(CFStringRef key, CFTypeID type); 
  • trunk/MatroskaImportPrivate.cpp

    r1181 r1193  
    762762                /* The only attachments handled here are fonts, which currently can be truetype or opentype. 
    763763                   application/x-* is probably not a permanent MIME type, but it is current practice... */ 
    764                 if (fileMimeType == "application/x-truetype-font" || fileMimeType == "application/x-font-otf") { 
     764                if ((fileMimeType == "application/x-truetype-font" || fileMimeType == "application/x-font-otf") && 
     765                        ShouldImportFontFileName(fileName.c_str())) { 
    765766                        KaxFileData & fontData = GetChild<KaxFileData>(*attachedFile); 
    766767