FontSpec
ChartForgeX.Typography
Identifies a font without depending on a platform drawing framework.
Inheritance
- object
- FontSpec
Usage
Explore 45 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 24
- Property VisualRenderContext.Font
- Method VisualTypography.ToFontSpec
- Extension method FontSpec.CollectionIndex
- Extension method FontSpec.ColorPaletteIndex
- Extension method FontSpec.FaceName
- Extension method FontSpec.Family
- Extension method FontSpec.FilePath
- Extension method FontSpec.Italic
- Extension method FontSpec.Variations
- Extension method FontSpec.Weight
- Method FontSpec.Clone
- Method FontSpec.FromFamily
- Method FontSpec.FromFile
- Method FontSpec.SystemSans
- Method FontSpec.Variation
- Method FontSpecFluent.CollectionIndex
- Method FontSpecFluent.ColorPaletteIndex
- Method FontSpecFluent.FaceName
- Method FontSpecFluent.Family
- Method FontSpecFluent.FilePath
- Method FontSpecFluent.Italic
- Method FontSpecFluent.Variations
- Method FontSpecFluent.Weight
- Property TextStyle.Font
Accepted by parameters 21
- Constructor VisualRenderContext.VisualRenderContext
- Extension method FontSpec.CollectionIndex
- Extension method FontSpec.ColorPaletteIndex
- Extension method FontSpec.FaceName
- Extension method FontSpec.Family
- Extension method FontSpec.FilePath
- Extension method FontSpec.Italic
- Extension method FontSpec.Variations
- Extension method FontSpec.Weight
- Method FontSpecFluent.CollectionIndex
- Method FontSpecFluent.ColorPaletteIndex
- Method FontSpecFluent.FaceName
- Method FontSpecFluent.Family
- Method FontSpecFluent.FilePath
- Method FontSpecFluent.Italic
- Method FontSpecFluent.Variations
- Method FontSpecFluent.Weight
- Extension method TextStyle.Font
- Extension method TextStyle.Font
- Method TextStyleFluent.Font
- Method TextStyleFluent.Font
Constructors
public FontSpec() #Methods
public static FontSpec FromFamily(string family) #Creates a font specification for a family or fallback stack.
Parameters
- family string
Returns
FontSpecpublic static FontSpec FromFile(string path, int? collectionIndex = null, string? faceName = null) #Creates a font specification backed by a TrueType font file.
Parameters
- path string
- collectionIndex int? = null
- faceName string? = null
Returns
FontSpecInherited Methods
Properties
public int 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 int? 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 int Weight { get; set; } #Gets or sets the CSS numeric font weight from 1 through 1000, independently of available font faces.
public bool Italic { get; set; } #Gets or sets a value indicating whether an italic face is preferred.
Extension Methods
public static FontSpec CollectionIndex(FontSpec fontSpec, int? value) #Sets FontSpec.CollectionIndex: Gets or sets an optional TrueType collection face index.
Parameters
- fontSpec ChartForgeX.Typography.FontSpec
- The instance.
- value int?
- The value.
Examples
// C# initializer or property // C# fluent
new global::ChartForgeX.Typography.FontSpec { CollectionIndex = value }; fontSpec.CollectionIndex(value);public static FontSpec ColorPaletteIndex(FontSpec fontSpec, int value) #Sets FontSpec.ColorPaletteIndex: 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.
Parameters
- fontSpec ChartForgeX.Typography.FontSpec
- The instance.
- value int
- The value.
Examples
// C# initializer or property // C# fluent
new global::ChartForgeX.Typography.FontSpec { ColorPaletteIndex = value }; fontSpec.ColorPaletteIndex(value);public static FontSpec FaceName(FontSpec fontSpec, string? value) #Sets FontSpec.FaceName: Gets or sets an optional face name used when selecting a collection member.
Parameters
- fontSpec ChartForgeX.Typography.FontSpec
- The instance.
- value string?
- The value.
Examples
// C# initializer or property // C# fluent
new global::ChartForgeX.Typography.FontSpec { FaceName = value }; fontSpec.FaceName(value);public static FontSpec Family(FontSpec fontSpec, string value) #Sets FontSpec.Family: Gets or sets the CSS-compatible family or fallback stack.
Parameters
- fontSpec ChartForgeX.Typography.FontSpec
- The instance.
- value string
- The value.
Examples
// C# initializer or property // C# fluent
new global::ChartForgeX.Typography.FontSpec { Family = value }; fontSpec.Family(value);public static FontSpec FilePath(FontSpec fontSpec, string? value) #Sets FontSpec.FilePath: Gets or sets an optional TrueType or TrueType collection path used by raster output.
Parameters
- fontSpec ChartForgeX.Typography.FontSpec
- The instance.
- value string?
- The value.
Examples
// C# initializer or property // C# fluent
new global::ChartForgeX.Typography.FontSpec { FilePath = value }; fontSpec.FilePath(value);public static FontSpec Italic(FontSpec fontSpec, bool value = true) #Sets FontSpec.Italic: Gets or sets a value indicating whether an italic face is preferred.
Parameters
- fontSpec ChartForgeX.Typography.FontSpec
- The instance.
- value bool = true
- The value; true when omitted.
Examples
// C# initializer or property // C# fluent
new global::ChartForgeX.Typography.FontSpec { Italic = value }; fontSpec.Italic(value);public static FontSpec Variations(FontSpec fontSpec, FontVariationSettings value) #Sets FontSpec.Variations: Gets or sets immutable OpenType axis coordinates. The default uses the face's default instance; Weight and Italic retain their existing face-selection policy.
Parameters
- fontSpec ChartForgeX.Typography.FontSpec
- The instance.
- value ChartForgeX.Typography.FontVariationSettings
- The value.
Examples
// C# initializer or property // C# fluent
new global::ChartForgeX.Typography.FontSpec { Variations = value }; fontSpec.Variations(value);public static FontSpec Weight(FontSpec fontSpec, int value) #Sets FontSpec.Weight: Gets or sets the CSS numeric font weight from 1 through 1000, independently of available font faces.
Parameters
- fontSpec ChartForgeX.Typography.FontSpec
- The instance.
- value int
- The value.
Examples
// C# initializer or property // C# fluent
new global::ChartForgeX.Typography.FontSpec { Weight = value }; fontSpec.Weight(value);