1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 19:37:34 +00:00

LibGfx: Add Painter::draw_text_run(), a simplified text painting API

This API does:
    - Take a Utf8View
    - Take the starting point on the baseline as its input coordinate

This API does not:
    - Align the text
    - Wrap the text
    - Elide too-long text into "..."
This commit is contained in:
Andreas Kling 2022-03-28 13:40:48 +02:00
parent e398164f10
commit 7850628ff1
2 changed files with 22 additions and 0 deletions

View file

@ -87,6 +87,9 @@ public:
void draw_glyph_or_emoji(IntPoint const&, Utf8CodePointIterator&, Font const&, Color);
void draw_circle_arc_intersecting(IntRect const&, IntPoint const&, int radius, Color, int thickness);
// Streamlined text drawing routine that does no wrapping/elision/alignment.
void draw_text_run(FloatPoint const& baseline_start, Utf8View const&, Font const&, Color);
enum class CornerOrientation {
TopLeft,
TopRight,