#pragma once #include "ppsspp_config.h" #include #include "Common/Render/Text/draw_text.h" #if defined(USE_SDL2_TTF) #include "SDL2/SDL.h" #include "SDL2/SDL_ttf.h" #if defined(USE_SDL2_TTF_FONTCONFIG) #include #endif class TextDrawerSDL : public TextDrawer { public: TextDrawerSDL(Draw::DrawContext *draw); ~TextDrawerSDL(); void SetOrCreateFont(const FontStyle &style) override; bool DrawStringBitmap(std::vector &bitmapData, TextStringEntry &entry, Draw::DataFormat texFormat, std::string_view str, int align, bool fullColor) override; protected: void MeasureStringInternal(std::string_view str, float *w, float *h) override; bool SupportsColorEmoji() const override { return false; } void ClearFonts() override; private: void PrepareFallbackFonts(std::string_view locale); uint32_t CheckMissingGlyph(std::string_view text); int FindFallbackFonts(uint32_t missingGlyph, int ptSize); std::map> fontMap_; std::vector fallbackFonts_; std::vector> fallbackFontPaths_; // path and font face index std::map glyphFallbackFontIndex_; #if defined(USE_SDL2_TTF_FONTCONFIG) FcConfig *config; #endif }; #endif