mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 00:17:46 +00:00
LibGfx: Painter, extend fonts to 384 character to support LatinExtendedA
Replace codepoint variable type from char to u32.
This commit is contained in:
parent
8790d6bafc
commit
840a64e2f9
2 changed files with 8 additions and 8 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue