mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 10:28:10 +00:00
LibWeb: Add initial support for SVG <textPath>
This patch adds basic support for the SVG `<textPath>`, so it supports placing text along a path, but none of the extra attributes for controlling the layout of the text. This is enough to correctly display the MDN example.
This commit is contained in:
parent
d327104910
commit
809c5b0b03
11 changed files with 171 additions and 0 deletions
22
Userland/Libraries/LibWeb/Layout/SVGTextPathBox.cpp
Normal file
22
Userland/Libraries/LibWeb/Layout/SVGTextPathBox.cpp
Normal file
|
@ -0,0 +1,22 @@
|
|||
/*
|
||||
* Copyright (c) 2023, MacDue <macdue@dueutil.tech>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include <LibWeb/Layout/SVGTextPathBox.h>
|
||||
#include <LibWeb/Painting/SVGPathPaintable.h>
|
||||
|
||||
namespace Web::Layout {
|
||||
|
||||
SVGTextPathBox::SVGTextPathBox(DOM::Document& document, SVG::SVGTextPathElement& element, NonnullRefPtr<CSS::StyleProperties> properties)
|
||||
: SVGGraphicsBox(document, element, properties)
|
||||
{
|
||||
}
|
||||
|
||||
JS::GCPtr<Painting::Paintable> SVGTextPathBox::create_paintable() const
|
||||
{
|
||||
return Painting::SVGPathPaintable::create(*this);
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue