mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 13:17:35 +00:00
LibGfx+LibWeb: Update for_each_glyph_position to use font cascade list
This change updates function that builds list of glyphs to use font cascade list to find font for each code point.
This commit is contained in:
parent
2cb0039a13
commit
df57d7ca68
8 changed files with 66 additions and 16 deletions
|
@ -2439,7 +2439,9 @@ void Painter::draw_text_run(IntPoint baseline_start, Utf8View const& string, Fon
|
|||
|
||||
void Painter::draw_text_run(FloatPoint baseline_start, Utf8View const& string, Font const& font, Color color)
|
||||
{
|
||||
for_each_glyph_position(baseline_start, string, font, [&](DrawGlyphOrEmoji glyph_or_emoji) {
|
||||
auto font_list = Gfx::FontCascadeList::create();
|
||||
font_list->add(font);
|
||||
for_each_glyph_position(baseline_start, string, font_list, [&](DrawGlyphOrEmoji glyph_or_emoji) {
|
||||
if (glyph_or_emoji.has<DrawGlyph>()) {
|
||||
auto& glyph = glyph_or_emoji.get<DrawGlyph>();
|
||||
draw_glyph(glyph.position, glyph.code_point, *glyph.font, color);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue