Donner 0.5.1
Embeddable browser-grade SVG2 engine
Loading...
Searching...
No Matches
donner::svg::PropertyRegistry Class Reference

Holds CSS properties for a single element. More...

#include "donner/svg/properties/PropertyRegistry.h"

Collaboration diagram for donner::svg::PropertyRegistry:
[legend]

Public Member Functions

 PropertyRegistry ()
 Constructor.
 ~PropertyRegistry ()
 Destructor.
 PropertyRegistry (const PropertyRegistry &)
 Copy constructor.
 PropertyRegistry (PropertyRegistry &&) noexcept
 Move constructor.
PropertyRegistryoperator= (const PropertyRegistry &)
 Copy assignment operator.
PropertyRegistryoperator= (PropertyRegistry &&) noexcept
 Move assignment operator.
auto allProperties () const
 Return a tuple of all properties within the PropertyRegistry.
auto allPropertiesMutable ()
 Return a mutable tuple of all properties within the PropertyRegistry.
size_t numPropertiesSet () const
 Return the number of properties set within the PropertyRegistry.
PropertyRegistry inheritFrom (const PropertyRegistry &parent, PropertyInheritOptions options=PropertyInheritOptions::All) const
 Inherit the value of each element in the stylesheet.
void resolveFontSize (double parentFontSizePx)
 Resolve font-size from relative units (em, %, ex) to absolute pixels.
void resolveFontWeight (int parentFontWeight)
 Resolve relative font-weight keywords (bolder/lighter) against the parent's computed font-weight.
void resolveFontStretch (int parentFontStretch)
 Resolve relative font-stretch keywords (narrower/wider) against the parent's computed font-stretch value.
std::optional< ParseDiagnosticparseProperty (const css::Declaration &declaration, css::Specificity specificity)
 Parse a single declaration, adding it to the property registry.
void parseStyle (std::string_view str)
 Parse a SVG style attribute, and set the parsed values on this PropertyRegistry.
void clearStyleAttributeProperties ()
 Clear every property that was set from a style="" attribute, leaving presentation attributes (specificity 0,0,0) and stylesheet-origin declarations intact.
ParseResult< bool > parsePresentationAttribute (std::string_view name, std::string_view value, EntityHandle handle=EntityHandle())
 Parse a common presentation attribute (CSS properties like fill, stroke, etc.) or transform.

Static Public Member Functions

static constexpr size_t numProperties ()
 Return the size of the tuple returned by allProperties().
template<size_t Start, size_t End, class F>
static constexpr void forEachProperty (const F &f)
 Calls a compile time functor for each property in the registry.
static bool isPresentationAttributeInherited (std::string_view name)
 Returns true if a presentation attribute participates in inheritance.

Public Attributes

Property< css::Color, PropertyCascade::Inheritcolor
 color property, which stores the context color of the element. For painting shapes, use stroke or fill instead.
Property< Displaydisplay {"display", []() -> std::optional<Display> { return Display::Inline; }}
 display property, which determines how the element is rendered. Set to Display::None to hide the element.
Property< double > opacity {"opacity", []() -> std::optional<double> { return 1.0; }}
 opacity property, which determines the opacity of the element. A value of 0.0 will make the element invisible.
Property< Visibility, PropertyCascade::Inheritvisibility
 visibility property, which determines whether the element is visible. Set to Visibility::Hidden to hide the element. Compared to display with Display::None, hiding the element will not remove it from the document, so it will still contribute to bounding boxes.
Property< Overflowoverflow
 overflow property, which determines how content that overflows the element's box is handled. Defaults to visible.
Property< TransformOrigintransformOrigin
 transform-origin property, which sets the origin for transformations.
Property< PaintServer, PropertyCascade::PaintInheritfill
 fill property, which determines the color of the element's interior. Defaults to black.
Property< FillRule, PropertyCascade::InheritfillRule
 fill-rule property, which determines how the interior of the element is filled in the case of overlapping shapes. Defaults to FillRule::NonZero.
Property< double, PropertyCascade::InheritfillOpacity
 fill-opacity property, which determines the opacity of the element's interior. Defaults to 1.0. A value of 0.0 will make the interior invisible.
Property< PaintServer, PropertyCascade::PaintInheritstroke
 stroke property, which determines the color of the element's outline stroke. Defaults to none.
Property< double, PropertyCascade::InheritstrokeOpacity
 stroke-opacity property, which determines the opacity of the element's outline stroke. Defaults to 1.0. A value of 0.0 will make the outline invisible.
Property< Lengthd, PropertyCascade::InheritstrokeWidth
 stroke-width property, which determines the width of the element's outline stroke. Defaults to 1.0.
Property< StrokeLinecap, PropertyCascade::InheritstrokeLinecap
 stroke-linecap property, which determines the shape of the element's outline stroke at the ends of the path. Defaults to StrokeLinecap::Butt.
Property< StrokeLinejoin, PropertyCascade::InheritstrokeLinejoin
 stroke-linejoin property, which determines the shape of the element's outline stroke in between line segments. Defaults to StrokeLinejoin::Miter.
Property< double, PropertyCascade::InheritstrokeMiterlimit
 stroke-miterlimit property, which determines the limit of the ratio of the miter length to the stroke width. Defaults to 4.0.
Property< StrokeDasharray, PropertyCascade::InheritstrokeDasharray
 stroke-dasharray property, which determines the pattern of dashes and gaps used to stroke paths.
Property< Lengthd, PropertyCascade::InheritstrokeDashoffset
 stroke-dashoffset property, which determines the distance into the dash pattern to start the stroke.
Property< Reference, PropertyCascade::NoneclipPath
 clip-path property, which determines the shape of the element's clipping region. Defaults to none.
Property< ClipRule, PropertyCascade::InheritclipRule
 clip-rule property, which determines how the interior of the element is filled in the case of overlapping shapes. Defaults to ClipRule::NonZero.
Property< Reference, PropertyCascade::Nonemask
 mask property, which determines the shape of the element's clipping region. Defaults to none.
Property< std::vector< FilterEffect > > filter
 filter property, which determines the filter effect(s) to apply to the element. Defaults to an empty list (no filter). Supports CSS filter function lists like blur(5px) grayscale().
Property< ColorInterpolationFilters, PropertyCascade::InheritcolorInterpolationFilters
 color-interpolation-filters property, which determines the color space for filter operations. Defaults to ColorInterpolationFilters::LinearRGB. Inherited.
Property< PointerEvents, PropertyCascade::InheritpointerEvents
 pointer-events property, which determines how the element responds to pointer events (such as clicks or hover). Defaults to PointerEvents::VisiblePainted.
Property< CursorType, PropertyCascade::Inheritcursor
 cursor property, which defines the mouse cursor to display when hovering over the element. Defaults to CursorType::Auto. Inherited.
Property< Reference, PropertyCascade::InheritmarkerStart
 marker-start property, which determines the marker to be drawn at the start of the path.
Property< Reference, PropertyCascade::InheritmarkerMid
 marker-mid property, which determines the marker to be drawn at the middle of the path.
Property< Reference, PropertyCascade::InheritmarkerEnd
 marker-end property, which determines the marker to be drawn at the end of the path.
Property< SmallVector< RcString, 1 >, PropertyCascade::InheritfontFamily
 font-family property, which determines the font family for text content. Inherited.
Property< Lengthd, PropertyCascade::InheritfontSize
 font-size property, which determines the font size for text content. Inherited. Initial value is medium, which maps to the UA default font size (12px).
Property< int, PropertyCascade::InheritfontWeight
 font-weight property, which determines the font weight (boldness) for text content. Inherited. Value is a numeric weight (100-900), where 400=normal and 700=bold. The relative keywords bolder/lighter are stored as sentinel values and resolved by resolveFontWeight() during style cascade.
Property< FontStyle, PropertyCascade::InheritfontStyle
 font-style property, which determines the style (normal/italic/oblique) for text content. Inherited. Defaults to FontStyle::Normal.
Property< int, PropertyCascade::InheritfontStretch
 font-stretch property, which determines the width (condensed/expanded) for text content. Inherited. Stored as the underlying integer of FontStretch for sentinel support. Defaults to FontStretch::Normal (5).
Property< FontVariant, PropertyCascade::InheritfontVariant
 font-variant shorthand property (SVG 1.1 subset: normal | small-caps). Inherited. Defaults to FontVariant::Normal.
Property< TextAnchor, PropertyCascade::InherittextAnchor
 text-anchor property, which determines the alignment of text relative to its anchor point. Inherited. Defaults to TextAnchor::Start.
Property< TextDecorationtextDecoration
 text-decoration property, which determines decoration lines drawn on text. Not inherited. Defaults to TextDecoration::None.
Property< DominantBaselinedominantBaseline
 dominant-baseline property, which determines the baseline alignment for text. Not inherited. Defaults to DominantBaseline::Auto.
Property< Lengthd, PropertyCascade::InheritletterSpacing
 letter-spacing property, extra spacing between characters. Inherited. "normal" maps to 0. Defaults to 0 (normal).
Property< Lengthd, PropertyCascade::InheritwordSpacing
 word-spacing property, extra spacing between words (U+0020 space characters). Inherited. "normal" maps to 0. Defaults to 0 (normal).
Property< LengthdbaselineShift
 baseline-shift property. Shifts the dominant baseline of the element. Not inherited. "baseline" = 0, "sub"/"super" map to em-relative offsets. Positive = shift up (per CSS). Stored as Lengthd.
Property< DominantBaselinealignmentBaseline
 alignment-baseline property. Specifies how an inline element aligns with its parent's baseline. Uses the same enum as dominant-baseline. Not inherited.
Property< WritingMode, PropertyCascade::InheritwritingMode
 writing-mode property, controlling text flow direction. Inherited.
Property< MixBlendModemixBlendMode
 mix-blend-mode property. Controls how an element composites with its backdrop. Not inherited. Defaults to Normal (SourceOver).
Property< Isolationisolation
 isolation property. Forces creation of a new stacking context. Not inherited. Defaults to Auto.
Property< ImageRendering, PropertyCascade::InheritimageRendering
 image-rendering property. Controls the sampling filter for raster image upscaling (auto = bilinear, pixelated = nearest-neighbor). Inherited.
std::map< RcString, parser::UnparsedPropertyunparsedProperties
 Properties which don't have specific listings above, which are stored as raw css declarations.

Static Public Attributes

static constexpr int kFontWeightBolder = -1
 Sentinel value for the bolder relative keyword, resolved during cascade.
static constexpr int kFontWeightLighter = -2
 Sentinel value for the lighter relative keyword, resolved during cascade.
static constexpr int kFontStretchNarrower = -1
 Sentinel value for the narrower relative keyword, resolved during cascade.
static constexpr int kFontStretchWider = -2
 Sentinel value for the wider relative keyword, resolved during cascade.

Friends

std::ostream & operator<< (std::ostream &os, const PropertyRegistry &registry)
 Ostream output operator, for debugging which outputs a human-readable representation of all of the properties.

Detailed Description

Holds CSS properties for a single element.

This class stores common properties which may be applied to any element, plus unparsedProperties which contains element-specific properties which are applied if the element matches.

For unparsedProperties, presentation attributes specified in CSS such as transform will be stored here until they can be applied to the element.

Supported properties

Property Member Default
color color black
display display inline
opacity Opacity 1.0
visibility visibility visible
overflow overflow visible
fill fill black
fill-rule fillRule nonzero
fill-opacity fillOpacity 1.0
stroke stroke none
stroke-opacity strokeOpacity 1.0
stroke-width strokeWidth 1.0
stroke-linecap strokeLinecap butt
stroke-linejoin strokeLinejoin miter
stroke-miterlimit strokeMiterlimit 4.0
stroke-dasharray strokeDasharray none
stroke-dashoffset strokeDashoffset 0
clip-path clipPath none
clip-rule clipRule nonzero
mask Mask none
pointer-events pointerEvents auto
cursor cursor auto
marker-start markerStart none
marker-mid markerMid none
marker-end markerEnd none
font-family fontFamily serif
font-size fontSize 16px
text-anchor textAnchor start
text-decoration textDecoration none
dominant-baseline dominantBaseline auto

Member Function Documentation

◆ allProperties()

auto donner::svg::PropertyRegistry::allProperties ( ) const
inline

Return a tuple of all properties within the PropertyRegistry.

To get the size of the tuple, use numProperties().

◆ allPropertiesMutable()

auto donner::svg::PropertyRegistry::allPropertiesMutable ( )
inline

Return a mutable tuple of all properties within the PropertyRegistry.

See also
allProperties()

◆ clearStyleAttributeProperties()

void donner::svg::PropertyRegistry::clearStyleAttributeProperties ( )

Clear every property that was set from a style="" attribute, leaving presentation attributes (specificity 0,0,0) and stylesheet-origin declarations intact.

Identifies style-origin properties by their stored css::Specificity::StyleAttribute() tag — the same tag parseStyle applies when it writes them.

Use this before re-calling parseStyle on the same registry to get "replace the `style=""` contribution" semantics while preserving fill="red" and the like.

Also clears entries from unparsedProperties whose specificity matches StyleAttribute().

◆ forEachProperty()

template<size_t Start, size_t End, class F>
constexpr void donner::svg::PropertyRegistry::forEachProperty ( const F & f)
inlinestaticconstexpr

Calls a compile time functor for each property in the registry.

Example:

auto properties = allProperties();
forEachProperty<0, numProperties()>([&properties](auto i) {
auto& property = std::get<i>(properties);
}
auto allProperties() const
Return a tuple of all properties within the PropertyRegistry.
Definition PropertyRegistry.h:413
static constexpr void forEachProperty(const F &f)
Calls a compile time functor for each property in the registry.
Definition PropertyRegistry.h:464
Template Parameters
StartIndex of the current property to call.
EndTotal number of properties in the registry.
FType of the functor object, with signature void(std::integral_constant<size_t>).
Parameters
fFunctor instance.

◆ inheritFrom()

PropertyRegistry donner::svg::PropertyRegistry::inheritFrom ( const PropertyRegistry & parent,
PropertyInheritOptions options = PropertyInheritOptions::All ) const
nodiscard

Inherit the value of each element in the stylesheet.

Parameters
parentPropertyRegistry from this element's direct parent, where properties will be inherited from.
optionsOptions for how to inherit properties, which can be used to skip inheritance for a category of properties.

◆ isPresentationAttributeInherited()

bool donner::svg::PropertyRegistry::isPresentationAttributeInherited ( std::string_view name)
static

Returns true if a presentation attribute participates in inheritance.

This uses the underlying property cascade metadata instead of a hand-maintained list in DOM mutation code.

Parameters
namePresentation attribute name.
Returns
True if the property inherits to descendants.

◆ parsePresentationAttribute()

ParseResult< bool > donner::svg::PropertyRegistry::parsePresentationAttribute ( std::string_view name,
std::string_view value,
EntityHandle handle = EntityHandle() )

Parse a common presentation attribute (CSS properties like fill, stroke, etc.) or transform.

This handles properties stored in PropertyRegistry and the transform attribute. For element-specific presentation attributes (like cx on circles), use parser::ParsePresentationAttribute separately.

See also
https://www.w3.org/TR/SVG2/styling.html#PresentationAttributes
Parameters
nameName of the attribute.
valueValue of the attribute, parsed as a CSS value.
handleEntity handle, needed for transform attribute parsing.
Returns
true if the attribute was parsed successfully, false if not recognized, or a ParseDiagnostic if parsing failed.

◆ parseProperty()

std::optional< ParseDiagnostic > donner::svg::PropertyRegistry::parseProperty ( const css::Declaration & declaration,
css::Specificity specificity )

Parse a single declaration, adding it to the property registry.

Parameters
declarationDeclaration to parse.
specificitySpecificity of the declaration.
Returns
Error if the declaration had errors parsing or the property is not supported.

◆ parseStyle()

void donner::svg::PropertyRegistry::parseStyle ( std::string_view str)

Parse a SVG style attribute, and set the parsed values on this PropertyRegistry.

Does not clear existing properties, new ones are applied additively.

Parses the string as a CSS "<declaration-list>", ignoring any parse errors or unsupported properties

Parameters
strInput string from a style attribute, e.g. "fill: red; stroke: blue".

◆ resolveFontSize()

void donner::svg::PropertyRegistry::resolveFontSize ( double parentFontSizePx)

Resolve font-size from relative units (em, %, ex) to absolute pixels.

Must be called after CSS cascade with the parent's computed font-size, since font-size percentages and em units resolve against the parent (not the viewBox).

Parameters
parentFontSizePxThe parent element's computed font-size in pixels. Use 16.0 (CSS initial value) for the root element.

◆ resolveFontStretch()

void donner::svg::PropertyRegistry::resolveFontStretch ( int parentFontStretch)

Resolve relative font-stretch keywords (narrower/wider) against the parent's computed font-stretch value.

Parameters
parentFontStretchThe parent element's computed font-stretch (as int). Use static_cast<int>(FontStretch::Normal) for root.

◆ resolveFontWeight()

void donner::svg::PropertyRegistry::resolveFontWeight ( int parentFontWeight)

Resolve relative font-weight keywords (bolder/lighter) against the parent's computed font-weight.

Parameters
parentFontWeightThe parent element's computed font-weight (100-900). Use 400 for root.

◆ operator<<

std::ostream & operator<< ( std::ostream & os,
const PropertyRegistry & registry )
friend

Ostream output operator, for debugging which outputs a human-readable representation of all of the properties.

Example output:

color: Color(rgba(0, 255, 0, 255)) (set) @ Specificity(0, 0, 0)
}
Property< css::Color, PropertyCascade::Inherit > color
color property, which stores the context color of the element. For painting shapes,...
Definition PropertyRegistry.h:123
@ Color
Source hue and saturation, destination luminosity.
Definition MixBlendMode.h:31
Parameters
osOutput stream.
registryPropertyRegistry to output.

Member Data Documentation

◆ alignmentBaseline

Property<DominantBaseline> donner::svg::PropertyRegistry::alignmentBaseline
Initial value:
{
"alignment-baseline",
[]() -> std::optional<DominantBaseline> { return DominantBaseline::Auto; }}
@ Auto
[DEFAULT] Use the default baseline for the script.
Definition DominantBaseline.h:23

alignment-baseline property. Specifies how an inline element aligns with its parent's baseline. Uses the same enum as dominant-baseline. Not inherited.

◆ baselineShift

Property<Lengthd> donner::svg::PropertyRegistry::baselineShift
Initial value:
{
"baseline-shift", []() -> std::optional<Lengthd> { return Lengthd(0, Lengthd::Unit::None); }}
Length< double > Lengthd
Shorthand for Length<double>.
Definition Length.h:277

baseline-shift property. Shifts the dominant baseline of the element. Not inherited. "baseline" = 0, "sub"/"super" map to em-relative offsets. Positive = shift up (per CSS). Stored as Lengthd.

◆ clipPath

Property<Reference, PropertyCascade::None> donner::svg::PropertyRegistry::clipPath
Initial value:
{
"clip-path", []() -> std::optional<Reference> { return std::nullopt; }}

clip-path property, which determines the shape of the element's clipping region. Defaults to none.

◆ clipRule

Property<ClipRule, PropertyCascade::Inherit> donner::svg::PropertyRegistry::clipRule
Initial value:
{
"clip-rule", []() -> std::optional<ClipRule> { return ClipRule::NonZero; }}
@ NonZero
[DEFAULT] Determines "insideness" of a point by counting crossings of a ray drawn from that point to ...
Definition ClipRule.h:19

clip-rule property, which determines how the interior of the element is filled in the case of overlapping shapes. Defaults to ClipRule::NonZero.

◆ color

Property<css::Color, PropertyCascade::Inherit> donner::svg::PropertyRegistry::color
Initial value:
{
"color", []() -> std::optional<css::Color> { return css::Color(css::RGBA(0, 0, 0, 0xFF)); }}
Represents a CSS color value, like a RGBA color from a #rrggbb or #rgb hex value, or the currentcolor...
Definition Color.h:113
Represents as 32-bit RGBA color, with each component in the range [0, 255].
Definition Color.h:25

color property, which stores the context color of the element. For painting shapes, use stroke or fill instead.

◆ colorInterpolationFilters

Property<ColorInterpolationFilters, PropertyCascade::Inherit> donner::svg::PropertyRegistry::colorInterpolationFilters
Initial value:
{
"color-interpolation-filters",
[]() -> std::optional<ColorInterpolationFilters> {
}}
@ LinearRGB
Operations are performed in the linearRGB color space.
Definition ColorInterpolationFilters.h:19

color-interpolation-filters property, which determines the color space for filter operations. Defaults to ColorInterpolationFilters::LinearRGB. Inherited.

◆ cursor

Property<CursorType, PropertyCascade::Inherit> donner::svg::PropertyRegistry::cursor
Initial value:
{
"cursor", []() -> std::optional<CursorType> { return CursorType::Auto; }}
@ Auto
The browser determines the cursor based on context.
Definition CursorType.h:17

cursor property, which defines the mouse cursor to display when hovering over the element. Defaults to CursorType::Auto. Inherited.

◆ dominantBaseline

Property<DominantBaseline> donner::svg::PropertyRegistry::dominantBaseline
Initial value:
{
"dominant-baseline",
[]() -> std::optional<DominantBaseline> { return DominantBaseline::Auto; }}

dominant-baseline property, which determines the baseline alignment for text. Not inherited. Defaults to DominantBaseline::Auto.

◆ fill

Property<PaintServer, PropertyCascade::PaintInherit> donner::svg::PropertyRegistry::fill
Initial value:
{
"fill", []() -> std::optional<PaintServer> {
}}
static constexpr RGBA RGB(uint8_t r, uint8_t g, uint8_t b)
Constructor, for RGB colors, which are fully opaque.
Definition Color.h:38
Represents a solid color paint server.
Definition PaintServer.h:36

fill property, which determines the color of the element's interior. Defaults to black.

◆ fillOpacity

Property<double, PropertyCascade::Inherit> donner::svg::PropertyRegistry::fillOpacity
Initial value:
{
"fill-opacity", []() -> std::optional<double> { return 1.0; }}

fill-opacity property, which determines the opacity of the element's interior. Defaults to 1.0. A value of 0.0 will make the interior invisible.

◆ fillRule

Property<FillRule, PropertyCascade::Inherit> donner::svg::PropertyRegistry::fillRule
Initial value:
{
"fill-rule", []() -> std::optional<FillRule> { return FillRule::NonZero; }}
@ NonZero
[DEFAULT] Determines "insideness" of a point by counting crossings of a ray drawn from that point to ...
Definition FillRule.h:19

fill-rule property, which determines how the interior of the element is filled in the case of overlapping shapes. Defaults to FillRule::NonZero.

◆ filter

Property<std::vector<FilterEffect> > donner::svg::PropertyRegistry::filter
Initial value:
{
"filter",
[]() -> std::optional<std::vector<FilterEffect>> { return std::vector<FilterEffect>(); }}

filter property, which determines the filter effect(s) to apply to the element. Defaults to an empty list (no filter). Supports CSS filter function lists like blur(5px) grayscale().

◆ fontFamily

Property<SmallVector<RcString, 1>, PropertyCascade::Inherit> donner::svg::PropertyRegistry::fontFamily
Initial value:
{
"font-family", []() -> std::optional<SmallVector<RcString, 1>> {
}}
A reference counted string, that is copy-on-write and implements the small-string optimization.
Definition RcString.h:30
A vector with small-size optimization.
Definition SmallVector.h:24

font-family property, which determines the font family for text content. Inherited.

◆ fontSize

Property<Lengthd, PropertyCascade::Inherit> donner::svg::PropertyRegistry::fontSize
Initial value:
{
"font-size", []() -> std::optional<Lengthd> { return Lengthd(12, Lengthd::Unit::Px); }}

font-size property, which determines the font size for text content. Inherited. Initial value is medium, which maps to the UA default font size (12px).

◆ fontStretch

Property<int, PropertyCascade::Inherit> donner::svg::PropertyRegistry::fontStretch
Initial value:
{
"font-stretch", []() -> std::optional<int> { return static_cast<int>(FontStretch::Normal); }}
@ Normal
[DEFAULT] Normal width (100%).
Definition FontStretch.h:27

font-stretch property, which determines the width (condensed/expanded) for text content. Inherited. Stored as the underlying integer of FontStretch for sentinel support. Defaults to FontStretch::Normal (5).

◆ fontStyle

Property<FontStyle, PropertyCascade::Inherit> donner::svg::PropertyRegistry::fontStyle
Initial value:
{
"font-style", []() -> std::optional<FontStyle> { return FontStyle::Normal; }}
@ Normal
[DEFAULT] Normal (upright) style.
Definition FontStyle.h:21

font-style property, which determines the style (normal/italic/oblique) for text content. Inherited. Defaults to FontStyle::Normal.

◆ fontVariant

Property<FontVariant, PropertyCascade::Inherit> donner::svg::PropertyRegistry::fontVariant
Initial value:
{
"font-variant", []() -> std::optional<FontVariant> { return FontVariant::Normal; }}
@ Normal
[DEFAULT] Normal variant.
Definition FontVariant.h:24

font-variant shorthand property (SVG 1.1 subset: normal | small-caps). Inherited. Defaults to FontVariant::Normal.

◆ fontWeight

Property<int, PropertyCascade::Inherit> donner::svg::PropertyRegistry::fontWeight
Initial value:
{"font-weight",
[]() -> std::optional<int> { return 400; }}

font-weight property, which determines the font weight (boldness) for text content. Inherited. Value is a numeric weight (100-900), where 400=normal and 700=bold. The relative keywords bolder/lighter are stored as sentinel values and resolved by resolveFontWeight() during style cascade.

◆ imageRendering

Property<ImageRendering, PropertyCascade::Inherit> donner::svg::PropertyRegistry::imageRendering
Initial value:
{
"image-rendering",
[]() -> std::optional<ImageRendering> { return ImageRendering::Auto; }}
@ Auto
[DEFAULT] UA picks the algorithm; typically bilinear/trilinear.
Definition ImageRendering.h:18

image-rendering property. Controls the sampling filter for raster image upscaling (auto = bilinear, pixelated = nearest-neighbor). Inherited.

◆ isolation

Property<Isolation> donner::svg::PropertyRegistry::isolation
Initial value:
{"isolation",
[]() -> std::optional<Isolation> { return Isolation::Auto; }}
@ Auto
[DEFAULT] Element does not necessarily create a new stacking context.
Definition Isolation.h:15

isolation property. Forces creation of a new stacking context. Not inherited. Defaults to Auto.

◆ letterSpacing

Property<Lengthd, PropertyCascade::Inherit> donner::svg::PropertyRegistry::letterSpacing
Initial value:
{
"letter-spacing", []() -> std::optional<Lengthd> { return Lengthd(0, Lengthd::Unit::None); }}

letter-spacing property, extra spacing between characters. Inherited. "normal" maps to 0. Defaults to 0 (normal).

◆ markerEnd

Property<Reference, PropertyCascade::Inherit> donner::svg::PropertyRegistry::markerEnd
Initial value:
{
"marker-end", []() -> std::optional<Reference> { return std::nullopt; }}

marker-end property, which determines the marker to be drawn at the end of the path.

◆ markerMid

Property<Reference, PropertyCascade::Inherit> donner::svg::PropertyRegistry::markerMid
Initial value:
{
"marker-mid", []() -> std::optional<Reference> { return std::nullopt; }}

marker-mid property, which determines the marker to be drawn at the middle of the path.

◆ markerStart

Property<Reference, PropertyCascade::Inherit> donner::svg::PropertyRegistry::markerStart
Initial value:
{
"marker-start", []() -> std::optional<Reference> { return std::nullopt; }}

marker-start property, which determines the marker to be drawn at the start of the path.

◆ mask

Property<Reference, PropertyCascade::None> donner::svg::PropertyRegistry::mask
Initial value:
{
"mask", []() -> std::optional<Reference> { return std::nullopt; }}

mask property, which determines the shape of the element's clipping region. Defaults to none.

◆ mixBlendMode

Property<MixBlendMode> donner::svg::PropertyRegistry::mixBlendMode
Initial value:
{
"mix-blend-mode", []() -> std::optional<MixBlendMode> { return MixBlendMode::Normal; }}
@ Normal
[DEFAULT] Source over destination (no blending effect).
Definition MixBlendMode.h:17

mix-blend-mode property. Controls how an element composites with its backdrop. Not inherited. Defaults to Normal (SourceOver).

◆ overflow

Property<Overflow> donner::svg::PropertyRegistry::overflow
Initial value:
{"overflow",
[]() -> std::optional<Overflow> { return Overflow::Visible; }}
@ Visible
[DEFAULT] "visible": Content is not clipped, and may render outside the box.
Definition Overflow.h:28

overflow property, which determines how content that overflows the element's box is handled. Defaults to visible.

◆ pointerEvents

Property<PointerEvents, PropertyCascade::Inherit> donner::svg::PropertyRegistry::pointerEvents
Initial value:
{
"pointer-events",
[]() -> std::optional<PointerEvents> { return PointerEvents::VisiblePainted; }}
@ VisiblePainted
Responds to pointer events only if the element is visible and the pointer is over the painted area,...
Definition PointerEvents.h:22

pointer-events property, which determines how the element responds to pointer events (such as clicks or hover). Defaults to PointerEvents::VisiblePainted.

◆ stroke

Property<PaintServer, PropertyCascade::PaintInherit> donner::svg::PropertyRegistry::stroke
Initial value:
{
"stroke", []() -> std::optional<PaintServer> { return PaintServer::None(); }}
Represents the "none" value for a paint server.
Definition PaintServer.h:18

stroke property, which determines the color of the element's outline stroke. Defaults to none.

◆ strokeDasharray

Property<StrokeDasharray, PropertyCascade::Inherit> donner::svg::PropertyRegistry::strokeDasharray
Initial value:
{
"stroke-dasharray", []() -> std::optional<StrokeDasharray> { return std::nullopt; }}

stroke-dasharray property, which determines the pattern of dashes and gaps used to stroke paths.

◆ strokeDashoffset

Property<Lengthd, PropertyCascade::Inherit> donner::svg::PropertyRegistry::strokeDashoffset
Initial value:
{
"stroke-dashoffset",
[]() -> std::optional<Lengthd> { return Lengthd(0, Lengthd::Unit::None); }}

stroke-dashoffset property, which determines the distance into the dash pattern to start the stroke.

◆ strokeLinecap

Property<StrokeLinecap, PropertyCascade::Inherit> donner::svg::PropertyRegistry::strokeLinecap
Initial value:
{
"stroke-linecap", []() -> std::optional<StrokeLinecap> { return StrokeLinecap::Butt; }}
@ Butt
[DEFAULT] The stroke is squared off at the endpoint of the path.
Definition Stroke.h:23

stroke-linecap property, which determines the shape of the element's outline stroke at the ends of the path. Defaults to StrokeLinecap::Butt.

◆ strokeLinejoin

Property<StrokeLinejoin, PropertyCascade::Inherit> donner::svg::PropertyRegistry::strokeLinejoin
Initial value:
{
"stroke-linejoin", []() -> std::optional<StrokeLinejoin> { return StrokeLinejoin::Miter; }}
@ Miter
[DEFAULT] The outer edges of the strokes for the two segments are extended until they meet at an angl...
Definition Stroke.h:47

stroke-linejoin property, which determines the shape of the element's outline stroke in between line segments. Defaults to StrokeLinejoin::Miter.

◆ strokeMiterlimit

Property<double, PropertyCascade::Inherit> donner::svg::PropertyRegistry::strokeMiterlimit
Initial value:
{
"stroke-miterlimit", []() -> std::optional<double> { return 4.0; }}

stroke-miterlimit property, which determines the limit of the ratio of the miter length to the stroke width. Defaults to 4.0.

◆ strokeOpacity

Property<double, PropertyCascade::Inherit> donner::svg::PropertyRegistry::strokeOpacity
Initial value:
{
"stroke-opacity", []() -> std::optional<double> { return 1.0; }}

stroke-opacity property, which determines the opacity of the element's outline stroke. Defaults to 1.0. A value of 0.0 will make the outline invisible.

◆ strokeWidth

Property<Lengthd, PropertyCascade::Inherit> donner::svg::PropertyRegistry::strokeWidth
Initial value:
{
"stroke-width", []() -> std::optional<Lengthd> { return Lengthd(1, Lengthd::Unit::None); }}

stroke-width property, which determines the width of the element's outline stroke. Defaults to 1.0.

◆ textAnchor

Property<TextAnchor, PropertyCascade::Inherit> donner::svg::PropertyRegistry::textAnchor
Initial value:
{
"text-anchor", []() -> std::optional<TextAnchor> { return TextAnchor::Start; }}
@ Start
[DEFAULT] Text starts at the anchor position.
Definition TextAnchor.h:23

text-anchor property, which determines the alignment of text relative to its anchor point. Inherited. Defaults to TextAnchor::Start.

◆ textDecoration

Property<TextDecoration> donner::svg::PropertyRegistry::textDecoration
Initial value:
{
"text-decoration", []() -> std::optional<TextDecoration> { return TextDecoration::None; }}
@ None
[DEFAULT] No text decoration.
Definition TextDecoration.h:24

text-decoration property, which determines decoration lines drawn on text. Not inherited. Defaults to TextDecoration::None.

◆ transformOrigin

Property<TransformOrigin> donner::svg::PropertyRegistry::transformOrigin
Initial value:
{
"transform-origin", []() -> std::optional<TransformOrigin> {
return TransformOrigin{Lengthd(50, Lengthd::Unit::Percent),
Lengthd(50, Lengthd::Unit::Percent)};
}}
Represents the transform-origin property value.
Definition TransformOrigin.h:14

transform-origin property, which sets the origin for transformations.

◆ visibility

Property<Visibility, PropertyCascade::Inherit> donner::svg::PropertyRegistry::visibility
Initial value:
{
"visibility", []() -> std::optional<Visibility> { return Visibility::Visible; }}
@ Visible
[DEFAULT] Visible is the default value.
Definition Visibility.h:23

visibility property, which determines whether the element is visible. Set to Visibility::Hidden to hide the element. Compared to display with Display::None, hiding the element will not remove it from the document, so it will still contribute to bounding boxes.

◆ wordSpacing

Property<Lengthd, PropertyCascade::Inherit> donner::svg::PropertyRegistry::wordSpacing
Initial value:
{
"word-spacing", []() -> std::optional<Lengthd> { return Lengthd(0, Lengthd::Unit::None); }}

word-spacing property, extra spacing between words (U+0020 space characters). Inherited. "normal" maps to 0. Defaults to 0 (normal).

◆ writingMode

Property<WritingMode, PropertyCascade::Inherit> donner::svg::PropertyRegistry::writingMode
Initial value:
{
"writing-mode", []() -> std::optional<WritingMode> { return WritingMode::HorizontalTb; }}
@ HorizontalTb
[DEFAULT] Left-to-right, top-to-bottom (horizontal text).
Definition WritingMode.h:18

writing-mode property, controlling text flow direction. Inherited.


The documentation for this class was generated from the following file: