NovaSVG 0.10.0
A header-only SVG library
Loading...
Searching...
No Matches
novasvg Namespace Reference

Main namespace for the NovaSVG library. More...

Namespaces

namespace  color_literals
 String literal operators for creating Color instances.
 
namespace  detail
 
namespace  render
 
namespace  Specificity
 

Classes

class  Attribute
 
struct  AttributeSelector
 
class  BaselineShift
 
class  Bitmap
 
class  BitmapCodec
 
class  Box
 Represents a 2D axis-aligned bounding box. More...
 
struct  CascadedValue
 
class  Color
 Represents a color in RGBA format (0xRRGGBBAA). More...
 
class  ColorBlend
 Lightweight helper class for color blending operations. More...
 
struct  Declaration
 
class  Document
 
class  Element
 
class  Font
 
class  FontFace
 
class  FontFaceCache
 
struct  ForeignObjectFonts
 The faces a <foreignObject> can paint with: its own font plus the bold / italic variants of it that , , , and inline font-weight / font-style ask for. More...
 
struct  ForeignObjectMetrics
 Metrics for how ForeignObjectSimple::render() will lay out and size a <foreignObject>'s content, computed WITHOUT actually rendering it. More...
 
class  ForeignObjectRenderer
 Renders the (HTML-ish) content captured inside a <foreignObject>. More...
 
class  ForeignObjectSimple
 Default ForeignObjectRenderer: tag-stripped plain text, centered. More...
 
struct  HtmlNode
 
class  Length
 
class  LengthContext
 
class  Matrix
 Represents a 2D transformation matrix. More...
 
class  Node
 
class  Paint
 
class  Path
 
class  PathIterator
 
class  Point
 
struct  PseudoClassSelector
 
class  Rect
 
struct  Rule
 
class  RuleData
 
class  RuleIndex
 
struct  SimpleSelector
 
class  Size
 
struct  StyleNode
 
class  SVGAngle
 
class  SVGBlendInfo
 
struct  SVGCharacterPosition
 
class  SVGCircleElement
 
class  SVGClipPathElement
 
class  SVGDefsElement
 
class  SVGElement
 
class  SVGEllipseElement
 
class  SVGEnumeration
 
class  SVGFECompositeElement
 
class  SVGFEDropShadowElement
 
class  SVGFEFloodElement
 
class  SVGFEGaussianBlurElement
 
class  SVGFEMergeElement
 
class  SVGFEOffsetElement
 
class  SVGFilterContext
 
class  SVGFilterElement
 
class  SVGFitToViewBox
 
class  SVGForeignObjectElement
 
class  SVGGElement
 
class  SVGGeometryElement
 
class  SVGGradientAttributes
 
class  SVGGradientElement
 
class  SVGGraphicsElement
 
class  SVGImageElement
 
class  SVGLayoutState
 
class  SVGLength
 
class  SVGLengthList
 
class  SVGLinearGradientAttributes
 
class  SVGLinearGradientElement
 
class  SVGLineElement
 
class  SVGMarkerElement
 
class  SVGMarkerPosition
 
class  SVGMaskElement
 
class  SVGNode
 
class  SVGNumber
 
class  SVGNumberList
 
class  SVGNumberPercentage
 
class  SVGPaintElement
 
class  SVGPaintServer
 
class  SVGPath
 
class  SVGPathElement
 
class  SVGPatternAttributes
 
class  SVGPatternElement
 
class  SVGPoint
 
class  SVGPointList
 
class  SVGPolyElement
 
class  SVGPreserveAspectRatio
 
class  SVGProperty
 
class  SVGRadialGradientAttributes
 
class  SVGRadialGradientElement
 
class  SVGRect
 
class  SVGRectElement
 
class  SVGRenderState
 
class  SVGRootElement
 
class  SVGStopElement
 
class  SVGString
 
class  SVGStyleElement
 
class  SVGSVGElement
 
class  SVGSwitchElement
 
class  SVGSymbolElement
 
class  SVGTextElement
 
struct  SVGTextFragment
 
class  SVGTextFragmentsBuilder
 
class  SVGTextNode
 
struct  SVGTextPosition
 
class  SVGTextPositioningElement
 
class  SVGTransform
 
class  SVGTransformBox
 
class  SVGTransformOrigin
 
class  SVGTSpanElement
 
class  SVGURIReference
 
class  SVGUseElement
 
class  TextNode
 
class  Transform
 

Typedefs

template<typename Enum >
using SVGEnumerationEntry = std::pair< Enum, std::string_view >
 
using LengthList = std::vector< Length >
 
using NumberList = std::vector< float >
 
using PointList = std::vector< Point >
 
using AttributeList = std::forward_list< Attribute >
 
using SVGNodeList = std::list< std::unique_ptr< SVGNode > >
 
using SVGPropertyList = std::forward_list< SVGProperty * >
 
using SVGMarkerPositionList = std::vector< SVGMarkerPosition >
 
using SVGCharacterPositions = std::map< size_t, SVGCharacterPosition >
 
using SVGTextPositionList = std::vector< SVGTextPosition >
 
using SVGTextFragmentList = std::vector< SVGTextFragment >
 
using SVGTextFragmentIterator = SVGTextFragmentList::iterator
 
using Selector = std::vector< SimpleSelector >
 
using SelectorList = std::vector< Selector >
 
using DeclarationList = std::vector< Declaration >
 
using RuleDataList = std::vector< RuleData >
 
using NodeList = std::vector< Node >
 
using ElementList = std::vector< Element >
 

Enumerations

enum class  LineCap : uint8_t { Butt = NOVASVG_LINE_CAP_BUTT , Round = NOVASVG_LINE_CAP_ROUND , Square = NOVASVG_LINE_CAP_SQUARE }
 
enum class  LineJoin : uint8_t { Miter = NOVASVG_LINE_JOIN_MITER , Round = NOVASVG_LINE_JOIN_ROUND , Bevel = NOVASVG_LINE_JOIN_BEVEL }
 
enum class  FillRule : uint8_t { NonZero = NOVASVG_FILL_RULE_NON_ZERO , EvenOdd = NOVASVG_FILL_RULE_EVEN_ODD }
 
enum class  SpreadMethod : uint8_t { Pad = NOVASVG_SPREAD_METHOD_PAD , Reflect = NOVASVG_SPREAD_METHOD_REFLECT , Repeat = NOVASVG_SPREAD_METHOD_REPEAT }
 
enum class  PathCommand { MoveTo = NOVASVG_PATH_COMMAND_MOVE_TO , LineTo = NOVASVG_PATH_COMMAND_LINE_TO , CubicTo = NOVASVG_PATH_COMMAND_CUBIC_TO , Close = NOVASVG_PATH_COMMAND_CLOSE }
 
