#pragma once #include "ppsspp_config.h" #include #include "Common/Render/Text/draw_text.h" #if PPSSPP_PLATFORM(ANDROID) #include struct AndroidFontEntry { float size; }; class TextDrawerAndroid : public TextDrawer { public: TextDrawerAndroid(Draw::DrawContext *draw); ~TextDrawerAndroid(); bool IsReady() const override; uint32_t SetFont(const char *fontName, int size, int flags) override; void SetFont(uint32_t fontHandle) override; // Shortcut once you've set the font once. 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 true; } void ClearFonts() override; private: // JNI functions jclass cls_textRenderer; jmethodID method_measureText; jmethodID method_renderText; std::map fontMap_; }; #endif