TrueTypeGlyphOutlines Class
The TrueType outlines of the glyf and loca tables of a font program that FontLoader cannot load because it lacks tables, such as the programs embedded in PDF documents (/FontFile2), which often have only the tables a PDF reader needs (ISO 32000-2, 9.9).
public sealed class TrueTypeGlyphOutlinesRemarks
The outlines are those of the default instance of a variable font. The object is immutable and can be used from several threads.
Constructors
| Name | Description |
|---|---|
| TrueTypeGlyphOutlines(ReadOnlyMemory<byte>, ReadOnlyMemory<byte>, bool, int, ReadOnlyMemory<byte>, int) | Creates the outlines of the tables of a font program. |
TrueTypeGlyphOutlines(ReadOnlyMemory<byte>, ReadOnlyMemory<byte>, bool, int, ReadOnlyMemory<byte>, int)
TrueTypeGlyphOutlines.csCreates the outlines of the tables of a font program.
public TrueTypeGlyphOutlines(ReadOnlyMemory<byte> glyf, ReadOnlyMemory<byte> loca, bool hasLongLocations, int glyphCount, ReadOnlyMemory<byte> horizontalMetrics = default, int horizontalMetricCount = 0)Parameters
glyfReadOnlyMemory<byte>- The
glyftable. locaReadOnlyMemory<byte>- The
locatable. hasLongLocationsbool- Whether the offsets of the
locatable are 32-bit numbers (theindexToLocFormatof theheadtable is 1). glyphCountint- The number of glyphs (the
numGlyphsof themaxptable, or what thelocatable gives). horizontalMetricsReadOnlyMemory<byte>- The
hmtxtable, or empty: the horizontal metrics of the glyphs. horizontalMetricCountint- The number of glyphs that have their own advance in
horizontalMetrics(thenumberOfHMetricsof thehheatable).
Exceptions
ArgumentOutOfRangeExceptionglyphCountorhorizontalMetricCountis negative.
Properties
| Name | Description |
|---|---|
| GlyphCount | Gets the number of glyphs. |
GlyphCount
TrueTypeGlyphOutlines.csMethods
| Name | Description |
|---|---|
| DecodeOutline(int, OutlineSink, GlyphScratch, GlyphBudget) | Decodes the outline of a glyph, in font units. A glyph identifier that is not a glyph of the font draws nothing. |
DecodeOutline(int, OutlineSink, GlyphScratch, GlyphBudget)
TrueTypeGlyphOutlines.csDecodes the outline of a glyph, in font units. A glyph identifier that is not a glyph of the font draws nothing.
public void DecodeOutline(int glyphId, OutlineSink sink, GlyphScratch scratch, ref GlyphBudget budget)Parameters
glyphIdint- The glyph.
sinkOutlineSink- The receiver of the contours.
scratchGlyphScratch- The buffers of the decoding (the points of the glyph and of its components).
budgetGlyphBudget- The limits of the work of the decoding (the points, the components).
Exceptions
InvalidFontException- The data of the glyph is malformed.
FontResourceLimitException- The glyph exceeds the complexity limit or the allocation limit.