|
NovaSVG 0.11.5
An SVG library
|
Classes | |
| struct | foreign_object_font |
| struct | foreign_object_font_metrics |
| struct | foreign_object_size |
| struct | html_tag |
| struct | css_declaration |
| class | css_query |
| struct | text_squeeze |
| Condense text horizontally about about_x (a line that is wider than its box). More... | |
| class | foreign_object_painter |
| struct | foreign_object_context |
| class | foreign_object_renderer |
| Called concurrently from const methods on one document: keep no mutable state without a lock. More... | |
| class | node |
| class | text_node |
| class | element |
| class | document |
| struct | text_metrics |
| How big a piece of text is, measured the way a <text> element is laid out. More... | |
Typedefs | |
| using | node_list = std::vector<node> |
| using | element_list = std::vector<element> |
Functions | |
| std::shared_ptr< foreign_object_renderer > | default_foreign_object_renderer () |
| int | version () |
| Returns the version of the novasvg library encoded in a single integer. | |
| std::string | version_string () |
| Returns the novasvg library version as a human-readable string in "X.Y.Z" format. | |
| bool | is_valid_selector (const std::string &selector) |
| Measures utf8_text with the same font lookup, shaping and kerning that <text> uses. | |
| text_metrics | measure_text (const std::string &utf8_text, const std::string &font_family, float font_size, bool bold=false, bool italic=false) |
| text_metrics | measure_text (const std::string &utf8_text, const std::string &font_family, float font_size, int weight, bool italic=false) |
| The same, for a numeric font-weight (300, 550, 700: a variable font is set to that weight). | |
| using nova::svg::element_list = std::vector<element> |
| using nova::svg::node_list = std::vector<node> |
| std::shared_ptr< foreign_object_renderer > nova::svg::default_foreign_object_renderer | ( | ) |
The renderer a document starts with: the built-in simple one, or null when novasvg was built with NOVA_FOREIGN_OBJECT_SIMPLE=OFF.
References NOVA_API.
| bool nova::svg::is_valid_selector | ( | const std::string & | selector | ) |
Measures utf8_text with the same font lookup, shaping and kerning that <text> uses.
font_family is a CSS font-family list ("Inter", Arial, sans-serif): the names are tried in order, fonts embedded by @font-face of a loaded document included. Invalid UTF-8 is replaced, not rejected. The result is all zeros when no font can be found at all.
| utf8_text | The text, in UTF-8. Line breaks are not interpreted: this is one run. |
| font_family | A CSS font-family list. |
| font_size | The size in user units; the metrics scale with it. |
| bold | font-weight: bold when true, normal otherwise. |
| italic | font-style: italic when true, normal otherwise. |
Whether document::query_selector_all() understands a CSS selector (or a comma-separated list of them).
query_selector_all() returns an empty list both when nothing matches and when the selector is wrong, so a caller that wants to tell the two apart asks this first. False means a syntax error, an empty string, or a selector novasvg does not support.
References NOVA_API.
| text_metrics nova::svg::measure_text | ( | const std::string & | utf8_text, |
| const std::string & | font_family, | ||
| float | font_size, | ||
| bool | bold = false, | ||
| bool | italic = false ) |
References NOVA_API.
| text_metrics nova::svg::measure_text | ( | const std::string & | utf8_text, |
| const std::string & | font_family, | ||
| float | font_size, | ||
| int | weight, | ||
| bool | italic = false ) |
The same, for a numeric font-weight (300, 550, 700: a variable font is set to that weight).
| weight | CSS font-weight; values outside 1 to 1000 are clamped. 400 is normal and 700 is bold, so measure_text(t, f, s, 700) and measure_text(t, f, s, true) give the same result. |
References NOVA_API.
| int nova::svg::version | ( | ) |
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.
| std::string nova::svg::version_string | ( | ) |
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.