ColorGlyph Class
A glyph of a color font as a display list: what the COLR table describes as a graph of paints, flattened into operations that are run in order.
public sealed class ColorGlyphRemarks
The list is built once, when a text is laid out, from the font data, which it validates; drawing it reads the outlines of the glyphs it fills and allocates nothing. Coordinates are font units with the y axis up.
Properties
| Name | Description |
|---|---|
| ClipDepth | Gets the greatest number of clips that are open at the same time. |
| Image | Gets the image of a glyph the font gives as a bitmap, which the display list draws; null for a glyph made of paints. |
| IsEmpty | Gets a value indicating whether the glyph draws nothing. |
| LayerDepth | Gets the greatest number of layers that are open at the same time, the surface of the glyph included. |
| Numbers | Gets the transformations (six numbers each), the geometry of the gradients and the boxes the operations and the paints refer to. |
| Ops | Gets the operations of the display list, in the order they are run. |
| Paints | Gets the paints the operations fill with. |
| Stops | Gets the color stops of the gradients, and the colors of the solid paints. |
| XMax | Gets the right of the box that contains everything the glyph draws. |
| XMin | Gets the left of the box that contains everything the glyph draws. |
| YMax | Gets the top of the box that contains everything the glyph draws. |
| YMin | Gets the bottom of the box that contains everything the glyph draws. |
ClipDepth
ColorGlyph.csImage
ColorGlyph.csGets the image of a glyph the font gives as a bitmap, which the display list draws; null for a glyph made of paints.
public ColorImage? Image { get; }Property value
IsEmpty
ColorGlyph.csLayerDepth
ColorGlyph.csNumbers
ColorGlyph.csGets the transformations (six numbers each), the geometry of the gradients and the boxes the operations and the paints refer to.
public ReadOnlySpan<double> Numbers { get; }Property value
Gets the operations of the display list, in the order they are run.
public ReadOnlySpan<ColorOp> Ops { get; }Property value
Paints
ColorGlyph.csGets the paints the operations fill with.
public ReadOnlySpan<ColorPaint> Paints { get; }Property value
Stops
ColorGlyph.csGets the color stops of the gradients, and the colors of the solid paints.
public ReadOnlySpan<ColorStop> Stops { get; }Property value
XMax
ColorGlyph.csXMin
ColorGlyph.csYMax
ColorGlyph.csYMin
ColorGlyph.csMethods
| Name | Description |
|---|---|
| FromImage(ColorImage, double, double, double, double) | Creates the display list of a glyph the font gives as a bitmap: its image, drawn in a rectangle. |
FromImage(ColorImage, double, double, double, double)
ColorGlyph.csCreates the display list of a glyph the font gives as a bitmap: its image, drawn in a rectangle.
public static ColorGlyph FromImage(ColorImage image, double left, double top, double width, double height)Parameters
imageColorImage- The decoded image of the glyph.
leftdouble- The left of the rectangle, in font units.
topdouble- The top of the rectangle, in font units.
widthdouble- The width of the rectangle, in font units.
heightdouble- The height of the rectangle, in font units.
Returns
Exceptions
InvalidFontException- The rectangle is outside the coordinates an outline can have.