mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-21 17:51:52 +00:00
LibGfx+LibWeb: Add Path::glyph_run() and use in canvas
Canvas text painting needs to support per-glyph font fallbacks, which means we can't hand over responsibility for text shaping to Skia and instead need to extract glyph paths from our own shaped GlyphRun.
This commit is contained in:
parent
2c64c6d773
commit
1e7922fac8
Notes:
github-actions[bot]
2025-04-21 07:52:25 +00:00
Author: https://github.com/kalenikaliaksandr
Commit: 1e7922fac8
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4409
6 changed files with 22 additions and 2 deletions
|
@ -235,8 +235,8 @@ Gfx::Path CanvasRenderingContext2D::text_path(StringView text, float x, float y,
|
|||
auto const& font = font_cascade_list()->first();
|
||||
|
||||
Gfx::Path path;
|
||||
path.move_to({ x, y });
|
||||
path.text(Utf8View { text }, font);
|
||||
auto glyph_run = Gfx::shape_text({ x, y }, 0, Utf8View(text), font, Gfx::GlyphRun::TextType::Ltr, {});
|
||||
path.glyph_run(*glyph_run);
|
||||
|
||||
auto text_width = path.bounding_box().width();
|
||||
Gfx::AffineTransform transform = {};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue