Run font/laguage checks only on Mac.
This commit is contained in:
parent
8445783216
commit
a808e2396b
|
@ -133,7 +133,6 @@ void FONTCONFIG::ListFonts( std::vector<std::string>& aFonts )
|
||||||
FcChar8* family;
|
FcChar8* family;
|
||||||
FcLangSet* langSet;
|
FcLangSet* langSet;
|
||||||
FcBool outline;
|
FcBool outline;
|
||||||
bool langSupported = false;
|
|
||||||
|
|
||||||
if( FcPatternGetString( font, FC_FILE, 0, &file ) == FcResultMatch
|
if( FcPatternGetString( font, FC_FILE, 0, &file ) == FcResultMatch
|
||||||
&& FcPatternGetString( font, FC_FAMILY, 0, &family ) == FcResultMatch
|
&& FcPatternGetString( font, FC_FAMILY, 0, &family ) == FcResultMatch
|
||||||
|
@ -150,6 +149,16 @@ void FONTCONFIG::ListFonts( std::vector<std::string>& aFonts )
|
||||||
|
|
||||||
std::string theFamily( reinterpret_cast<char *>( family ) );
|
std::string theFamily( reinterpret_cast<char *>( family ) );
|
||||||
|
|
||||||
|
#ifdef __WXMAC__
|
||||||
|
// On Mac (at least) some of the font names are in their own language. If
|
||||||
|
// the OS doesn't support this language then we get a bunch of garbage names
|
||||||
|
// in the font menu.
|
||||||
|
//
|
||||||
|
// GTK, on the other hand, doesn't appear to support wxLocale::IsAvailable(),
|
||||||
|
// so we can't run these checks.
|
||||||
|
|
||||||
|
bool langSupported = false;
|
||||||
|
|
||||||
if( !langStr )
|
if( !langStr )
|
||||||
{
|
{
|
||||||
// Symbol fonts (Wingdings, etc.) have no language
|
// Symbol fonts (Wingdings, etc.) have no language
|
||||||
|
@ -179,6 +188,7 @@ void FONTCONFIG::ListFonts( std::vector<std::string>& aFonts )
|
||||||
|
|
||||||
if( !langSupported )
|
if( !langSupported )
|
||||||
continue;
|
continue;
|
||||||
|
#endif
|
||||||
|
|
||||||
std::string theFile( reinterpret_cast<char *>( file ) );
|
std::string theFile( reinterpret_cast<char *>( file ) );
|
||||||
std::string theStyle( reinterpret_cast<char *>( style ) );
|
std::string theStyle( reinterpret_cast<char *>( style ) );
|
||||||
|
|
Loading…
Reference in New Issue