enum class  PropertyID : uint8_t {
  Unknown = 0 , Alignment_Baseline , Background_Color , Baseline_Shift ,
  Class , Clip_Path , Clip_Rule , ClipPathUnits ,
  Color , Cx , Cy , D ,
  Direction , Display , Dominant_Baseline , Dx ,
  Dy , Fill , Fill_Opacity , Fill_Rule ,
  Filter , Flood_Color , Flood_Opacity , Font_Family ,
  Font_Size , Font_Style , Font_Weight , Fx ,
  Fy , GradientTransform , GradientUnits , Height ,
  Href , Id , In , In2 ,
  K1 , K2 , K3 , K4 ,
  LengthAdjust , Letter_Spacing , Marker_End , Marker_Mid ,
  Marker_Start , MarkerHeight , MarkerUnits , MarkerWidth ,
  Mask , Mask_Type , MaskContentUnits , MaskUnits ,
  Mix_Blend_Mode , Offset , Opacity , Operator ,
  Orient , Overflow , PatternContentUnits , PatternTransform ,
  PatternUnits , Pointer_Events , Points , PreserveAspectRatio ,
  R , RefX , RefY , RequiredExtensions ,
  Result , Rotate , Rx , Ry ,
  SpreadMethod , StdDeviation , Stop_Color , Stop_Opacity ,
  Stroke , Stroke_Dasharray , Stroke_Dashoffset , Stroke_Linecap ,
  Stroke_Linejoin , Stroke_Miterlimit , Stroke_Opacity , Stroke_Width ,
  Style , SystemLanguage , Text_Anchor , Text_Orientation ,
  TextLength , Transform , Transform_Box , Transform_Origin ,
  ViewBox , Visibility , White_Space , Width ,
  Word_Spacing , Writing_Mode , X , X1 ,
  X2 , Y , Y1 , Y2
}
 
enum class  Display : uint8_t { Inline , None }
 
enum class  Visibility : uint8_t { Visible , Hidden , Collapse }
 
enum class  Overflow : uint8_t { Visible , Hidden }
 
enum class  MixBlendMode : uint8_t {
  Normal , Multiply , Screen , Darken ,
  Lighten , Difference , Exclusion
}
 
enum class  PointerEvents : uint8_t {
  None , Auto , Stroke , Fill ,
  Painted , Visible , VisibleStroke , VisibleFill ,
  VisiblePainted , BoundingBox , All
}
 
enum class  FontStyle : uint8_t { Normal , Italic }
 
enum class  FontWeight : uint8_t { Normal , Bold }
 
enum class  AlignmentBaseline : uint8_t {
  Auto , Baseline , BeforeEdge , TextBeforeEdge ,
  Middle , Central , AfterEdge , TextAfterEdge ,
  Ideographic , Alphabetic , Hanging , Mathematical
}
 
enum class  DominantBaseline : uint8_t {
  Auto , UseScript , NoChange , ResetSize ,
  Ideographic , Alphabetic , Hanging , Mathematical ,
  Central , Middle , TextAfterEdge , TextBeforeEdge
}
 
enum class  TextAnchor : uint8_t { Start , Middle , End }
 
enum class  WhiteSpace : uint8_t { Default , Preserve }
 
enum class  WritingMode : uint8_t { Horizontal , Vertical }
 
enum class  TextOrientation : uint8_t { Mixed , Upright }
 
enum class  Direction : uint8_t { Ltr , Rtl }
 
enum class  MaskType : uint8_t { Luminance , Alpha }
 
enum class  Units : uint8_t { UserSpaceOnUse , ObjectBoundingBox }
 
enum class  MarkerUnits : uint8_t { StrokeWidth , UserSpaceOnUse }
 
enum class  LengthAdjust : uint8_t { Spacing , SpacingAndGlyphs }
 
enum class  LengthUnits : uint8_t {
  None , Percent , Px , Em ,
  Ex
}
 
enum class  LengthDirection : uint8_t { Horizontal , Vertical , Diagonal }
 
enum class  LengthNegativeMode : uint8_t { Allow , Forbid }
 
enum class  TransformBoxType : uint8_t { ViewBox , FillBox }
 
enum class  ElementID : uint8_t {
  Unknown = 0 , Star , Circle , ClipPath ,
  Defs , Ellipse , FeComposite , FeDropShadow ,
  FeFlood , FeGaussianBlur , FeMerge , FeMergeNode ,
  FeOffset , Filter , ForeignObject , G ,
  Image , Line , LinearGradient , Marker ,
  Mask , Path , Pattern , Polygon ,
  Polyline , RadialGradient , Rect , Stop ,
  Style , Svg , Switch , Symbol ,
  Text , Tspan , Use
}
 
enum class  SVGRenderMode { Painting , Clipping }
 

Functions

constexpr Point operator+ (const Point &a, const Point &b)
 
constexpr Point operator- (const Point &a, const Point &b)
 
constexpr Point operator- (const Point &a)
 
constexpr Point & operator+= (Point &a, const Point &b)
 
constexpr Point & operator-= (Point &a, const Point &b)
 
constexpr float operator* (const Point &a, const Point &b)
 
constexpr Size operator+ (const Size &a, const Size &b)
 
constexpr Size operator- (const Size &a, const Size &b)
 
constexpr Size operator- (const Size &a)
 
constexpr Size & operator+= (Size &a, const Size &b)
 
constexpr Size & operator-= (Size &a, const Size &b)
 
std::ostream & operator<< (std::ostream &os, const Color &color)
 Stream output operator for Color.
 
std::ostream & operator<< (std::ostream &os, const ColorBlend &blend)
 Stream output operator for ColorBlend.
 
FontFace embeddedFallbackFont (bool bold=false, bool italic=false)
 
FontFaceCache * fontFaceCache ()
 
bool addFontFaceFromFile (const char *family, bool bold, bool italic, const char *filename)
 Add a font face from a file to the cache.
 
bool addFontFaceFromData (const char *family, bool bold, bool italic, const void *data, size_t length, novasvg_destroy_func_t destroy_func, void *closure)
 Add a font face from memory to the cache.
 
PropertyID propertyid (std::string_view name)
 
PropertyID csspropertyid (std::string_view name)
 
ElementID elementid (std::string_view name)
 
const SVGElement * toSVGElement (const SVGNode *node)
 
SVGElement * toSVGElement (SVGNode *node)
 
SVGElement * toSVGElement (const std::unique_ptr< SVGNode > &node)
 
NOVASVG_INLINE GradientStops buildGradientStops (const SVGGradientElement *element, float opacity)
 
const SVGTextNode * toSVGTextNode (const SVGNode *node)
 
const SVGTextPositioningElement * toSVGTextPositioningElement (const SVGNode *node)
 
NOVASVG_INLINE AlignmentBaseline resolveDominantBaseline (const SVGTextPositioningElement *element)
 
NOVASVG_INLINE float calculateBaselineOffset (const SVGTextPositioningElement *element)
 
NOVASVG_INLINE bool needsTextAnchorAdjustment (const SVGTextPositioningElement *element)
 
NOVASVG_INLINE float calculateTextAnchorOffset (const SVGTextPositioningElement *element, float width)
 
NOVASVG_INLINE float calculateTextChunkLength (SVGTextFragmentIterator begin, SVGTextFragmentIterator end, bool isVerticalText)
 
NOVASVG_INLINE void handleTextChunk (SVGTextFragmentIterator begin, SVGTextFragmentIterator end)
 
NOVASVG_INLINE std::optional< Color > parseColorValue (std::string_view &input, const SVGLayoutState *state)
 
NOVASVG_INLINE Color parseColor (std::string_view input, const SVGLayoutState *state, const Color &defaultValue)
 
NOVASVG_INLINE Color parseColorOrNone (std::string_view input, const SVGLayoutState *state, const Color &defaultValue)
 
NOVASVG_INLINE bool parseUrlValue (std::string_view &input, std::string &value)
 
NOVASVG_INLINE std::string parseUrl (std::string_view input)
 
NOVASVG_INLINE Paint parsePaint (std::string_view input, const SVGLayoutState *state, const Color &defaultValue)
 
NOVASVG_INLINE float parseNumberOrPercentage (std::string_view input, bool allowPercentage, float defaultValue)
 
NOVASVG_INLINE Length parseLength (std::string_view input, LengthNegativeMode mode, const Length &defaultValue)
 
NOVASVG_INLINE BaselineShift parseBaselineShift (std::string_view input)
 
NOVASVG_INLINE LengthList parseDashArray (std::string_view input)
 
NOVASVG_INLINE Length parseLengthOrNormal (std::string_view input)
 
NOVASVG_INLINE float parseFontSize (std::string_view input, const SVGLayoutState *state)
 
template<typename Enum , unsigned int N>
NOVASVG_INLINE Enum parseEnumValue (std::string_view input, const SVGEnumerationEntry< Enum >(&entries)[N], Enum defaultValue)
 
NOVASVG_INLINE Display parseDisplay (std::string_view input)
 
NOVASVG_INLINE Visibility parseVisibility (std::string_view input)
 
NOVASVG_INLINE Overflow parseOverflow (std::string_view input)
 
NOVASVG_INLINE PointerEvents parsePointerEvents (std::string_view input)
 
NOVASVG_INLINE FontWeight parseFontWeight (std::string_view input)
 
NOVASVG_INLINE FontStyle parseFontStyle (std::string_view input)
 
NOVASVG_INLINE AlignmentBaseline parseAlignmentBaseline (std::string_view input)
 
NOVASVG_INLINE DominantBaseline parseDominantBaseline (std::string_view input)
 
NOVASVG_INLINE Direction parseDirection (std::string_view input)
 
NOVASVG_INLINE WritingMode parseWritingMode (std::string_view input)
 
NOVASVG_INLINE TextOrientation parseTextOrientation (std::string_view input)
 
NOVASVG_INLINE TextAnchor parseTextAnchor (std::string_view input)
 
NOVASVG_INLINE WhiteSpace parseWhiteSpace (std::string_view input)
 
NOVASVG_INLINE MixBlendMode parseMixBlendMode (std::string_view input)
 
NOVASVG_INLINE MaskType parseMaskType (std::string_view input)
 
NOVASVG_INLINE FillRule parseFillRule (std::string_view input)
 
NOVASVG_INLINE LineCap parseLineCap (std::string_view input)
 
NOVASVG_INLINE LineJoin parseLineJoin (std::string_view input)
 
NOVASVG_INLINE Font makeFont (const std::string &family, float size, bool bold, bool italic)
 
bool isDisallowedElement (const SVGElement *element)
 
NOVASVG_INLINE Bitmap loadImageResource (const std::string &href)
 
ForeignObjectMetrics measureForeignObjectSegments (std::string_view rawHtml, const std::vector< ForeignObjectSegment > &segments, const ForeignObjectFonts &fonts, unsigned char baseStyle, float maxWidth)
 Measures what ForeignObjectMetrics::height (etc.) will be for rawHtml painted with font, using the exact same foreignObjectPlainText() / wrapForeignObjectText() / foreignObjectLineHeight() logic ForeignObjectSimple::render() itself calls – so a value computed here and a box later painted by novasvg with the same (rawHtml, font) can never disagree, short of a bug in this shared logic itself.
 
ForeignObjectMetrics measureForeignObjectContent (std::string_view rawHtml, const ForeignObjectFonts &fonts, float maxWidth=-1.f, unsigned char baseStyle=0)
 measureForeignObjectContent() for text that may carry bold and italic: fonts supplies the face for each style (see ForeignObjectFonts; SVGForeignObjectElement::fontsFor() builds it the way painting does), baseStyle is the style the foreignObject itself has. This is exactly what painting does, so the metrics and the painted box cannot disagree about a bold label being wider than a regular one.
 
ForeignObjectMetrics measureForeignObjectContent (std::string_view rawHtml, const Font &font, float maxWidth=-1.f)
 measureForeignObjectContent() with a single face: every style is measured with font, i.e. as if the text had no bold or italic in it. Line breaks and heights are unaffected by bold or italic; only the widths of styled stretches can differ from what painting produces, by however much the real bold/italic faces differ from font. Use the ForeignObjectFonts overload when that matters.
 
bool switchChildPasses (const SVGElement *child)
 
const SVGGeometryElement * toSVGGeometryElement (const SVGNode *node)
 
bool operator< (const RuleData &a, const RuleData &b)
 
NOVASVG_INLINE constexpr bool equals (std::string_view value, std::string_view subvalue)
 
NOVASVG_INLINE constexpr bool contains (std::string_view value, std::string_view subvalue)
 
NOVASVG_INLINE constexpr bool includes (std::string_view value, std::string_view subvalue)
 
NOVASVG_INLINE constexpr bool startswith (std::string_view value, std::string_view subvalue)
 
NOVASVG_INLINE constexpr bool endswith (std::string_view value, std::string_view subvalue)
 
NOVASVG_INLINE constexpr bool dashequals (std::string_view value, std::string_view subvalue)
 
constexpr bool IS_CSS_STARTNAMECHAR (int c)
 
constexpr bool IS_CSS_NAMECHAR (int c)
 
bool readCSSIdentifier (std::string_view &input, std::string &output)
 
bool stripImportantFlag (std::string &value)
 
void parseInlineStyle (std::string_view input, SVGElement *element)
 
void removeStyleComments (std::string &value)
 
bool decodeText (std::string_view input, std::string &output)
 
constexpr bool IS_STARTNAMECHAR (int c)
 
constexpr bool IS_NAMECHAR (int c)
 
bool readIdentifier (std::string_view &input, std::string &output)
 
constexpr bool IS_NUM (int cc)
 
constexpr bool IS_ALPHA (int cc)
 
constexpr bool IS_WS (int cc)
 
constexpr void stripLeadingSpaces (std::string_view &input)
 
constexpr void stripTrailingSpaces (std::string_view &input)
 
constexpr void stripLeadingAndTrailingSpaces (std::string_view &input)
 
constexpr bool skipOptionalSpaces (std::string_view &input)
 
constexpr bool skipOptionalSpacesOrDelimiter (std::string_view &input, char delimiter)
 
constexpr bool skipOptionalSpacesOrComma (std::string_view &input)
 
constexpr bool skipDelimiterAndOptionalSpaces (std::string_view &input, char delimiter)
 
constexpr bool skipDelimiter (std::string_view &input, char delimiter)
 
constexpr bool skipString (std::string_view &input, std::string_view value)
 
constexpr bool isIntegralDigit (char ch, int base)
 
constexpr int toIntegralDigit (char ch)
 
template<typename T >
bool parseInteger (std::string_view &input, T &integer, int base=10)
 
template<typename T >
bool parseNumber (std::string_view &input, T &number)
 
int version ()
 Returns the version of the novasvg library encoded in a single integer.
 
std::string versionString ()
 Returns the novasvg library version as a human-readable string in "X.Y.Z" format.
 

Variables

const std::string emptyString
 

Detailed Description

Main namespace for the NovaSVG library.

Typedef Documentation

◆ AttributeList

using novasvg::AttributeList = typedef std::forward_list<Attribute>

Definition at line 764 of file svgelement.h.

◆ DeclarationList

using novasvg::DeclarationList = typedef std::vector<Declaration>

Definition at line 75 of file svgparser.hpp.

◆ ElementList

