LocalFont Class

Represents a font that is assumed to be installed on the machine viewing the SVG.

public class LocalFont : Font
PdfToSvg.NET (since v0.1.0)
System.Object PdfToSvg.Font PdfToSvg.LocalFont


Objects of this type can be returned from a FontResolver to indicate how text will be rendered in the generated SVG.

Text representation

PDF documents store text encoded as character codes, and provide mappings from character codes to font glyphs and Unicode characters. Some documents map multiple character codes to the same Unicode character, giving PdfToSvg.NET a choice. Exporting both character codes as the same Unicode character results in good text representation but potentially visually inaccurate SVG’s. Remapping one of the character codes to another Unicode character ensures visually accurate SVG’s at the cost of inaccurate text representation if text is exported from the SVG.

When exporting text using a LocalFont, the library will use the Unicode mapping specified by the document, providing more accurate text representation.


LocalFontCreates a new instance of LocalFont.


FontFamilyGets the font family name to be used in the SVG markup. Multiple font families can be separated by comma.
FontStyleGets the CSS font style to use.
FontWeightGets the CSS font weight to use.


EqualsDetermines whether the specified font is equal to the current one.
GetHashCodeGets a hash code for this font.
ToStringGets a string representation of this font.

See Also

PdfToSvg Namespace