1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 23:37:35 +00:00

LibWeb: Add Canvas Context2D basic font property support

This commit is contained in:
Bastiaan van der Plaat 2023-08-07 21:48:49 +02:00 committed by Andreas Kling
parent b05fe22d39
commit bba14f6014
7 changed files with 181 additions and 27 deletions

View file

@ -100,6 +100,9 @@ public:
virtual float global_alpha() const override;
virtual void set_global_alpha(float) override;
HTMLCanvasElement& canvas_element();
HTMLCanvasElement const& canvas_element() const;
private:
explicit CanvasRenderingContext2D(JS::Realm&, HTMLCanvasElement&);
@ -132,14 +135,13 @@ private:
did_draw(draw_rect);
}
RefPtr<Gfx::Font const> current_font();
PreparedText prepare_text(DeprecatedString const& text, float max_width = INFINITY);
Gfx::Painter* painter();
Optional<Gfx::AntiAliasingPainter> antialiased_painter();
HTMLCanvasElement& canvas_element();
HTMLCanvasElement const& canvas_element() const;
Gfx::Path rect_path(float x, float y, float width, float height);
void stroke_internal(Gfx::Path const&);