1
0
Fork 0
mirror of https://github.com/LadybirdBrowser/ladybird.git synced 2025-06-10 18:10:56 +09:00

LibGfx: Support computing a font's glyph width with code point iterators

This allows consideration of multi-code point glyphs.
This commit is contained in:
Timothy Flynn 2023-02-20 14:40:12 -05:00 committed by Andreas Kling
parent 71967bc5de
commit a391ea3da3
Notes: sideshowbarker 2024-07-17 03:05:16 +09:00
5 changed files with 46 additions and 22 deletions

View file

@ -105,6 +105,18 @@ float ScaledFont::glyph_or_emoji_width(u32 code_point) const
return metrics.advance_width;
}
float ScaledFont::glyph_or_emoji_width(Utf8CodePointIterator& it) const
{
// FIXME: Support multi-code point emoji with scaled fonts.
return glyph_or_emoji_width(*it);
}
float ScaledFont::glyph_or_emoji_width(Utf32CodePointIterator& it) const
{
// FIXME: Support multi-code point emoji with scaled fonts.
return glyph_or_emoji_width(*it);
}
float ScaledFont::glyphs_horizontal_kerning(u32 left_code_point, u32 right_code_point) const
{
if (left_code_point == 0 || right_code_point == 0)