1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 15:07:45 +00:00

LibGfx: Add UTF-32 version of the text painting code paths

There's a large amount of code duplication here right now, which will
need to be reduced.
This commit is contained in:
Andreas Kling 2020-05-17 20:32:23 +02:00
parent 0d78ee95f9
commit 0272bbb4fb
2 changed files with 132 additions and 0 deletions

View file

@ -74,6 +74,8 @@ public:
void blit_scaled(const Rect&, const Gfx::Bitmap&, const Rect&, float, float);
void draw_text(const Rect&, const StringView&, const Font&, TextAlignment = TextAlignment::TopLeft, Color = Color::Black, TextElision = TextElision::None);
void draw_text(const Rect&, const StringView&, TextAlignment = TextAlignment::TopLeft, Color = Color::Black, TextElision = TextElision::None);
void draw_text(const Rect&, const Utf32View&, const Font&, TextAlignment = TextAlignment::TopLeft, Color = Color::Black, TextElision = TextElision::None);
void draw_text(const Rect&, const Utf32View&, TextAlignment = TextAlignment::TopLeft, Color = Color::Black, TextElision = TextElision::None);
void draw_glyph(const Point&, char, Color);
void draw_glyph(const Point&, char, const Font&, Color);
void draw_emoji(const Point&, const Gfx::Bitmap&, const Font&);
@ -126,6 +128,7 @@ protected:
void draw_pixel(const Point&, Color, int thickness = 1);
void draw_text_line(const Rect&, const Utf8View&, const Font&, TextAlignment, Color, TextElision);
void draw_text_line(const Rect&, const Utf32View&, const Font&, TextAlignment, Color, TextElision);
struct State {
const Font* font;