diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-09-12 10:20:48 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-09-12 10:28:21 +0100 |
commit | 9436ae99438ccc24a86aff61aaa9174a9686814f (patch) | |
tree | fb79504ae01332ff0f2aa0082b087da9c1337ff2 /vcl | |
parent | 02f8f895f2abc4ee090b4bd42963590aa018fb49 (diff) |
Related: fdo#82259 implement mac ttf fontname encoding support
which is why these font's are not appearing under Linux
Change-Id: Ib72ddb465b2df729953ece416cfa0477cd565bcd
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/generic/fontmanager/fontmanager.cxx | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/vcl/generic/fontmanager/fontmanager.cxx b/vcl/generic/fontmanager/fontmanager.cxx index edc2be10c030..725fc87a9cd7 100644 --- a/vcl/generic/fontmanager/fontmanager.cxx +++ b/vcl/generic/fontmanager/fontmanager.cxx @@ -1018,6 +1018,65 @@ OUString PrintFontManager::convertTrueTypeName( void* pRecord ) const } } } + else if( pNameRecord->platformID == 1 ) + { + OString aName((const sal_Char*)(pNameRecord->sptr), pNameRecord->slen); + rtl_TextEncoding eEncoding = RTL_TEXTENCODING_DONTKNOW; + switch (pNameRecord->encodingID) + { + case 0: + eEncoding = RTL_TEXTENCODING_APPLE_ROMAN; + break; + case 1: + eEncoding = RTL_TEXTENCODING_APPLE_JAPANESE; + break; + case 2: + eEncoding = RTL_TEXTENCODING_APPLE_CHINTRAD; + break; + case 3: + eEncoding = RTL_TEXTENCODING_APPLE_KOREAN; + break; + case 4: + eEncoding = RTL_TEXTENCODING_APPLE_ARABIC; + break; + case 5: + eEncoding = RTL_TEXTENCODING_APPLE_HEBREW; + break; + case 6: + eEncoding = RTL_TEXTENCODING_APPLE_GREEK; + break; + case 7: + eEncoding = RTL_TEXTENCODING_APPLE_CYRILLIC; + break; + case 9: + eEncoding = RTL_TEXTENCODING_APPLE_DEVANAGARI; + break; + case 10: + eEncoding = RTL_TEXTENCODING_APPLE_GURMUKHI; + break; + case 11: + eEncoding = RTL_TEXTENCODING_APPLE_GUJARATI; + break; + case 21: + eEncoding = RTL_TEXTENCODING_APPLE_THAI; + break; + case 25: + eEncoding = RTL_TEXTENCODING_APPLE_CHINSIMP; + break; + case 29: + eEncoding = RTL_TEXTENCODING_APPLE_CENTEURO; + break; + case 32: //Uninterpreted + eEncoding = RTL_TEXTENCODING_UTF8; + break; + default: + SAL_WARN("vcl", "Unimplmented mac encoding " << pNameRecord->encodingID << " to unicode conversion"); + break; + } + if (eEncoding != RTL_TEXTENCODING_DONTKNOW) + aValue = OStringToOUString(aName, eEncoding); + } + return aValue; } @@ -1077,8 +1136,21 @@ void PrintFontManager::analyzeTrueTypeFamilyName( void* pTTFont, ::std::list< OU else nMatch = 1000; } + else if( pNameRecords[i].platformID == 1 ) + { +/* + // to-do, mac to LanguageType conversion + if( pNameRecords[i].languageID == aLang ) + nMatch = 8000; + else*/ if( pNameRecords[i].languageID == 0 ) //English + nMatch = 2000; + else + nMatch = 1000; + } OUString aName = convertTrueTypeName( pNameRecords + i ); aSet.insert( aName ); + if (aName.isEmpty()) + continue; if( nMatch > nLastMatch || isBadTNR(aName, aSet) ) { nLastMatch = nMatch; |