summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2014-09-12 11:49:03 +0100
committerCaolán McNamara <caolanm@redhat.com>2014-09-12 14:44:07 +0100
commit3202c44532ac59b7bd9fedae74201e4ba8c92013 (patch)
tree727049bcca5df15cd3f83825447ba2b65a992184
parent9a502e6b1d6044e6f00db798dc2931f57eab161f (diff)
use Apple Language Id conversion for matching font names
Change-Id: Ic953c4ff0de6a90b0580bb22554750be08727349
-rw-r--r--vcl/generic/fontmanager/fontmanager.cxx15
1 files changed, 8 insertions, 7 deletions
diff --git a/vcl/generic/fontmanager/fontmanager.cxx b/vcl/generic/fontmanager/fontmanager.cxx
index 725fc87a9cd7..e79c1d4ac1e1 100644
--- a/vcl/generic/fontmanager/fontmanager.cxx
+++ b/vcl/generic/fontmanager/fontmanager.cxx
@@ -48,6 +48,7 @@
#include <sal/macros.h>
+#include "i18nlangtag/applelangid.hxx"
#include "i18nlangtag/mslangid.hxx"
#include "parseAFM.hxx"
@@ -1114,7 +1115,8 @@ void PrintFontManager::analyzeTrueTypeFamilyName( void* pTTFont, ::std::list< OU
int nNameRecords = GetTTNameRecords( (TrueTypeFont*)pTTFont, &pNameRecords );
if( nNameRecords && pNameRecords )
{
- LanguageType aLang = MsLangId::getSystemLanguage();
+ LanguageTag aSystem("");
+ LanguageType eLang = aSystem.getLanguageType();
int nLastMatch = -1;
for( int i = 0; i < nNameRecords; i++ )
{
@@ -1126,7 +1128,7 @@ void PrintFontManager::analyzeTrueTypeFamilyName( void* pTTFont, ::std::list< OU
else if( pNameRecords[i].platformID == 3 )
{
// this bases on the LanguageType actually being a Win LCID
- if( pNameRecords[i].languageID == aLang )
+ if (pNameRecords[i].languageID == eLang)
nMatch = 8000;
else if( pNameRecords[i].languageID == LANGUAGE_ENGLISH_US )
nMatch = 2000;
@@ -1136,13 +1138,12 @@ void PrintFontManager::analyzeTrueTypeFamilyName( void* pTTFont, ::std::list< OU
else
nMatch = 1000;
}
- else if( pNameRecords[i].platformID == 1 )
+ else if (pNameRecords[i].platformID == 1)
{
-/*
- // to-do, mac to LanguageType conversion
- if( pNameRecords[i].languageID == aLang )
+ LanguageTag aApple(makeLanguageTagFromAppleLanguageId(pNameRecords[i].languageID));
+ if (aApple == aSystem)
nMatch = 8000;
- else*/ if( pNameRecords[i].languageID == 0 ) //English
+ else if (pNameRecords[i].languageID == APPLE_LANG_ENGLISH)
nMatch = 2000;
else
nMatch = 1000;