|
@@ -25,6 +25,7 @@
|
|
#include <LibGfx/TextAlignment.h>
|
|
#include <LibGfx/TextAlignment.h>
|
|
#include <LibGfx/TextDirection.h>
|
|
#include <LibGfx/TextDirection.h>
|
|
#include <LibGfx/TextElision.h>
|
|
#include <LibGfx/TextElision.h>
|
|
|
|
+#include <LibGfx/TextLayout.h>
|
|
#include <LibGfx/TextWrapping.h>
|
|
#include <LibGfx/TextWrapping.h>
|
|
#include <LibWeb/Painting/BorderRadiiData.h>
|
|
#include <LibWeb/Painting/BorderRadiiData.h>
|
|
#include <LibWeb/Painting/BorderRadiusCornerClipper.h>
|
|
#include <LibWeb/Painting/BorderRadiusCornerClipper.h>
|
|
@@ -38,11 +39,9 @@ enum class CommandResult {
|
|
SkipStackingContext,
|
|
SkipStackingContext,
|
|
};
|
|
};
|
|
|
|
|
|
-struct DrawTextRun {
|
|
|
|
|
|
+struct DrawGlyphRun {
|
|
|
|
+ Vector<Gfx::DrawGlyphOrEmoji> glyph_run;
|
|
Color color;
|
|
Color color;
|
|
- Gfx::IntPoint baseline_start;
|
|
|
|
- String string;
|
|
|
|
- NonnullRefPtr<Gfx::Font> font;
|
|
|
|
Gfx::IntRect rect;
|
|
Gfx::IntRect rect;
|
|
|
|
|
|
[[nodiscard]] Gfx::IntRect bounding_rect() const { return rect; }
|
|
[[nodiscard]] Gfx::IntRect bounding_rect() const { return rect; }
|
|
@@ -304,7 +303,7 @@ struct BlitCornerClipping {
|
|
};
|
|
};
|
|
|
|
|
|
using PaintingCommand = Variant<
|
|
using PaintingCommand = Variant<
|
|
- DrawTextRun,
|
|
|
|
|
|
+ DrawGlyphRun,
|
|
DrawText,
|
|
DrawText,
|
|
FillRect,
|
|
FillRect,
|
|
DrawScaledBitmap,
|
|
DrawScaledBitmap,
|
|
@@ -342,7 +341,7 @@ class PaintingCommandExecutor {
|
|
public:
|
|
public:
|
|
virtual ~PaintingCommandExecutor() = default;
|
|
virtual ~PaintingCommandExecutor() = default;
|
|
|
|
|
|
- virtual CommandResult draw_text_run(Color const&, Gfx::IntPoint const& baseline_start, String const&, Gfx::Font const&) = 0;
|
|
|
|
|
|
+ virtual CommandResult draw_glyph_run(Vector<Gfx::DrawGlyphOrEmoji> const& glyph_run, Color const&) = 0;
|
|
virtual CommandResult draw_text(Gfx::IntRect const&, String const&, Gfx::TextAlignment alignment, Color const&, Gfx::TextElision, Gfx::TextWrapping, Optional<NonnullRefPtr<Gfx::Font>> const&) = 0;
|
|
virtual CommandResult draw_text(Gfx::IntRect const&, String const&, Gfx::TextAlignment alignment, Color const&, Gfx::TextElision, Gfx::TextWrapping, Optional<NonnullRefPtr<Gfx::Font>> const&) = 0;
|
|
virtual CommandResult fill_rect(Gfx::IntRect const&, Color const&) = 0;
|
|
virtual CommandResult fill_rect(Gfx::IntRect const&, Color const&) = 0;
|
|
virtual CommandResult draw_scaled_bitmap(Gfx::IntRect const& dst_rect, Gfx::Bitmap const& bitmap, Gfx::IntRect const& src_rect, float opacity, Gfx::Painter::ScalingMode scaling_mode) = 0;
|
|
virtual CommandResult draw_scaled_bitmap(Gfx::IntRect const& dst_rect, Gfx::Bitmap const& bitmap, Gfx::IntRect const& src_rect, float opacity, Gfx::Painter::ScalingMode scaling_mode) = 0;
|