diff options
author | Caolán McNamara <caolanm@redhat.com> | 2011-03-08 16:10:43 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2011-03-08 16:19:16 +0000 |
commit | 0177774f9bfa9b460fe3244b0455ef412e3cd147 (patch) | |
tree | 68bb3f1bff5467b4ba2a765d4866b9ecb85f4326 /vcl/unx | |
parent | c6753d78c3044a12133614904aa8d577fda49bbf (diff) |
Resolves: rhbz#682716 pa-IN isn't handled by fontconfig well
i.e. pa-IN gets fontconfig to consider all "pa" and "pa-pk" fonts, see
fdo#35118 for what I'd like fontconfig to do instead and prioritize generic
"pa" over "pa-pk" in thsis case.
Looking at the current list of fontconfig languages, this is the only one
likely afflicted at the moment, so help fontconfig out here.
Diffstat (limited to 'vcl/unx')
-rw-r--r-- | vcl/unx/source/fontmanager/fontconfig.cxx | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/vcl/unx/source/fontmanager/fontconfig.cxx b/vcl/unx/source/fontmanager/fontconfig.cxx index 25ed2f68eff7..e749c0d08e90 100644 --- a/vcl/unx/source/fontmanager/fontconfig.cxx +++ b/vcl/unx/source/fontmanager/fontconfig.cxx @@ -993,9 +993,15 @@ rtl::OUString PrintFontManager::Substitute(const rtl::OUString& rFontName, const FcChar8* pTargetNameUtf8 = (FcChar8*)aTargetName.getStr(); rWrapper.FcPatternAddString( pPattern, FC_FAMILY, pTargetNameUtf8 ); - const FcChar8* pLangAttribUtf8 = (FcChar8*)rLangAttrib.getStr(); if( rLangAttrib.getLength() ) + { + const FcChar8* pLangAttribUtf8; + if (rLangAttrib.equalsIgnoreAsciiCase(OString(RTL_CONSTASCII_STRINGPARAM("pa-in")))) + pLangAttribUtf8 = (FcChar8*)"pa"; + else + pLangAttribUtf8 = (FcChar8*)rLangAttrib.getStr(); rWrapper.FcPatternAddString( pPattern, FC_LANG, pLangAttribUtf8 ); + } // Add required Unicode characters, if any if ( rMissingCodes.getLength() ) |