|
MUSX Document Model
|
Converts a Shape Designer definition into an SVG buffer. More...
#include <SvgConvert.h>
Classes | |
| struct | GlyphMetrics |
| Metrics for sizing SVG text bounds. More... | |
Public Types | |
| enum class | SvgUnit { None , Pixels , Points , Picas , Centimeters , Millimeters , Inches } |
| SVG unit suffixes supported by the converter. More... | |
| using | GlyphMetricsFn = std::function< std::optional< GlyphMetrics >(const dom::FontInfo &, std::u32string_view)> |
| Optional callback that returns glyph metrics in EVPU units. | |
Static Public Member Functions | |
| static std::string | toSvg (const dom::others::ShapeDef &shape) |
| Convert a ShapeDef into an SVG string buffer. | |
| static std::string | toSvg (const dom::others::ShapeDef &shape, GlyphMetricsFn glyphMetrics) |
| Convert a ShapeDef into an SVG string buffer. | |
| static std::string | toSvg (const dom::others::ShapeDef &shape, double scaling, SvgUnit unit) |
| Convert a ShapeDef into an SVG string buffer with explicit scaling and units. | |
| static std::string | toSvg (const dom::others::ShapeDef &shape, double scaling, SvgUnit unit, GlyphMetricsFn glyphMetrics) |
| Convert a ShapeDef into an SVG string buffer with explicit scaling and units. | |
| static std::string | presetArrowheadAsSvg (dom::ArrowheadPreset preset, double scaling=1.0, SvgUnit unit=SvgUnit::None) |
| Convert a Finale preset arrowhead into a standalone SVG string buffer. | |
| static std::string | toSvgWithPageFormatScaling (const dom::others::ShapeDef &shape, SvgUnit unit=SvgUnit::Millimeters) |
| Convert a ShapeDef into an SVG string buffer using the document's page format scaling. | |
| static std::string | toSvgWithPageFormatScaling (const dom::others::ShapeDef &shape, SvgUnit unit, GlyphMetricsFn glyphMetrics) |
| Convert a ShapeDef into an SVG string buffer using the document's page format scaling. | |
Converts a Shape Designer definition into an SVG buffer.
| using musx::util::SvgConvert::GlyphMetricsFn = std::function<std::optional<GlyphMetrics>(const dom::FontInfo&, std::u32string_view)> |
Optional callback that returns glyph metrics in EVPU units.
|
strong |
SVG unit suffixes supported by the converter.
| Enumerator | |
|---|---|
| None | Unitless (no suffix). |
| Pixels | "px" |
| Points | "pt" |
| Picas | "pc" |
| Centimeters | "cm" |
| Millimeters | "mm" |
| Inches | "in" |
|
static |
Convert a Finale preset arrowhead into a standalone SVG string buffer.
| preset | The Finale preset arrowhead type. |
| scaling | Scale factor applied to EVPU-based coordinates before unit conversion. When unit is SvgUnit::None, the output coordinates are EVPU * scaling. |
| unit | Unit suffix for width/height (e.g., SvgUnit::Millimeters). |
The returned SVG has the arrow tip anchored at (0,0) and points to the right (positive X axis) at zero rotation.
|
static |
Convert a ShapeDef into an SVG string buffer.
| shape | The shape definition to convert. |
|
static |
Convert a ShapeDef into an SVG string buffer with explicit scaling and units.
| shape | The shape definition to convert. |
| scaling | Scale factor applied to EVPU-based coordinates before unit conversion. When unit is SvgUnit::None, the output coordinates are EVPU * scaling. |
| unit | Unit suffix for width/height (e.g., SvgUnit::Millimeters). |
|
static |
Convert a ShapeDef into an SVG string buffer with explicit scaling and units.
| shape | The shape definition to convert. |
| scaling | Scale factor applied to EVPU-based coordinates before unit conversion. When unit is SvgUnit::None, the output coordinates are EVPU * scaling. |
| unit | Unit suffix for width/height (e.g., SvgUnit::Millimeters). |
| glyphMetrics | Callback that receives the resolved font and the glyph(s) to measure and returns glyph metrics in EVPU units. |
|
static |
Convert a ShapeDef into an SVG string buffer.
| shape | The shape definition to convert. |
| glyphMetrics | Callback that receives the resolved font and the glyph(s) to measure and returns glyph metrics in EVPU units. |
|
static |
Convert a ShapeDef into an SVG string buffer using the document's page format scaling.
| shape | The shape definition to convert. |
| unit | Unit suffix for width/height (e.g., SvgUnit::Millimeters). |
| glyphMetrics | Callback that receives the resolved font and the glyph(s) to measure and returns glyph metrics in EVPU units. |
|
static |
Convert a ShapeDef into an SVG string buffer using the document's page format scaling.
| shape | The shape definition to convert. |
| unit | Unit suffix for width/height (e.g., SvgUnit::Millimeters). |