Files
ppsspp/Common/Render/Text/draw_text_win.h
T
Henrik RydgårdandClaude Opus 5.5 4c7dd44351 TextDrawer: Remove the current font and scale
Drawing now takes the style and scale too, like measuring, so the text
drawers have no font state left. UIContext keeps its current style and
passes it, and fills it in from the theme if nothing has set one yet.
PPGe passes its one font.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 11:54:10 +01:00

32 lines
975 B
C++

#pragma once
#include "ppsspp_config.h"
#include <map>
#include "Common/Render/Text/draw_text.h"
#if defined(_WIN32) && !PPSSPP_PLATFORM(UWP)
struct TextDrawerContext;
// Internal struct but all details in .cpp file (pimpl to avoid pulling in excessive headers here)
class TextDrawerFontContext;
class TextDrawerWin32 : public TextDrawer {
public:
TextDrawerWin32(Draw::DrawContext *draw);
~TextDrawerWin32();
protected:
void EnsureFont(const FontStyle &style) override;
void MeasureStringInternal(const FontStyle &style, std::string_view str, float *w, float *h) override;
bool DrawStringBitmap(const FontStyle &style, std::vector<uint8_t> &bitmapData, TextStringEntry &entry, Draw::DataFormat texFormat, std::string_view str, int align, bool fullColor) override;
bool SupportsColorEmoji() const override { return false; }
void ClearFonts() override;
TextDrawerContext *ctx_;
std::map<FontStyle, std::unique_ptr<TextDrawerFontContext>> fontMap_;
};
#endif