using novasvg::ElementList = typedef std::vector<Element>

Definition at line 547 of file novasvg.h.

◆ LengthList

using novasvg::LengthList = typedef std::vector<Length>

Definition at line 435 of file svgelement.h.

◆ NodeList

using novasvg::NodeList = typedef std::vector<Node>

Definition at line 433 of file novasvg.h.

◆ NumberList

using novasvg::NumberList = typedef std::vector<float>

Definition at line 505 of file svgelement.h.

◆ PointList

using novasvg::PointList = typedef std::vector<Point>

Definition at line 546 of file svgelement.h.

◆ RuleDataList

using novasvg::RuleDataList = typedef std::vector<RuleData>

Definition at line 106 of file svgparser.hpp.

◆ Selector

using novasvg::Selector = typedef std::vector<SimpleSelector>

Definition at line 12 of file svgparser.hpp.

◆ SelectorList

using novasvg::SelectorList = typedef std::vector<Selector>

Definition at line 13 of file svgparser.hpp.

◆ SVGCharacterPositions

using novasvg::SVGCharacterPositions = typedef std::map<size_t, SVGCharacterPosition>

Definition at line 2048 of file svgelement.h.

◆ SVGEnumerationEntry

template<typename Enum >
using novasvg::SVGEnumerationEntry = typedef std::pair<Enum, std::string_view>

Definition at line 322 of file svgelement.h.

◆ SVGMarkerPositionList

using novasvg::SVGMarkerPositionList = typedef std::vector<SVGMarkerPosition>

Definition at line 1925 of file svgelement.h.

◆ SVGNodeList

using novasvg::SVGNodeList = typedef std::list<std::unique_ptr<SVGNode> >

Definition at line 806 of file svgelement.h.

◆ SVGPropertyList

using novasvg::SVGPropertyList = typedef std::forward_list<SVGProperty*>

Definition at line 807 of file svgelement.h.

◆ SVGTextFragmentIterator

using novasvg::SVGTextFragmentIterator = typedef SVGTextFragmentList::iterator

Definition at line 3983 of file svgelement.h.

◆ SVGTextFragmentList

using novasvg::SVGTextFragmentList = typedef std::vector<SVGTextFragment>

Definition at line 2076 of file svgelement.h.

◆ SVGTextPositionList

using novasvg::SVGTextPositionList = typedef std::vector<SVGTextPosition>

Definition at line 2060 of file svgelement.h.

Enumeration Type Documentation

◆ AlignmentBaseline

enum class novasvg::AlignmentBaseline : uint8_t
strong
Enumerator
Auto 
Baseline 
BeforeEdge 
TextBeforeEdge 
Middle 
Central 
AfterEdge 
TextAfterEdge 
Ideographic 
Alphabetic 
Hanging 
Mathematical 

Definition at line 245 of file svgelement.h.

◆ Direction

enum class novasvg::Direction : uint8_t
strong
Enumerator
Ltr 
Rtl 

Definition at line 296 of file svgelement.h.

◆ Display

enum class novasvg::Display : uint8_t
strong
Enumerator
Inline 
None 

Definition at line 192 of file svgelement.h.

◆ DominantBaseline

enum class novasvg::DominantBaseline : uint8_t
strong
Enumerator
Auto 
UseScript 
NoChange 
ResetSize 
Ideographic 
Alphabetic 
Hanging 
Mathematical 
Central 
Middle 
TextAfterEdge 
TextBeforeEdge 

Definition at line 260 of file svgelement.h.

◆ ElementID

enum class novasvg::ElementID : uint8_t
strong
Enumerator
Unknown 
Star 
Circle 
ClipPath 
Defs 
Ellipse 
FeComposite 
FeDropShadow 
FeFlood 
FeGaussianBlur 
FeMerge 
FeMergeNode 
FeOffset 
Filter 
ForeignObject 
G 
Image 
Line 
LinearGradient 
Marker 
Mask 
Path 
Pattern 
Polygon 
Polyline 
RadialGradient 
Rect 
Stop 
Style 
Svg 
Switch 
Symbol 
Text 
Tspan 
Use 

Definition at line 766 of file svgelement.h.

◆ FillRule

enum class novasvg::FillRule : uint8_t
strong
Enumerator
NonZero 
EvenOdd 

Definition at line 46 of file canvas.h.

◆ FontStyle

enum class novasvg::FontStyle : uint8_t
strong
Enumerator
Normal 
Italic 

Definition at line 235 of file svgelement.h.

◆ FontWeight

enum class novasvg::FontWeight : uint8_t
strong
Enumerator
Normal 
Bold 

Definition at line 240 of file svgelement.h.

◆ LengthAdjust

enum class novasvg::LengthAdjust : uint8_t
strong
Enumerator
Spacing 
SpacingAndGlyphs 

Definition at line 316 of file svgelement.h.

◆ LengthDirection

enum class novasvg::LengthDirection : uint8_t
strong
Enumerator
Horizontal 
Vertical 
Diagonal 

Definition at line 370 of file svgelement.h.

◆ LengthNegativeMode

enum class novasvg::LengthNegativeMode : uint8_t
strong
Enumerator
Allow 
Forbid 

Definition at line 376 of file svgelement.h.

◆ LengthUnits

enum class novasvg::LengthUnits : uint8_t
strong
Enumerator
None 
Percent 
Px 
Em 
Ex 

Definition at line 362 of file svgelement.h.

◆ LineCap

enum class novasvg::LineCap : uint8_t
strong
Enumerator
Butt 
Round 
Square 

Definition at line 34 of file canvas.h.

◆ LineJoin

enum class novasvg::LineJoin : uint8_t
strong
Enumerator
Miter 
Round 
Bevel 

Definition at line 40 of file canvas.h.

◆ MarkerUnits

enum class novasvg::MarkerUnits : uint8_t
strong
Enumerator
StrokeWidth 
UserSpaceOnUse 

Definition at line 311 of file svgelement.h.

◆ MaskType

enum class novasvg::MaskType : uint8_t
strong
Enumerator
Luminance 
Alpha 

Definition at line 301 of file svgelement.h.

◆ MixBlendMode

enum class novasvg::MixBlendMode : uint8_t
strong
Enumerator
Normal 
Multiply 
Screen 
Darken 
Lighten 
Difference 
Exclusion 

Definition at line 211 of file svgelement.h.

◆ Overflow

enum class novasvg::Overflow : uint8_t
strong
Enumerator
Visible 
Hidden 

Definition at line 203 of file svgelement.h.

◆ PathCommand

enum class novasvg::PathCommand
strong
Enumerator
MoveTo 
LineTo 
CubicTo 
Close 

Definition at line 306 of file canvas.h.

◆ PointerEvents

enum class novasvg::PointerEvents : uint8_t
strong
Enumerator
None 
Auto 
Stroke 
Fill 
Painted 
Visible 
VisibleStroke 
VisibleFill 
VisiblePainted 
BoundingBox 
All 

Definition at line 221 of file svgelement.h.

◆ PropertyID

enum class novasvg::PropertyID : uint8_t
strong
Enumerator
Unknown 
Alignment_Baseline 
Background_Color 
Baseline_Shift 
Class 
Clip_Path 
Clip_Rule 
ClipPathUnits 
Color 
Cx 
Cy 
D 
Direction 
Display 
Dominant_Baseline 
Dx 
Dy 
Fill 
Fill_Opacity 
Fill_Rule 
Filter 
Flood_Color 
Flood_Opacity 
Font_Family 
Font_Size 
Font_Style 
Font_Weight 
Fx 
Fy 
GradientTransform 
GradientUnits 
Height 
Href 
Id 
In 
In2 
K1 
K2 
K3 
K4 
LengthAdjust 
Letter_Spacing 
Marker_End 
Marker_Mid 
Marker_Start 
MarkerHeight 
MarkerUnits 
MarkerWidth 
Mask 
Mask_Type 
MaskContentUnits 
MaskUnits 
Mix_Blend_Mode 
Offset 
Opacity 
Operator 
Orient 
Overflow 
PatternContentUnits 
PatternTransform 
PatternUnits 
Pointer_Events 
Points 
PreserveAspectRatio 
R 
RefX 
RefY 
RequiredExtensions 
Result 
Rotate 
Rx 
Ry 
SpreadMethod 
StdDeviation 
Stop_Color 
Stop_Opacity 
Stroke 
Stroke_Dasharray 
Stroke_Dashoffset 
Stroke_Linecap 
Stroke_Linejoin 
Stroke_Miterlimit 
Stroke_Opacity 
Stroke_Width 
Style 
SystemLanguage 
Text_Anchor 
Text_Orientation 
TextLength 
Transform 
Transform_Box 
Transform_Origin 
ViewBox 
Visibility 
White_Space 
Width 
Word_Spacing 
Writing_Mode 
X 
X1 
X2 
Y 
Y1 
Y2 

Definition at line 36 of file svgelement.h.

◆ SpreadMethod

enum class novasvg::SpreadMethod : uint8_t
strong
Enumerator
Pad 
Reflect 
Repeat 

Definition at line 51 of file canvas.h.

◆ SVGRenderMode

enum class novasvg::SVGRenderMode
strong
Enumerator
Painting 
Clipping 

Definition at line 1560 of file svgelement.h.

◆ TextAnchor

enum class novasvg::TextAnchor : uint8_t
strong
Enumerator
Start 
Middle 
End 

Definition at line 275 of file svgelement.h.

◆ TextOrientation

enum class novasvg::TextOrientation : uint8_t
strong
Enumerator
Mixed 
Upright 

Definition at line 291 of file svgelement.h.

◆ TransformBoxType

enum class novasvg::TransformBoxType : uint8_t
strong
Enumerator
ViewBox 
FillBox 

Definition at line 588 of file svgelement.h.

◆ Units

enum class novasvg::Units : uint8_t
strong
Enumerator
UserSpaceOnUse 
ObjectBoundingBox 

Definition at line 306 of file svgelement.h.

◆ Visibility

enum class novasvg::Visibility : uint8_t
strong
Enumerator
Visible 
Hidden 
Collapse 

Definition at line 197 of file svgelement.h.

◆ WhiteSpace

enum class novasvg::WhiteSpace : uint8_t
strong
Enumerator
Default 
Preserve 

Definition at line 281 of file svgelement.h.

◆ WritingMode

enum class novasvg::WritingMode : uint8_t
strong
Enumerator
Horizontal 
Vertical 

Definition at line 286 of file svgelement.h.

Function Documentation

◆ addFontFaceFromData()

NOVASVG_INLINE bool novasvg::addFontFaceFromData ( const char *  family,
bool  bold,
bool  italic,
const void *  data,
size_t  length,
novasvg_destroy_func_t  destroy_func,
void *  closure 
)

Add a font face from memory to the cache.

Parameters
familyThe name of the font family. If an empty string is provided, the font will act as a fallback.
boldUse true for bold, false otherwise.
italicUse true for italic, false otherwise.
dataA pointer to the memory buffer containing the font data.
lengthThe size of the memory buffer in bytes.
destroy_funcCallback function to free the memory buffer when it is no longer needed.
closureUser-defined pointer passed to the destroy_func callback.
Returns
true if the font face was successfully added to the cache, false otherwise.

Definition at line 512 of file font.h.

References novasvg::FontFaceCache::addFontFace(), and fontFaceCache().

◆ addFontFaceFromFile()

NOVASVG_INLINE bool novasvg::addFontFaceFromFile ( const char *  family,
bool  bold,
bool  italic,
const char *  filename 
)

Add a font face from a file to the cache.

Parameters
familyThe name of the font family. If an empty string is provided, the font will act as a fallback.
boldUse true for bold, false otherwise.
italicUse true for italic, false otherwise.
filenameThe path to the font file.
Returns
true if the font face was successfully added to the cache, false otherwise.

Definition at line 507 of file font.h.

References novasvg::FontFaceCache::addFontFace(), and fontFaceCache().

◆ buildGradientStops()

NOVASVG_INLINE GradientStops novasvg::buildGradientStops ( const SVGGradientElement *  element,
float  opacity 
)

◆ calculateBaselineOffset()

◆ calculateTextAnchorOffset()

NOVASVG_INLINE float novasvg::calculateTextAnchorOffset ( const SVGTextPositioningElement *  element,
float  width 
)

◆ calculateTextChunkLength()

NOVASVG_INLINE float novasvg::calculateTextChunkLength ( SVGTextFragmentIterator  begin,
SVGTextFragmentIterator  end,
bool  isVerticalText 
)

◆ contains()

NOVASVG_INLINE constexpr bool novasvg::contains ( std::string_view  value,
std::string_view  subvalue 
)
constexpr

Definition at line 113 of file svgparser.hpp.

◆ csspropertyid()

NOVASVG_INLINE PropertyID novasvg::csspropertyid ( std::string_view  name)

Definition at line 2384 of file svgelement.h.

References csspropertyid().

Referenced by csspropertyid(), parseInlineStyle(), and propertyid().

◆ dashequals()

NOVASVG_INLINE constexpr bool novasvg::dashequals ( std::string_view  value,
std::string_view  subvalue 
)
constexpr

Definition at line 150 of file svgparser.hpp.

References startswith().

◆ decodeText()

bool novasvg::decodeText ( std::string_view  input,
std::string &  output 
)
inline

Definition at line 886 of file svgparser.hpp.

References parseInteger(), skipDelimiter(), and skipString().

◆ elementid()

◆ embeddedFallbackFont()

◆ endswith()

NOVASVG_INLINE constexpr bool novasvg::endswith ( std::string_view  value,
std::string_view  subvalue 
)
constexpr

Definition at line 143 of file svgparser.hpp.

◆ equals()

NOVASVG_INLINE constexpr bool novasvg::equals ( std::string_view  value,
std::string_view  subvalue 
)
constexpr

Definition at line 108 of file svgparser.hpp.

◆ fontFaceCache()

NOVASVG_INLINE FontFaceCache * novasvg::fontFaceCache ( )

Definition at line 449 of file font.h.

Referenced by addFontFaceFromData(), addFontFaceFromFile(), and makeFont().

◆ handleTextChunk()

◆ includes()

NOVASVG_INLINE constexpr bool novasvg::includes ( std::string_view  value,
std::string_view  subvalue 
)
constexpr

Definition at line 118 of file svgparser.hpp.

References IS_WS(), and skipOptionalSpaces().

◆ IS_ALPHA()

constexpr bool novasvg::IS_ALPHA ( int  cc)
constexpr

Definition at line 11 of file svgparserutils.h.

Referenced by IS_CSS_STARTNAMECHAR(), IS_STARTNAMECHAR(), and isIntegralDigit().

◆ IS_CSS_NAMECHAR()

constexpr bool novasvg::IS_CSS_NAMECHAR ( int  c)
constexpr

Definition at line 310 of file svgparser.hpp.

References IS_CSS_STARTNAMECHAR(), and IS_NUM().

Referenced by readCSSIdentifier().

◆ IS_CSS_STARTNAMECHAR()

constexpr bool novasvg::IS_CSS_STARTNAMECHAR ( int  c)
constexpr

Definition at line 309 of file svgparser.hpp.

References IS_ALPHA().

Referenced by IS_CSS_NAMECHAR(), and readCSSIdentifier().

◆ IS_NAMECHAR()

constexpr bool novasvg::IS_NAMECHAR ( int  c)
constexpr

Definition at line 961 of file svgparser.hpp.

References IS_NUM(), and IS_STARTNAMECHAR().

Referenced by readIdentifier().

◆ IS_NUM()

constexpr bool novasvg::IS_NUM ( int  cc)
constexpr

◆ IS_STARTNAMECHAR()

constexpr bool novasvg::IS_STARTNAMECHAR ( int  c)
constexpr

Definition at line 960 of file svgparser.hpp.

References IS_ALPHA().

Referenced by IS_NAMECHAR(), and readIdentifier().

◆ IS_WS()

◆ isDisallowedElement()

bool novasvg::isDisallowedElement ( const SVGElement *  element)
inline

◆ isIntegralDigit()

constexpr bool novasvg::isIntegralDigit ( char  ch,
int  base 
)
constexpr

Definition at line 91 of file svgparserutils.h.

References IS_ALPHA(), and IS_NUM().

Referenced by parseInteger().

◆ loadImageResource()

NOVASVG_INLINE Bitmap novasvg::loadImageResource ( const std::string &  href)

◆ makeFont()

NOVASVG_INLINE Font novasvg::makeFont ( const std::string &  family,
float  size,
bool  bold,
bool  italic 
)

◆ measureForeignObjectContent() [1/2]

ForeignObjectMetrics novasvg::measureForeignObjectContent ( std::string_view  rawHtml,
const Font &  font,
float  maxWidth = -1.f 
)
inline

measureForeignObjectContent() with a single face: every style is measured with font, i.e. as if the text had no bold or italic in it. Line breaks and heights are unaffected by bold or italic; only the widths of styled stretches can differ from what painting produces, by however much the real bold/italic faces differ from font. Use the ForeignObjectFonts overload when that matters.

Definition at line 6993 of file svgelement.h.

References novasvg::ForeignObjectFonts::face, measureForeignObjectContent(), and measureForeignObjectSegments().

◆ measureForeignObjectContent() [2/2]

ForeignObjectMetrics novasvg::measureForeignObjectContent ( std::string_view  rawHtml,
const ForeignObjectFonts &  fonts,
float  maxWidth = -1.f,
unsigned char  baseStyle = 0 
)
inline

measureForeignObjectContent() for text that may carry bold and italic: fonts supplies the face for each style (see ForeignObjectFonts; SVGForeignObjectElement::fontsFor() builds it the way painting does), baseStyle is the style the foreignObject itself has. This is exactly what painting does, so the metrics and the painted box cannot disagree about a bold label being wider than a regular one.

Definition at line 6982 of file svgelement.h.

References measureForeignObjectContent(), and measureForeignObjectSegments().

Referenced by measureForeignObjectContent(), and measureForeignObjectContent().

◆ measureForeignObjectSegments()

ForeignObjectMetrics novasvg::measureForeignObjectSegments ( std::string_view  rawHtml,
const std::vector< ForeignObjectSegment > &  segments,
const ForeignObjectFonts &  fonts,
unsigned char  baseStyle,
float  maxWidth 
)
inline

Measures what ForeignObjectMetrics::height (etc.) will be for rawHtml painted with font, using the exact same foreignObjectPlainText() / wrapForeignObjectText() / foreignObjectLineHeight() logic ForeignObjectSimple::render() itself calls – so a value computed here and a box later painted by novasvg with the same (rawHtml, font) can never disagree, short of a bug in this shared logic itself.

maxWidth (px, optional): the width text may wrap at. When omitted it is read from the HTML's own width/max-width (px). Wrapping happens only if the HTML's white-space allows it (see foreignObjectAllowsWrap()): mermaid's nowrap labels stay one line, its wrap mode (white-space:break-spaces; width:200px) wraps – exactly what render() does at the box's own width.

ForeignObjectMetrics::width is the widest resulting line. render() never grows a line's box to fit its content horizontally; it only ever horizontally condenses a line that overflows the box it's given. It's computed and returned anyway (via the same per-line Font::measureText() render() itself calls) because a caller BUILDING that box in the first place – this function's whole reason to exist – needs some width to size it to, and the widest line at this exact font is the only figure that guarantees render() never needs to condense anything afterward.

Definition at line 6947 of file svgelement.h.

References novasvg::ForeignObjectFonts::get(), novasvg::ForeignObjectMetrics::height, novasvg::ForeignObjectMetrics::lineCount, novasvg::ForeignObjectMetrics::lineHeight, measureForeignObjectSegments(), NOVASVG_MAX, and novasvg::ForeignObjectMetrics::width.

Referenced by measureForeignObjectContent(), measureForeignObjectContent(), and measureForeignObjectSegments().

◆ needsTextAnchorAdjustment()

NOVASVG_INLINE bool novasvg::needsTextAnchorAdjustment ( const SVGTextPositioningElement *  element)

◆ operator*()

constexpr float novasvg::operator* ( const Point &  a,
const Point &  b 
)
constexpr

Definition at line 108 of file canvas.h.

References novasvg::Point::dot().

Referenced by novasvg::Matrix::Matrix().

◆ operator+() [1/2]

constexpr Point novasvg::operator+ ( const Point &  a,
const Point &  b 
)
constexpr

Definition at line 81 of file canvas.h.

References novasvg::Point::x, and novasvg::Point::y.

◆ operator+() [2/2]

constexpr Size novasvg::operator+ ( const Size &  a,
const Size &  b 
)
constexpr

Definition at line 134 of file canvas.h.

References novasvg::Size::h, and novasvg::Size::w.

◆ operator+=() [1/2]

constexpr Point & novasvg::operator+= ( Point &  a,
const Point &  b 
)
constexpr

Definition at line 96 of file canvas.h.

References novasvg::Point::move().

◆ operator+=() [2/2]

constexpr Size & novasvg::operator+= ( Size &  a,
const Size &  b 
)
constexpr

Definition at line 149 of file canvas.h.

References novasvg::Size::expand().

◆ operator-() [1/4]

constexpr Point novasvg::operator- ( const Point &  a)
constexpr

Definition at line 91 of file canvas.h.

References novasvg::Point::x, and novasvg::Point::y.

◆ operator-() [2/4]

constexpr Point novasvg::operator- ( const Point &  a,
const Point &  b 
)
constexpr

Definition at line 86 of file canvas.h.

References novasvg::Point::x, and novasvg::Point::y.

◆ operator-() [3/4]

constexpr Size novasvg::operator- ( const Size &  a)
constexpr

Definition at line 144 of file canvas.h.

References novasvg::Size::h, and novasvg::Size::w.

◆ operator-() [4/4]

constexpr Size novasvg::operator- ( const Size &  a,
const Size &  b 
)
constexpr

