mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 03:27:34 +00:00
LibGfx: Allow extracting paths from fonts and add Gfx::Path::text()
This updates fonts so rather than rastering directly to a bitmap, you can extract paths for glyphs. This is then used to implement a Gfx::Path::text("some text", font) API, that if given a vector font appends the path of the text to your Gfx::Path. This then allows arbitrary manipulation of the text (rotation, skewing, etc), paving the way for Word Art in Serenity.
This commit is contained in:
parent
b4cabde4a4
commit
50d33f79fa
14 changed files with 186 additions and 88 deletions
|
@ -10,6 +10,7 @@
|
|||
#include <AK/HashMap.h>
|
||||
#include <AK/Optional.h>
|
||||
#include <AK/Vector.h>
|
||||
#include <LibGfx/Font/Font.h>
|
||||
#include <LibGfx/Forward.h>
|
||||
#include <LibGfx/Line.h>
|
||||
#include <LibGfx/Point.h>
|
||||
|
@ -153,6 +154,8 @@ public:
|
|||
elliptical_arc_to(point, { radius, radius }, 0, large_arc, sweep);
|
||||
}
|
||||
|
||||
void text(Utf8View, Font const&);
|
||||
|
||||
FloatPoint last_point();
|
||||
|
||||
void close();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue