|
NovaSVG 0.10.0
A header-only SVG library
|
Main namespace for the NovaSVG library. More...
Namespaces | |
| namespace | color_literals |
| String literal operators for creating Color instances. | |
| namespace | detail |
| namespace | render |
| namespace | Specificity |
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 > |
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 |
Main namespace for the NovaSVG library.
| using novasvg::AttributeList = typedef std::forward_list<Attribute> |
Definition at line 764 of file svgelement.h.
| using novasvg::DeclarationList = typedef std::vector<Declaration> |
Definition at line 75 of file svgparser.hpp.
| using novasvg::ElementList = typedef std::vector<Element> |
| using novasvg::LengthList = typedef std::vector<Length> |
Definition at line 435 of file svgelement.h.
| using novasvg::NodeList = typedef std::vector<Node> |
| using novasvg::NumberList = typedef std::vector<float> |
Definition at line 505 of file svgelement.h.
| using novasvg::PointList = typedef std::vector<Point> |
Definition at line 546 of file svgelement.h.
| using novasvg::RuleDataList = typedef std::vector<RuleData> |
Definition at line 106 of file svgparser.hpp.
| using novasvg::Selector = typedef std::vector<SimpleSelector> |
Definition at line 12 of file svgparser.hpp.
| using novasvg::SelectorList = typedef std::vector<Selector> |
Definition at line 13 of file svgparser.hpp.
| using novasvg::SVGCharacterPositions = typedef std::map<size_t, SVGCharacterPosition> |
Definition at line 2048 of file svgelement.h.
| using novasvg::SVGEnumerationEntry = typedef std::pair<Enum, std::string_view> |
Definition at line 322 of file svgelement.h.
| using novasvg::SVGMarkerPositionList = typedef std::vector<SVGMarkerPosition> |
Definition at line 1925 of file svgelement.h.
| using novasvg::SVGNodeList = typedef std::list<std::unique_ptr<SVGNode> > |
Definition at line 806 of file svgelement.h.
| using novasvg::SVGPropertyList = typedef std::forward_list<SVGProperty*> |
Definition at line 807 of file svgelement.h.
| using novasvg::SVGTextFragmentIterator = typedef SVGTextFragmentList::iterator |
Definition at line 3983 of file svgelement.h.
| using novasvg::SVGTextFragmentList = typedef std::vector<SVGTextFragment> |
Definition at line 2076 of file svgelement.h.
| using novasvg::SVGTextPositionList = typedef std::vector<SVGTextPosition> |
Definition at line 2060 of file svgelement.h.
|
strong |
| Enumerator | |
|---|---|
| Auto | |
| Baseline | |
| BeforeEdge | |
| TextBeforeEdge | |
| Middle | |
| Central | |
| AfterEdge | |
| TextAfterEdge | |
| Ideographic | |
| Alphabetic | |
| Hanging | |
| Mathematical | |
Definition at line 245 of file svgelement.h.
|
strong |
| Enumerator | |
|---|---|
| Ltr | |
| Rtl | |
Definition at line 296 of file svgelement.h.
|
strong |
| Enumerator | |
|---|---|
| Inline | |
| None | |
Definition at line 192 of file svgelement.h.
|
strong |
| Enumerator | |
|---|---|
| Auto | |
| UseScript | |
| NoChange | |
| ResetSize | |
| Ideographic | |
| Alphabetic | |
| Hanging | |
| Mathematical | |
| Central | |
| Middle | |
| TextAfterEdge | |
| TextBeforeEdge | |
Definition at line 260 of file svgelement.h.
|
strong |
Definition at line 766 of file svgelement.h.
|
strong |
|
strong |
| Enumerator | |
|---|---|
| Normal | |
| Italic | |
Definition at line 235 of file svgelement.h.
|
strong |
| Enumerator | |
|---|---|
| Normal | |
| Bold | |
Definition at line 240 of file svgelement.h.
|
strong |
| Enumerator | |
|---|---|
| Spacing | |
| SpacingAndGlyphs | |
Definition at line 316 of file svgelement.h.
|
strong |
| Enumerator | |
|---|---|
| Horizontal | |
| Vertical | |
| Diagonal | |
Definition at line 370 of file svgelement.h.
|
strong |
| Enumerator | |
|---|---|
| Allow | |
| Forbid | |
Definition at line 376 of file svgelement.h.
|
strong |
| Enumerator | |
|---|---|
| None | |
| Percent | |
| Px | |
| Em | |
| Ex | |
Definition at line 362 of file svgelement.h.
|
strong |
|
strong |
|
strong |
| Enumerator | |
|---|---|
| StrokeWidth | |
| UserSpaceOnUse | |
Definition at line 311 of file svgelement.h.
|
strong |
| Enumerator | |
|---|---|
| Luminance | |
| Alpha | |
Definition at line 301 of file svgelement.h.
|
strong |
| Enumerator | |
|---|---|
| Normal | |
| Multiply | |
| Screen | |
| Darken | |
| Lighten | |
| Difference | |
| Exclusion | |
Definition at line 211 of file svgelement.h.
|
strong |
| Enumerator | |
|---|---|
| Visible | |
| Hidden | |
Definition at line 203 of file svgelement.h.
|
strong |
|
strong |
| Enumerator | |
|---|---|
| None | |
| Auto | |
| Stroke | |
| Fill | |
| Painted | |
| Visible | |
| VisibleStroke | |
| VisibleFill | |
| VisiblePainted | |
| BoundingBox | |
| All | |
Definition at line 221 of file svgelement.h.
|
strong |
Definition at line 36 of file svgelement.h.
|
strong |
|
strong |
| Enumerator | |
|---|---|
| Painting | |
| Clipping | |
Definition at line 1560 of file svgelement.h.
|
strong |
| Enumerator | |
|---|---|
| Start | |
| Middle | |
| End | |
Definition at line 275 of file svgelement.h.
|
strong |
| Enumerator | |
|---|---|
| Mixed | |
| Upright | |
Definition at line 291 of file svgelement.h.
|
strong |
| Enumerator | |
|---|---|
| ViewBox | |
| FillBox | |
Definition at line 588 of file svgelement.h.
|
strong |
| Enumerator | |
|---|---|
| UserSpaceOnUse | |
| ObjectBoundingBox | |
Definition at line 306 of file svgelement.h.
|
strong |
| Enumerator | |
|---|---|
| Visible | |
| Hidden | |
| Collapse | |
Definition at line 197 of file svgelement.h.
|
strong |
| Enumerator | |
|---|---|
| Default | |
| Preserve | |
Definition at line 281 of file svgelement.h.
|
strong |
| Enumerator | |
|---|---|
| Horizontal | |
| Vertical | |
Definition at line 286 of file svgelement.h.
| 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.
| family | The name of the font family. If an empty string is provided, the font will act as a fallback. |
| bold | Use true for bold, false otherwise. |
| italic | Use true for italic, false otherwise. |
| data | A pointer to the memory buffer containing the font data. |
| length | The size of the memory buffer in bytes. |
| destroy_func | Callback function to free the memory buffer when it is no longer needed. |
| closure | User-defined pointer passed to the destroy_func callback. |
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().
| 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.
| family | The name of the font family. If an empty string is provided, the font will act as a fallback. |
| bold | Use true for bold, false otherwise. |
| italic | Use true for italic, false otherwise. |
| filename | The path to the font file. |
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().
| NOVASVG_INLINE GradientStops novasvg::buildGradientStops | ( | const SVGGradientElement * | element, |
| float | opacity | ||
| ) |
Definition at line 3286 of file svgelement.h.
References novasvg::SVGElement::children(), Stop, and toSVGElement().
Referenced by novasvg::SVGLinearGradientElement::applyPaint(), and novasvg::SVGRadialGradientElement::applyPaint().
| NOVASVG_INLINE float novasvg::calculateBaselineOffset | ( | const SVGTextPositioningElement * | element | ) |
Definition at line 3901 of file svgelement.h.
References AfterEdge, novasvg::SVGTextPositioningElement::alignment_baseline(), novasvg::Font::ascent(), Auto, Baseline, novasvg::SVGTextPositioningElement::baseline_offset(), BeforeEdge, Central, novasvg::SVGTextPositioningElement::font(), Hanging, Ideographic, Mathematical, Middle, novasvg::SVGNode::parentElement(), resolveDominantBaseline(), TextAfterEdge, TextBeforeEdge, and toSVGTextPositioningElement().
Referenced by novasvg::SVGTextFragmentsBuilder::build().
| NOVASVG_INLINE float novasvg::calculateTextAnchorOffset | ( | const SVGTextPositioningElement * | element, |
| float | width | ||
| ) |
Definition at line 3962 of file svgelement.h.
References novasvg::SVGTextPositioningElement::direction(), End, Ltr, Middle, Start, and novasvg::SVGTextPositioningElement::text_anchor().
Referenced by handleTextChunk().
| NOVASVG_INLINE float novasvg::calculateTextChunkLength | ( | SVGTextFragmentIterator | begin, |
| SVGTextFragmentIterator | end, | ||
| bool | isVerticalText | ||
| ) |
Definition at line 3985 of file svgelement.h.
References novasvg::SVGTextFragment::height, novasvg::SVGTextFragment::width, novasvg::SVGTextFragment::x, and novasvg::SVGTextFragment::y.
Referenced by handleTextChunk().
|
constexpr |
Definition at line 113 of file svgparser.hpp.
| 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().
|
constexpr |
Definition at line 150 of file svgparser.hpp.
References startswith().
|
inline |
Definition at line 886 of file svgparser.hpp.
References parseInteger(), skipDelimiter(), and skipString().
| NOVASVG_INLINE ElementID novasvg::elementid | ( | std::string_view | name | ) |
Definition at line 5048 of file svgelement.h.
References 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, Unknown, and Use.
| NOVASVG_INLINE FontFace novasvg::embeddedFallbackFont | ( | bool | bold = false, |
| bool | italic = false |
||
| ) |
Definition at line 624 of file svgparser.hpp.
References novasvg::detail::kEmbeddedFontBoldItalicZlibBase64, novasvg::detail::kEmbeddedFontBoldZlibBase64, novasvg::detail::kEmbeddedFontItalicZlibBase64, and novasvg::detail::kEmbeddedFontZlibBase64.
Referenced by novasvg::FontFaceCache::getFontFace().
|
constexpr |
Definition at line 143 of file svgparser.hpp.
|
constexpr |
Definition at line 108 of file svgparser.hpp.
| NOVASVG_INLINE FontFaceCache * novasvg::fontFaceCache | ( | ) |
Definition at line 449 of file font.h.
Referenced by addFontFaceFromData(), addFontFaceFromFile(), and makeFont().
| NOVASVG_INLINE void novasvg::handleTextChunk | ( | SVGTextFragmentIterator | begin, |
| SVGTextFragmentIterator | end | ||
| ) |
Definition at line 4009 of file svgelement.h.
References calculateTextAnchorOffset(), calculateTextChunkLength(), novasvg::SVGTextFragment::element, novasvg::SVGElement::hasAttribute(), novasvg::SVGTextPositioningElement::isVerticalWritingMode(), novasvg::SVGTextFragment::length, novasvg::SVGTextPositioningElement::lengthAdjust(), novasvg::SVGTextFragment::lengthAdjustTransform, needsTextAnchorAdjustment(), Spacing, SpacingAndGlyphs, TextLength, novasvg::SVGTextPositioningElement::textLength(), novasvg::Transform::translated(), novasvg::LengthContext::valueForLength(), novasvg::SVGTextFragment::x, and novasvg::SVGTextFragment::y.
Referenced by novasvg::SVGTextFragmentsBuilder::build().
|
constexpr |
Definition at line 118 of file svgparser.hpp.
References IS_WS(), and skipOptionalSpaces().
|
constexpr |
Definition at line 11 of file svgparserutils.h.
Referenced by IS_CSS_STARTNAMECHAR(), IS_STARTNAMECHAR(), and isIntegralDigit().
|
constexpr |
Definition at line 310 of file svgparser.hpp.
References IS_CSS_STARTNAMECHAR(), and IS_NUM().
Referenced by readCSSIdentifier().
|
constexpr |
Definition at line 309 of file svgparser.hpp.
References IS_ALPHA().
Referenced by IS_CSS_NAMECHAR(), and readCSSIdentifier().
|
constexpr |
Definition at line 961 of file svgparser.hpp.
References IS_NUM(), and IS_STARTNAMECHAR().
Referenced by readIdentifier().
|
constexpr |
Definition at line 10 of file svgparserutils.h.
Referenced by IS_CSS_NAMECHAR(), IS_NAMECHAR(), isIntegralDigit(), parseNumber(), and toIntegralDigit().
|
constexpr |
Definition at line 960 of file svgparser.hpp.
References IS_ALPHA().
Referenced by IS_NAMECHAR(), and readIdentifier().
|
constexpr |
Definition at line 12 of file svgparserutils.h.
Referenced by novasvg::RuleIndex::candidates(), includes(), novasvg::SVGLengthList::parse(), novasvg::SVGTransformOrigin::parse(), parseDashArray(), skipOptionalSpaces(), skipOptionalSpacesOrDelimiter(), stripImportantFlag(), stripLeadingSpaces(), and stripTrailingSpaces().
|
inline |
|
constexpr |
Definition at line 91 of file svgparserutils.h.
References IS_ALPHA(), and IS_NUM().
Referenced by parseInteger().
| NOVASVG_INLINE Bitmap novasvg::loadImageResource | ( | const std::string & | href | ) |
Definition at line 6015 of file svgelement.h.
References novasvg::render::surface_load_from_image_base64(), and novasvg::render::surface_load_from_image_file().
Referenced by novasvg::SVGImageElement::parseAttribute().
| NOVASVG_INLINE Font novasvg::makeFont | ( | const std::string & | family, |
| float | size, | ||
| bool | bold, | ||
| bool | italic | ||
| ) |
Definition at line 5026 of file svgelement.h.
References emptyString, fontFaceCache(), novasvg::FontFaceCache::getFontFace(), novasvg::FontFaceCache::getFontFaceForFamilyStack(), and novasvg::FontFace::isNull().
Referenced by novasvg::SVGLayoutState::font(), and novasvg::SVGForeignObjectElement::fontsFor().
|
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().
|
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().
|
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().
| NOVASVG_INLINE bool novasvg::needsTextAnchorAdjustment | ( | const SVGTextPositioningElement * | element | ) |
Definition at line 3945 of file svgelement.h.
References novasvg::SVGTextPositioningElement::direction(), End, Ltr, Middle, Rtl, Start, and novasvg::SVGTextPositioningElement::text_anchor().
Referenced by handleTextChunk().
Definition at line 108 of file canvas.h.
References novasvg::Point::dot().
Referenced by novasvg::Matrix::Matrix().
Definition at line 81 of file canvas.h.
References novasvg::Point::x, and novasvg::Point::y.
Definition at line 134 of file canvas.h.
References novasvg::Size::h, and novasvg::Size::w.
Definition at line 96 of file canvas.h.
References novasvg::Point::move().
Definition at line 149 of file canvas.h.
References novasvg::Size::expand().
Definition at line 91 of file canvas.h.
References novasvg::Point::x, and novasvg::Point::y.
Definition at line 86 of file canvas.h.
References novasvg::Point::x, and novasvg::Point::y.
Definition at line 144 of file canvas.h.
References novasvg::Size::h, and novasvg::Size::w.
Definition at line 139 of file canvas.h.
References novasvg::Size::h, and novasvg::Size::w.
Definition at line 102 of file canvas.h.
References novasvg::Point::move().
Definition at line 155 of file canvas.h.
References novasvg::Size::expand().
Definition at line 104 of file svgparser.hpp.
References novasvg::RuleData::isLessThan().
|
inline |
|
inline |
Stream output operator for ColorBlend.
Allows using ColorBlend with output streams. The blend is automatically converted to a Color before output.
| os | Output stream. |
| blend | ColorBlend to output. |
Definition at line 959 of file color.h.
References novasvg::render::blend().
| NOVASVG_INLINE AlignmentBaseline novasvg::parseAlignmentBaseline | ( | std::string_view | input | ) |
Definition at line 4686 of file svgelement.h.
References AfterEdge, Alphabetic, Auto, Baseline, BeforeEdge, Central, Hanging, Ideographic, Mathematical, Middle, parseEnumValue(), TextAfterEdge, and TextBeforeEdge.
Referenced by novasvg::SVGLayoutState::SVGLayoutState().
| NOVASVG_INLINE BaselineShift novasvg::parseBaselineShift | ( | std::string_view | input | ) |
Definition at line 4544 of file svgelement.h.
References Allow, novasvg::BaselineShift::Baseline, None, parseLength(), novasvg::BaselineShift::Sub, and novasvg::BaselineShift::Super.
Referenced by novasvg::SVGLayoutState::SVGLayoutState().
| 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().
| 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().
| NOVASVG_INLINE std::optional< Color > novasvg::parseColorValue | ( | std::string_view & | input, |
| const SVGLayoutState * | state | ||
| ) |
Definition at line 4428 of file svgelement.h.
References novasvg::render::state::color, novasvg::render::color_parse(), novasvg::render::color_to_argb32(), and skipString().
Referenced by parseColor().
| NOVASVG_INLINE LengthList novasvg::parseDashArray | ( | std::string_view | input | ) |
Definition at line 4555 of file svgelement.h.
References Forbid, IS_WS(), None, novasvg::Length::parse(), and skipOptionalSpacesOrComma().
Referenced by novasvg::SVGLayoutState::SVGLayoutState().
| 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().
| 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().
| NOVASVG_INLINE DominantBaseline novasvg::parseDominantBaseline | ( | std::string_view | input | ) |
Definition at line 4706 of file svgelement.h.
References Alphabetic, Auto, Central, Hanging, Ideographic, Mathematical, Middle, NoChange, parseEnumValue(), ResetSize, TextAfterEdge, TextBeforeEdge, and UseScript.
Referenced by novasvg::SVGLayoutState::SVGLayoutState().
| NOVASVG_INLINE Enum novasvg::parseEnumValue | ( | std::string_view | input, |
| const SVGEnumerationEntry< Enum >(&) | entries[N], | ||
| Enum | defaultValue | ||
| ) |
Definition at line 4593 of file svgelement.h.
Referenced by parseAlignmentBaseline(), parseDirection(), parseDisplay(), parseDominantBaseline(), parseFillRule(), parseFontStyle(), parseFontWeight(), parseLineCap(), parseLineJoin(), parseMaskType(), parseMixBlendMode(), parseOverflow(), parsePointerEvents(), parseTextAnchor(), parseTextOrientation(), parseVisibility(), parseWhiteSpace(), and parseWritingMode().
| 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().
| NOVASVG_INLINE float novasvg::parseFontSize | ( | std::string_view | input, |
| const SVGLayoutState * | state | ||
| ) |
Definition at line 4580 of file svgelement.h.
References Em, Ex, novasvg::render::state::font_size, Forbid, None, parseLength(), and Percent.
Referenced by novasvg::SVGLayoutState::SVGLayoutState().
| 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().
| 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().
|
inline |
Definition at line 853 of file svgparser.hpp.
References csspropertyid(), readCSSIdentifier(), novasvg::SVGElement::setAttribute(), skipDelimiter(), skipOptionalSpaces(), skipOptionalSpacesOrDelimiter(), stripImportantFlag(), and Unknown.
|
inline |
Definition at line 110 of file svgparserutils.h.
References isIntegralDigit(), and toIntegralDigit().
Referenced by decodeText().
| NOVASVG_INLINE Length novasvg::parseLength | ( | std::string_view | input, |
| LengthNegativeMode | mode, | ||
| const Length & | defaultValue | ||
| ) |
Definition at line 4536 of file svgelement.h.
References novasvg::Length::parse().
Referenced by parseBaselineShift(), parseFontSize(), parseLengthOrNormal(), and novasvg::SVGLayoutState::SVGLayoutState().
| 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().
| 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().
| 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().
| 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().
| NOVASVG_INLINE MixBlendMode novasvg::parseMixBlendMode | ( | std::string_view | input | ) |
Definition at line 4789 of file svgelement.h.
References Darken, Difference, Exclusion, Lighten, Multiply, Normal, parseEnumValue(), and Screen.
Referenced by novasvg::SVGLayoutState::SVGLayoutState().
|
inline |
Definition at line 145 of file svgparserutils.h.
References IS_NUM().
Referenced by novasvg::SVGAngle::parse(), novasvg::SVGNumberPercentage::parse(), novasvg::SVGNumberList::parse(), novasvg::SVGPoint::parse(), novasvg::SVGPointList::parse(), novasvg::SVGRect::parse(), novasvg::SVGTransformOrigin::parse(), novasvg::SVGNumber::parse(), novasvg::Length::parse(), and 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().
| 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().
| NOVASVG_INLINE Paint novasvg::parsePaint | ( | std::string_view | input, |
| const SVGLayoutState * | state, | ||
| const Color & | defaultValue | ||
| ) |
Definition at line 4510 of file svgelement.h.
References parseColorOrNone(), parseUrlValue(), skipOptionalSpaces(), and novasvg::Color::Transparent.
Referenced by novasvg::SVGLayoutState::SVGLayoutState().
| NOVASVG_INLINE PointerEvents novasvg::parsePointerEvents | ( | std::string_view | input | ) |
Definition at line 4635 of file svgelement.h.
References All, Auto, BoundingBox, Fill, None, Painted, parseEnumValue(), Stroke, Visible, VisibleFill, VisiblePainted, and VisibleStroke.
Referenced by novasvg::SVGLayoutState::SVGLayoutState().
| 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().
| 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().
| 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().
| 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().
| 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().
| 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().
| 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().
| NOVASVG_INLINE PropertyID novasvg::propertyid | ( | std::string_view | name | ) |
Definition at line 2312 of file svgelement.h.
References csspropertyid(), and propertyid().
Referenced by novasvg::SVGElement::getAttribute(), novasvg::SVGElement::hasAttribute(), propertyid(), and novasvg::SVGElement::setAttribute().
|
inline |
Definition at line 312 of file svgparser.hpp.
References IS_CSS_NAMECHAR(), and IS_CSS_STARTNAMECHAR().
Referenced by parseInlineStyle().
|
inline |
Definition at line 963 of file svgparser.hpp.
References IS_NAMECHAR(), and IS_STARTNAMECHAR().
|
inline |
Definition at line 876 of file svgparser.hpp.
| NOVASVG_INLINE AlignmentBaseline novasvg::resolveDominantBaseline | ( | const SVGTextPositioningElement * | element | ) |
Definition at line 3867 of file svgelement.h.
References Alphabetic, Auto, Central, novasvg::SVGTextPositioningElement::dominant_baseline(), Hanging, Ideographic, novasvg::SVGTextPositioningElement::isVerticalWritingMode(), Mathematical, Middle, NoChange, ResetSize, TextAfterEdge, TextBeforeEdge, and UseScript.
Referenced by calculateBaselineOffset().
|
constexpr |
Definition at line 71 of file svgparserutils.h.
Referenced by decodeText(), parseInlineStyle(), parseNumberOrPercentage(), and parseUrlValue().
|
constexpr |
Definition at line 60 of file svgparserutils.h.
References skipOptionalSpaces().
|
constexpr |
Definition at line 34 of file svgparserutils.h.
References IS_WS().
Referenced by novasvg::RuleIndex::candidates(), includes(), novasvg::SVGPoint::parse(), novasvg::SVGTransformOrigin::parse(), novasvg::SVGPreserveAspectRatio::parse(), parseInlineStyle(), parsePaint(), parseUrlValue(), skipDelimiterAndOptionalSpaces(), skipOptionalSpacesOrDelimiter(), and stripImportantFlag().
|
constexpr |
Definition at line 55 of file svgparserutils.h.
References skipOptionalSpacesOrDelimiter().
Referenced by novasvg::SVGLengthList::parse(), novasvg::SVGNumberList::parse(), novasvg::SVGPointList::parse(), novasvg::SVGRect::parse(), and parseDashArray().
|
constexpr |
Definition at line 41 of file svgparserutils.h.
References IS_WS(), and skipOptionalSpaces().
Referenced by parseInlineStyle(), and skipOptionalSpacesOrComma().
|
constexpr |
Definition at line 81 of file svgparserutils.h.
Referenced by decodeText(), novasvg::SVGPreserveAspectRatio::parse(), parseColorValue(), and parseUrlValue().
|
constexpr |
Definition at line 136 of file svgparser.hpp.
Referenced by dashequals().
|
inline |
Definition at line 831 of file svgparser.hpp.
References IS_WS(), skipOptionalSpaces(), and stripTrailingSpaces().
Referenced by parseInlineStyle().
|
constexpr |
Definition at line 28 of file svgparserutils.h.
References stripLeadingSpaces(), and stripTrailingSpaces().
Referenced by novasvg::FontFaceCache::getFontFaceForFamilyStack(), novasvg::SVGString::parse(), novasvg::SVGAngle::parse(), novasvg::SVGNumberPercentage::parse(), novasvg::SVGPoint::parse(), novasvg::SVGRect::parse(), novasvg::SVGTransformBox::parse(), novasvg::SVGTransformOrigin::parse(), novasvg::SVGNumber::parse(), novasvg::Length::parse(), novasvg::SVGEnumeration< Enum >::parseEnum(), and novasvg::SVGLayoutState::SVGLayoutState().
|
constexpr |
Definition at line 14 of file svgparserutils.h.
References IS_WS().
Referenced by novasvg::SVGNumberList::parse(), novasvg::SVGPointList::parse(), novasvg::SVGPreserveAspectRatio::parse(), and stripLeadingAndTrailingSpaces().
|
constexpr |
Definition at line 21 of file svgparserutils.h.
References IS_WS().
Referenced by stripImportantFlag(), and stripLeadingAndTrailingSpaces().
|
inline |
Definition at line 7128 of file svgelement.h.
References novasvg::SVGElement::getAttribute(), novasvg::SVGElement::hasAttribute(), RequiredExtensions, and SystemLanguage.
|
constexpr |
|
inline |
Definition at line 943 of file svgelement.h.
References toSVGElement().
|
inline |
Definition at line 929 of file svgelement.h.
References novasvg::SVGNode::isElement().
Referenced by novasvg::SVGClipPathElement::applyClipPath(), novasvg::SVGFilterElement::applyFilter(), novasvg::SVGFEMergeElement::applyFilterPrimitive(), novasvg::SVGElement::build(), buildGradientStops(), novasvg::SVGGradientElement::collectGradientAttributes(), novasvg::SVGElement::elementFromPoint(), novasvg::SVGElement::fillBoundingBox(), novasvg::SVGElement::layoutChildren(), novasvg::SVGFilterElement::pixelMargin(), novasvg::SVGElement::renderChildren(), novasvg::SVGClipPathElement::requiresMasking(), novasvg::SVGElement::strokeBoundingBox(), toSVGElement(), and novasvg::SVGElement::transverse().
|
inline |
Definition at line 936 of file svgelement.h.
References novasvg::SVGNode::isElement().
|
inline |
Definition at line 7326 of file svgelement.h.
References novasvg::SVGNode::isGeometryElement().
Referenced by novasvg::SVGClipPathElement::applyClipPath(), and novasvg::SVGClipPathElement::requiresMasking().
|
inline |
Definition at line 3855 of file svgelement.h.
References novasvg::SVGNode::isTextNode().
|
inline |
Definition at line 3861 of file svgelement.h.
References novasvg::SVGNode::isTextPositioningElement().
Referenced by novasvg::SVGTextFragmentsBuilder::build(), and calculateBaselineOffset().
|
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.
Definition at line 711 of file novasvg.h.
References NOVASVG_VERSION.
|
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.
Definition at line 716 of file novasvg.h.
References NOVASVG_VERSION_STRING.
| NOVASVG_INLINE const std::string novasvg::emptyString |
Definition at line 5114 of file svgelement.h.
Referenced by novasvg::TextNode::data(), novasvg::Element::getAttribute(), novasvg::SVGElement::getAttribute(), novasvg::SVGElement::getAttribute(), and makeFont().