LibWeb: Use Utf16String in CanvasText APIs

This is prep work for getting rid of UTF-8 text shaping.
This commit is contained in:
Andreas Kling 2025-09-19 12:21:20 +02:00 committed by Andreas Kling
parent 5bd867f1dc
commit 434bf30cda
Notes: github-actions[bot] 2025-09-21 11:24:04 +00:00
6 changed files with 26 additions and 26 deletions

View file

@ -70,8 +70,8 @@ public:
virtual void stroke() override;
virtual void stroke(Path2D const& path) override;
virtual void fill_text(StringView, float x, float y, Optional<double> max_width) override;
virtual void stroke_text(StringView, float x, float y, Optional<double> max_width) override;
virtual void fill_text(Utf16String const&, float x, float y, Optional<double> max_width) override;
virtual void stroke_text(Utf16String const&, float x, float y, Optional<double> max_width) override;
virtual void fill(StringView fill_rule) override;
virtual void fill(Path2D& path, StringView fill_rule) override;
@ -87,7 +87,7 @@ public:
virtual CanvasRenderingContext2DSettings get_context_attributes() const override { return m_context_attributes; }
virtual GC::Ref<TextMetrics> measure_text(StringView text) override;
virtual GC::Ref<TextMetrics> measure_text(Utf16String const&) override;
virtual void clip(StringView fill_rule) override;
virtual void clip(Path2D& path, StringView fill_rule) override;
@ -147,10 +147,10 @@ private:
RefPtr<Gfx::FontCascadeList const> font_cascade_list();
PreparedText prepare_text(ByteString const& text, float max_width = INFINITY);
PreparedText prepare_text(Utf16String const&, float max_width = INFINITY);
[[nodiscard]] Gfx::Path rect_path(float x, float y, float width, float height);
[[nodiscard]] Gfx::Path text_path(StringView text, float x, float y, Optional<double> max_width);
[[nodiscard]] Gfx::Path text_path(Utf16String const&, float x, float y, Optional<double> max_width);
Gfx::Color clear_color() const;