From bba14f60140732f2b05d266d0791e53e1cbbeed7 Mon Sep 17 00:00:00 2001 From: Bastiaan van der Plaat Date: Mon, 7 Aug 2023 21:48:49 +0200 Subject: [PATCH] LibWeb: Add Canvas Context2D basic font property support --- Base/res/html/misc/canvas-text.html | 103 +++++++++++++++++- .../Libraries/LibWeb/CSS/StyleComputer.cpp | 2 + .../LibWeb/HTML/Canvas/CanvasState.h | 2 + .../HTML/Canvas/CanvasTextDrawingStyles.h | 46 +++++++- .../HTML/Canvas/CanvasTextDrawingStyles.idl | 2 +- .../LibWeb/HTML/CanvasRenderingContext2D.cpp | 45 +++++--- .../LibWeb/HTML/CanvasRenderingContext2D.h | 8 +- 7 files changed, 181 insertions(+), 27 deletions(-) diff --git a/Base/res/html/misc/canvas-text.html b/Base/res/html/misc/canvas-text.html index 961375488c..ff6b887726 100644 --- a/Base/res/html/misc/canvas-text.html +++ b/Base/res/html/misc/canvas-text.html @@ -7,15 +7,110 @@

Canvas Text Examples

+

The red boxes are the measured text rects

-Canvas text-align
-

+Canvas font size
+

+ +Canvas font family
+

+ + + +Canvas font weight
+

+ + + +Canvas font style
+

+ + + +Canvas text-align
+

+ + Canvas text-baseline
-

+