API Reference
FontSpec
Identifies a font without depending on a platform drawing framework.
Inheritance
- Object
- FontSpec
Usage
Explore 9 API references to this type
This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.
Returned or exposed by 8
- Property VisualRenderContext.Font
- Method FontSpec.Clone
- Method FontSpec.FromFamily
- Method FontSpec.FromFile
- Method FontSpec.SystemSans
- Method FontSpec.WithColorPalette
- Method FontSpec.WithVariation
- Property TextStyle.Font
Accepted by parameters 1
- Constructor VisualRenderContext.VisualRenderContext
Constructors
public FontSpec() #Methods
public static FontSpec FromFamily(String family) #FontSpecCreates a font specification for a family or fallback stack.
Parameters
- family System.String
public static FontSpec FromFile(String path, Int32? collectionIndex = null, String? faceName = null) #FontSpecCreates a font specification backed by a TrueType font file.
Parameters
- path System.String
- collectionIndex System.Int32? = null
- faceName System.String? = null
public static FontSpec SystemSans() #FontSpecCreates a system sans-serif font specification.
public FontSpec WithColorPalette(Int32 index) #FontSpecSelects a colour-font palette without changing glyph advances.
Parameters
- index System.Int32
public FontSpec WithVariation(String tag, Double value) #FontSpecSelects an explicit variation axis in design units.
Parameters
- tag System.String
- value System.Double
Inherited Methods
public virtual Boolean Equals(Object? obj) #BooleanParameters
- obj Object?
Properties
public Int32 ColorPaletteIndex { get; set; } #Gets or sets the zero-based CPAL palette index. Zero is the default. Missing or unusable palettes fall back to the font's default palette; bitmap glyphs are unaffected.
public FontVariationSettings Variations { get; set; } #Gets or sets immutable OpenType axis coordinates. The default uses the face's default instance; Weight and Italic retain their existing face-selection policy.
public String Family { get; set; } #Gets or sets the CSS-compatible family or fallback stack.
public String? FilePath { get; set; } #Gets or sets an optional TrueType or TrueType collection path used by raster output.
public Int32? CollectionIndex { get; set; } #Gets or sets an optional TrueType collection face index.
public String? FaceName { get; set; } #Gets or sets an optional face name used when selecting a collection member.
public Int32 Weight { get; set; } #Gets or sets the CSS numeric font weight from 1 through 1000, independently of available font faces.
public Boolean Italic { get; set; } #Gets or sets a value indicating whether an italic face is preferred.