summaryrefslogtreecommitdiff
path: root/Libraries
diff options
context:
space:
mode:
authorHüseyin ASLITÜRK <asliturk@hotmail.com>2020-05-16 22:21:19 +0300
committerAndreas Kling <kling@serenityos.org>2020-05-21 01:19:42 +0200
commit840a64e2f987cfd31fe322cf46d1d15376848368 (patch)
treee122e62bcd705014771bc610ec37815993f9b72a /Libraries
parent8790d6bafc765ce8f21b138c65e085c3e4acc416 (diff)
downloadserenity-840a64e2f987cfd31fe322cf46d1d15376848368.zip
LibGfx: Painter, extend fonts to 384 character to support LatinExtendedA
Replace codepoint variable type from char to u32.
Diffstat (limited to 'Libraries')
-rw-r--r--Libraries/LibGfx/Painter.cpp12
-rw-r--r--Libraries/LibGfx/Painter.h4
2 files changed, 8 insertions, 8 deletions
diff --git a/Libraries/LibGfx/Painter.cpp b/Libraries/LibGfx/Painter.cpp
index 694fba0fe2..da6728fe06 100644
--- a/Libraries/LibGfx/Painter.cpp
+++ b/Libraries/LibGfx/Painter.cpp
@@ -764,14 +764,14 @@ void Painter::draw_scaled_bitmap(const Rect& a_dst_rect, const Gfx::Bitmap& sour
}
}
-FLATTEN void Painter::draw_glyph(const Point& point, char ch, Color color)
+FLATTEN void Painter::draw_glyph(const Point& point, u32 codepoint, Color color)
{
- draw_glyph(point, ch, font(), color);
+ draw_glyph(point, codepoint, font(), color);
}
-FLATTEN void Painter::draw_glyph(const Point& point, char ch, const Font& font, Color color)
+FLATTEN void Painter::draw_glyph(const Point& point, u32 codepoint, const Font& font, Color color)
{
- draw_bitmap(point, font.glyph_bitmap(ch), color);
+ draw_bitmap(point, font.glyph_bitmap(codepoint), color);
}
void Painter::draw_emoji(const Point& point, const Gfx::Bitmap& emoji, const Font& font)
@@ -791,9 +791,9 @@ void Painter::draw_emoji(const Point& point, const Gfx::Bitmap& emoji, const Fon
void Painter::draw_glyph_or_emoji(const Point& point, u32 codepoint, const Font& font, Color color)
{
- if (codepoint < 256) {
+ if (codepoint < (u32)font.glyph_count()) {
// This looks like a regular character.
- draw_glyph(point, (char)codepoint, font, color);
+ draw_glyph(point, (size_t)codepoint, font, color);
return;
}
diff --git a/Libraries/LibGfx/Painter.h b/Libraries/LibGfx/Painter.h
index 274a5bcfed..4f695c50d1 100644
--- a/Libraries/LibGfx/Painter.h
+++ b/Libraries/LibGfx/Painter.h
@@ -76,8 +76,8 @@ public:
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_glyph(const Point&, u32, Color);
+ void draw_glyph(const Point&, u32, const Font&, Color);
void draw_emoji(const Point&, const Gfx::Bitmap&, const Font&);
void draw_glyph_or_emoji(const Point&, u32 codepoint, const Font&, Color);