Definition at line 139 of file canvas.h.

References novasvg::Size::h, and novasvg::Size::w.

◆ operator-=() [1/2]

constexpr Point & novasvg::operator-= ( Point &  a,
const Point &  b 
)
constexpr

Definition at line 102 of file canvas.h.

References novasvg::Point::move().

◆ operator-=() [2/2]

constexpr Size & novasvg::operator-= ( Size &  a,
const Size &  b 
)
constexpr

Definition at line 155 of file canvas.h.

References novasvg::Size::expand().

◆ operator<()

bool novasvg::operator< ( const RuleData &  a,
const RuleData &  b 
)
inline

Definition at line 104 of file svgparser.hpp.

References novasvg::RuleData::isLessThan().

◆ operator<<() [1/2]

std::ostream & novasvg::operator<< ( std::ostream &  os,
const Color &  color 
)
inline

Stream output operator for Color.

Allows using Color with std::cout and other output streams.

Parameters
osOutput stream (e.g., std::cout).
colorColor to output.
Returns
Reference to the output stream.
Example
Color c(255, 0, 0);
std::cout << c << std::endl; // Prints: Color(r=255, g=0, b=0, a=255)
Represents a color in RGBA format (0xRRGGBBAA).
Definition color.h:85

Definition at line 944 of file color.h.

◆ operator<<() [2/2]

std::ostream & novasvg::operator<< ( std::ostream &  os,
const ColorBlend &  blend 
)
inline

Stream output operator for ColorBlend.

Allows using ColorBlend with output streams. The blend is automatically converted to a Color before output.

Parameters
osOutput stream.
blendColorBlend to output.
Returns
Reference to the output stream.

Definition at line 959 of file color.h.

References novasvg::render::blend().

◆ parseAlignmentBaseline()

NOVASVG_INLINE AlignmentBaseline novasvg::parseAlignmentBaseline ( std::string_view  input)

◆ parseBaselineShift()

NOVASVG_INLINE BaselineShift novasvg::parseBaselineShift ( std::string_view  input)

◆ parseColor()

NOVASVG_INLINE Color novasvg::parseColor ( std::string_view  input,
const SVGLayoutState *  state,
const Color &  defaultValue 
)

Definition at line 4446 of file svgelement.h.

References parseColorValue().

Referenced by parseColorOrNone(), and novasvg::SVGLayoutState::SVGLayoutState().

◆ parseColorOrNone()

NOVASVG_INLINE Color novasvg::parseColorOrNone ( std::string_view  input,
const SVGLayoutState *  state,
const Color &  defaultValue 
)

Definition at line 4454 of file svgelement.h.

References parseColor(), and novasvg::Color::Transparent.

Referenced by parsePaint().

◆ parseColorValue()

NOVASVG_INLINE std::optional< Color > novasvg::parseColorValue ( std::string_view &  input,
const SVGLayoutState *  state 
)

◆ parseDashArray()

NOVASVG_INLINE LengthList novasvg::parseDashArray ( std::string_view  input)

◆ parseDirection()

NOVASVG_INLINE Direction novasvg::parseDirection ( std::string_view  input)

Definition at line 4726 of file svgelement.h.

References Ltr, parseEnumValue(), and Rtl.

Referenced by novasvg::SVGLayoutState::SVGLayoutState().

◆ parseDisplay()

NOVASVG_INLINE Display novasvg::parseDisplay ( std::string_view  input)

Definition at line 4604 of file svgelement.h.

References Inline, None, and parseEnumValue().

Referenced by novasvg::SVGLayoutState::SVGLayoutState().

◆ parseDominantBaseline()

NOVASVG_INLINE DominantBaseline novasvg::parseDominantBaseline ( std::string_view  input)

◆ parseEnumValue()

◆ parseFillRule()

NOVASVG_INLINE FillRule novasvg::parseFillRule ( std::string_view  input)

Definition at line 4818 of file svgelement.h.

References EvenOdd, NonZero, and parseEnumValue().

Referenced by novasvg::SVGLayoutState::SVGLayoutState().

◆ parseFontSize()

NOVASVG_INLINE float novasvg::parseFontSize ( std::string_view  input,
const SVGLayoutState *  state 
)

◆ parseFontStyle()

NOVASVG_INLINE FontStyle novasvg::parseFontStyle ( std::string_view  input)

Definition at line 4675 of file svgelement.h.

References Italic, Normal, and parseEnumValue().

Referenced by novasvg::SVGLayoutState::SVGLayoutState().

◆ parseFontWeight()

NOVASVG_INLINE FontWeight novasvg::parseFontWeight ( std::string_view  input)

Definition at line 4654 of file svgelement.h.

References Bold, Normal, and parseEnumValue().

Referenced by novasvg::SVGLayoutState::SVGLayoutState().

◆ parseInlineStyle()

void novasvg::parseInlineStyle ( std::string_view  input,
SVGElement *  element 
)
inline

◆ parseInteger()

template<typename T >
bool novasvg::parseInteger ( std::string_view &  input,
T &  integer,
int  base = 10 
)
inline

Definition at line 110 of file svgparserutils.h.

References isIntegralDigit(), and toIntegralDigit().

Referenced by decodeText().

◆ parseLength()

NOVASVG_INLINE Length novasvg::parseLength ( std::string_view  input,
LengthNegativeMode  mode,
const Length &  defaultValue 
)

◆ parseLengthOrNormal()

NOVASVG_INLINE Length novasvg::parseLengthOrNormal ( std::string_view  input)

Definition at line 4573 of file svgelement.h.

References Allow, None, and parseLength().

Referenced by novasvg::SVGLayoutState::SVGLayoutState().

◆ parseLineCap()

NOVASVG_INLINE LineCap novasvg::parseLineCap ( std::string_view  input)

Definition at line 4828 of file svgelement.h.

References Butt, parseEnumValue(), Round, and Square.

Referenced by novasvg::SVGLayoutState::SVGLayoutState().

◆ parseLineJoin()

NOVASVG_INLINE LineJoin novasvg::parseLineJoin ( std::string_view  input)

Definition at line 4839 of file svgelement.h.

References Bevel, Miter, parseEnumValue(), and Round.

Referenced by novasvg::SVGLayoutState::SVGLayoutState().

◆ parseMaskType()

NOVASVG_INLINE MaskType novasvg::parseMaskType ( std::string_view  input)

Definition at line 4808 of file svgelement.h.

References Alpha, Luminance, and parseEnumValue().

Referenced by novasvg::SVGLayoutState::SVGLayoutState().

◆ parseMixBlendMode()

NOVASVG_INLINE MixBlendMode novasvg::parseMixBlendMode ( std::string_view  input)

◆ parseNumber()

◆ parseNumberOrPercentage()

NOVASVG_INLINE float novasvg::parseNumberOrPercentage ( std::string_view  input,
bool  allowPercentage,
float  defaultValue 
)

Definition at line 4520 of file svgelement.h.

References parseNumber(), and skipDelimiter().

Referenced by novasvg::SVGLayoutState::SVGLayoutState().

◆ parseOverflow()

NOVASVG_INLINE Overflow novasvg::parseOverflow ( std::string_view  input)

Definition at line 4625 of file svgelement.h.

References Hidden, parseEnumValue(), and Visible.

Referenced by novasvg::SVGLayoutState::SVGLayoutState().

◆ parsePaint()

NOVASVG_INLINE Paint novasvg::parsePaint ( std::string_view  input,
const SVGLayoutState *  state,
const Color &  defaultValue 
)

◆ parsePointerEvents()

NOVASVG_INLINE PointerEvents novasvg::parsePointerEvents ( std::string_view  input)

◆ parseTextAnchor()

NOVASVG_INLINE TextAnchor novasvg::parseTextAnchor ( std::string_view  input)

Definition at line 4763 of file svgelement.h.

References End, Middle, parseEnumValue(), and Start.

Referenced by novasvg::SVGLayoutState::SVGLayoutState().

◆ parseTextOrientation()

NOVASVG_INLINE TextOrientation novasvg::parseTextOrientation ( std::string_view  input)

Definition at line 4753 of file svgelement.h.

References Mixed, parseEnumValue(), and Upright.

Referenced by novasvg::SVGLayoutState::SVGLayoutState().

◆ parseUrl()

NOVASVG_INLINE std::string novasvg::parseUrl ( std::string_view  input)

Definition at line 4502 of file svgelement.h.

References parseUrlValue().

Referenced by novasvg::SVGLayoutState::SVGLayoutState().

◆ parseUrlValue()

NOVASVG_INLINE bool novasvg::parseUrlValue ( std::string_view &  input,
std::string &  value 
)

Definition at line 4461 of file svgelement.h.

References skipDelimiter(), skipOptionalSpaces(), and skipString().

Referenced by parsePaint(), and parseUrl().

◆ parseVisibility()

NOVASVG_INLINE Visibility novasvg::parseVisibility ( std::string_view  input)

Definition at line 4614 of file svgelement.h.

References Collapse, Hidden, parseEnumValue(), and Visible.

Referenced by novasvg::SVGLayoutState::SVGLayoutState().

◆ parseWhiteSpace()

NOVASVG_INLINE WhiteSpace novasvg::parseWhiteSpace ( std::string_view  input)

Definition at line 4774 of file svgelement.h.

References Default, parseEnumValue(), and Preserve.

Referenced by novasvg::SVGLayoutState::SVGLayoutState().

◆ parseWritingMode()

NOVASVG_INLINE WritingMode novasvg::parseWritingMode ( std::string_view  input)

Definition at line 4736 of file svgelement.h.

References Horizontal, parseEnumValue(), and Vertical.

Referenced by novasvg::SVGLayoutState::SVGLayoutState().

◆ propertyid()

NOVASVG_INLINE PropertyID novasvg::propertyid ( std::string_view  name)

◆ readCSSIdentifier()

bool novasvg::readCSSIdentifier ( std::string_view &  input,
std::string &  output 
)
inline

Definition at line 312 of file svgparser.hpp.

References IS_CSS_NAMECHAR(), and IS_CSS_STARTNAMECHAR().

Referenced by parseInlineStyle().

◆ readIdentifier()

bool novasvg::readIdentifier ( std::string_view &  input,
std::string &  output 
)
inline

Definition at line 963 of file svgparser.hpp.

References IS_NAMECHAR(), and IS_STARTNAMECHAR().

◆ removeStyleComments()

void novasvg::removeStyleComments ( std::string &  value)
inline

Definition at line 876 of file svgparser.hpp.

◆ resolveDominantBaseline()

◆ skipDelimiter()

constexpr bool novasvg::skipDelimiter ( std::string_view &  input,
char  delimiter 
)
constexpr

◆ skipDelimiterAndOptionalSpaces()

constexpr bool novasvg::skipDelimiterAndOptionalSpaces ( std::string_view &  input,
char  delimiter 
)
constexpr

Definition at line 60 of file svgparserutils.h.

References skipOptionalSpaces().

◆ skipOptionalSpaces()

◆ skipOptionalSpacesOrComma()

constexpr bool novasvg::skipOptionalSpacesOrComma ( std::string_view &  input)
constexpr

◆ skipOptionalSpacesOrDelimiter()

constexpr bool novasvg::skipOptionalSpacesOrDelimiter ( std::string_view &  input,
char  delimiter 
)
constexpr

Definition at line 41 of file svgparserutils.h.

References IS_WS(), and skipOptionalSpaces().

Referenced by parseInlineStyle(), and skipOptionalSpacesOrComma().

◆ skipString()

constexpr bool novasvg::skipString ( std::string_view &  input,
std::string_view  value 
)
constexpr

◆ startswith()

NOVASVG_INLINE constexpr bool novasvg::startswith ( std::string_view  value,
std::string_view  subvalue 
)
constexpr

Definition at line 136 of file svgparser.hpp.

Referenced by dashequals().

◆ stripImportantFlag()

bool novasvg::stripImportantFlag ( std::string &  value)
inline

Definition at line 831 of file svgparser.hpp.

References IS_WS(), skipOptionalSpaces(), and stripTrailingSpaces().

Referenced by parseInlineStyle().

◆ stripLeadingAndTrailingSpaces()

◆ stripLeadingSpaces()

constexpr void novasvg::stripLeadingSpaces ( std::string_view &  input)
constexpr

◆ stripTrailingSpaces()

constexpr void novasvg::stripTrailingSpaces ( std::string_view &  input)
constexpr

Definition at line 21 of file svgparserutils.h.

References IS_WS().

Referenced by stripImportantFlag(), and stripLeadingAndTrailingSpaces().

◆ switchChildPasses()

bool novasvg::switchChildPasses ( const SVGElement *  child)
inline

◆ toIntegralDigit()

constexpr int novasvg::toIntegralDigit ( char  ch)
constexpr

Definition at line 100 of file svgparserutils.h.

References IS_NUM().

Referenced by parseInteger().

◆ toSVGElement() [1/3]

SVGElement * novasvg::toSVGElement ( const std::unique_ptr< SVGNode > &  node)
inline

Definition at line 943 of file svgelement.h.

References toSVGElement().

◆ toSVGElement() [2/3]

◆ toSVGElement() [3/3]

SVGElement * novasvg::toSVGElement ( SVGNode *  node)
inline

Definition at line 936 of file svgelement.h.

References novasvg::SVGNode::isElement().

◆ toSVGGeometryElement()

const SVGGeometryElement * novasvg::toSVGGeometryElement ( const SVGNode *  node)
inline

◆ toSVGTextNode()

const SVGTextNode * novasvg::toSVGTextNode ( const SVGNode *  node)
inline

Definition at line 3855 of file svgelement.h.

References novasvg::SVGNode::isTextNode().

◆ toSVGTextPositioningElement()

const SVGTextPositioningElement * novasvg::toSVGTextPositioningElement ( const SVGNode *  node)
inline

◆ version()

int novasvg::version ( )
inline

Returns the version of the novasvg library encoded in a single integer.

Encodes the version of the novasvg library into a single integer for easier comparison. The version is typically represented by combining major, minor, and patch numbers into one integer.

Returns
The novasvg library version as a single integer.

Definition at line 711 of file novasvg.h.

References NOVASVG_VERSION.

◆ versionString()

std::string novasvg::versionString ( )
inline

Returns the novasvg library version as a human-readable string in "X.Y.Z" format.

Provides the version of the novasvg library as a human-readable string in the format "X.Y.Z", where X represents the major version, Y the minor version, and Z the patch version.

Returns
A pointer to a string containing the version in "X.Y.Z" format.

Definition at line 716 of file novasvg.h.

References NOVASVG_VERSION_STRING.

Variable Documentation

◆ emptyString