From e89be12ebb6f0be1d970ffd4a77150dad26dc18c Mon Sep 17 00:00:00 2001 From: frosch Date: Wed, 9 Apr 2025 20:11:14 +0200 Subject: [PATCH] Codechange: Rename _library to _ft_library. --- src/fontcache/freetypefontcache.cpp | 14 +++++++------- src/os/unix/font_unix.cpp | 4 ++-- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/fontcache/freetypefontcache.cpp b/src/fontcache/freetypefontcache.cpp index 04ddc3e21f..aec1c5160d 100644 --- a/src/fontcache/freetypefontcache.cpp +++ b/src/fontcache/freetypefontcache.cpp @@ -46,7 +46,7 @@ public: const void *GetOSHandle() override { return &face; } }; -FT_Library _library = nullptr; +FT_Library _ft_library = nullptr; /** @@ -163,8 +163,8 @@ void LoadFreeTypeFont(FontSize fs) std::string font = GetFontCacheFontName(fs); if (font.empty()) return; - if (_library == nullptr) { - if (FT_Init_FreeType(&_library) != FT_Err_Ok) { + if (_ft_library == nullptr) { + if (FT_Init_FreeType(&_ft_library) != FT_Err_Ok) { ShowInfo("Unable to initialize FreeType, using sprite fonts instead"); return; } @@ -178,13 +178,13 @@ void LoadFreeTypeFont(FontSize fs) /* If font is an absolute path to a ttf, try loading that first. */ int32_t index = 0; if (settings->os_handle != nullptr) index = *static_cast(settings->os_handle); - FT_Error error = FT_New_Face(_library, font_name, index, &face); + FT_Error error = FT_New_Face(_ft_library, font_name, index, &face); if (error != FT_Err_Ok) { /* Check if font is a relative filename in one of our search-paths. */ std::string full_font = FioFindFullPath(BASE_DIR, font_name); if (!full_font.empty()) { - error = FT_New_Face(_library, full_font.c_str(), 0, &face); + error = FT_New_Face(_ft_library, full_font.c_str(), 0, &face); } } @@ -303,8 +303,8 @@ GlyphID FreeTypeFontCache::MapCharToGlyph(char32_t key, bool allow_fallback) */ void UninitFreeType() { - FT_Done_FreeType(_library); - _library = nullptr; + FT_Done_FreeType(_ft_library); + _ft_library = nullptr; } #if !defined(WITH_FONTCONFIG) diff --git a/src/os/unix/font_unix.cpp b/src/os/unix/font_unix.cpp index efaaa3e056..6dbe720bbe 100644 --- a/src/os/unix/font_unix.cpp +++ b/src/os/unix/font_unix.cpp @@ -20,7 +20,7 @@ #include #include FT_FREETYPE_H -extern FT_Library _library; +extern FT_Library _ft_library; /** * Split the font name into the font family and style. These fields are separated by a comma, @@ -85,7 +85,7 @@ FT_Error GetFontByFaceName(const char *font_name, FT_Face *face) * wrongly a 'random' font, so check whether the family name is the * same as the supplied name */ if (StrEqualsIgnoreCase(font_family, (char *)family)) { - err = FT_New_Face(_library, (char *)file, index, face); + err = FT_New_Face(_ft_library, (char *)file, index, face); } } }