Skip to content

Commit

Permalink
Fix local font detection for pango>=1.46
Browse files Browse the repository at this point in the history
  • Loading branch information
scotty007 committed Sep 1, 2020
1 parent 0237706 commit 9a2822d
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions src/player/TextEngine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ TextEngine::~TextEngine()

void TextEngine::init()
{
initFonts();

m_pFontMap = PANGO_FT2_FONT_MAP(pango_ft2_font_map_new());
pango_ft2_font_map_set_resolution(m_pFontMap, 72, 72);
if (m_bHint) {
Expand All @@ -97,8 +99,6 @@ void TextEngine::init()
pango_language_from_string ("en_US"));
pango_context_set_base_dir(m_pPangoContext, PANGO_DIRECTION_LTR);

initFonts();

string sOldLang = "";
getEnv("LC_CTYPE", sOldLang);
setEnv("LC_CTYPE", "en-us");
Expand Down Expand Up @@ -274,6 +274,18 @@ void TextEngine::initFonts()
{
FcConfigAppFontAddDir(pConfig, (const FcChar8 *)it->c_str());
}
/*
FcStrList * pFontDirs = FcConfigGetFontDirs(pConfig);
FcChar8 * pDir;
do {
pDir = FcStrListNext(pFontDirs);
if (pDir) {
cerr << " + " << pDir << endl;
}
} while (pDir);
*/
//FcFontSet * pFontSets = FcConfigGetFonts(pConfig, FcSetApplication);
//FcFontSetPrint(pFontSets);
/*
FcStrList * pCacheDirs = FcConfigGetCacheDirs(pConfig);
FcChar8 * pDir;
Expand Down

0 comments on commit 9a2822d

Please sign in to comment.