From bcc1e28babce834b478267496c6718b6c5326be3 Mon Sep 17 00:00:00 2001 From: Seth Hillbrand Date: Wed, 25 Jan 2023 16:44:35 -0800 Subject: [PATCH] Fix Windows build error bc Microsoft owns all the words --- common/font/fontconfig.cpp | 18 +++++++++--------- common/font/outline_font.cpp | 6 +++--- include/font/fontconfig.h | 12 ++++++------ 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/common/font/fontconfig.cpp b/common/font/fontconfig.cpp index 0f01352d53..8f0a1fe69b 100644 --- a/common/font/fontconfig.cpp +++ b/common/font/fontconfig.cpp @@ -64,7 +64,7 @@ FONTCONFIG* Fontconfig() FONTCONFIG::FF_RESULT FONTCONFIG::FindFont( const wxString &aFontName, wxString &aFontFile, bool aBold, bool aItalic ) { - FF_RESULT retval = FF_RESULT::ERROR; + FF_RESULT retval = FF_RESULT::FF_ERROR; wxString qualifiedFontName = aFontName; if( aBold ) @@ -93,7 +93,7 @@ FONTCONFIG::FF_RESULT FONTCONFIG::FindFont( const wxString &aFontName, wxString FcChar8* family = nullptr; FcChar8* style = nullptr; - retval = FF_RESULT::SUBSTITUTE; + retval = FF_RESULT::FF_SUBSTITUTE; if( FcPatternGetString( font, FC_FAMILY, 0, &family ) == FcResultMatch ) { @@ -132,15 +132,15 @@ FONTCONFIG::FF_RESULT FONTCONFIG::FindFont( const wxString &aFontName, wxString if( fontName.Lower().StartsWith( aFontName.Lower() ) ) { if( ( aBold && !has_bold ) && ( aItalic && !has_ital ) ) - retval = FF_RESULT::MISSING_BOLD_ITAL; + retval = FF_RESULT::FF_MISSING_BOLD_ITAL; else if( aBold && !has_bold ) - retval = FF_RESULT::MISSING_BOLD; + retval = FF_RESULT::FF_MISSING_BOLD; else if( aItalic && !has_ital ) - retval = FF_RESULT::MISSING_ITAL; + retval = FF_RESULT::FF_MISSING_ITAL; else if( ( aBold != has_bold ) || ( aItalic != has_ital ) ) - retval = FF_RESULT::SUBSTITUTE; + retval = FF_RESULT::FF_SUBSTITUTE; else - retval = FF_RESULT::OK; + retval = FF_RESULT::FF_OK; } } } @@ -148,9 +148,9 @@ FONTCONFIG::FF_RESULT FONTCONFIG::FindFont( const wxString &aFontName, wxString FcPatternDestroy( font ); } - if( retval == FF_RESULT::ERROR ) + if( retval == FF_RESULT::FF_ERROR ) wxLogWarning( _( "Error loading font '%s'." ), qualifiedFontName ); - else if( retval == FF_RESULT::SUBSTITUTE ) + else if( retval == FF_RESULT::FF_SUBSTITUTE ) wxLogWarning( _( "Font '%s' not found; substituting '%s'." ), qualifiedFontName, fontName ); FcPatternDestroy( pat ); diff --git a/common/font/outline_font.cpp b/common/font/outline_font.cpp index 45fdc3e4d1..080fe408de 100644 --- a/common/font/outline_font.cpp +++ b/common/font/outline_font.cpp @@ -97,13 +97,13 @@ OUTLINE_FONT* OUTLINE_FONT::LoadFont( const wxString& aFontName, bool aBold, boo fc::FF_RESULT retval = Fontconfig()->FindFont( aFontName, fontFile, aBold, aItalic ); - if( retval == fc::FF_RESULT::MISSING_BOLD || retval == fc::FF_RESULT::MISSING_BOLD_ITAL ) + if( retval == fc::FF_RESULT::FF_MISSING_BOLD || retval == fc::FF_RESULT::FF_MISSING_BOLD_ITAL ) font->SetFakeBold(); - if( retval == fc::FF_RESULT::MISSING_ITAL || retval == fc::FF_RESULT::MISSING_BOLD_ITAL ) + if( retval == fc::FF_RESULT::FF_MISSING_ITAL || retval == fc::FF_RESULT::FF_MISSING_BOLD_ITAL ) font->SetFakeItal(); - if( retval != fc::FF_RESULT::ERROR ) + if( retval != fc::FF_RESULT::FF_ERROR ) (void) font->loadFace( fontFile ); font->m_fontName = aFontName; // Keep asked-for name, even if we substituted. diff --git a/include/font/fontconfig.h b/include/font/fontconfig.h index 19c60eb8ba..4018299c1d 100644 --- a/include/font/fontconfig.h +++ b/include/font/fontconfig.h @@ -38,12 +38,12 @@ public: enum class FF_RESULT { - OK, - ERROR, - SUBSTITUTE, - MISSING_BOLD, - MISSING_ITAL, - MISSING_BOLD_ITAL + FF_OK, + FF_ERROR, + FF_SUBSTITUTE, + FF_MISSING_BOLD, + FF_MISSING_ITAL, + FF_MISSING_BOLD_ITAL }; /**