Skip to content
ChartForgeX
Class

FontSpec

ChartForgeX.Typography

Namespace
ChartForgeX.Typography
Assembly
ChartForgeX
Modifiers
sealed
Attributes
Fluent(Copy = "Clone")

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.

Accepted by parameters 21

Constructors

public FontSpec() #

Methods

public FontSpec Clone() #

Creates a copy that can be modified independently.

Returns

FontSpec
public static FontSpec FromFamily(string family) #

Creates a font specification for a family or fallback stack.

Parameters

family string required

Returns

FontSpec
public static FontSpec FromFile(string path, int? collectionIndex = null, string? faceName = null) #

Creates a font specification backed by a TrueType font file.

Parameters

path string required
collectionIndex int? = null optional
faceName string? = null optional

Returns

FontSpec
public static FontSpec SystemSans() #

Creates a system sans-serif font specification.

Returns

FontSpec
public FontSpec Variation(string tag, double value) #

Selects an explicit variation axis in design units.

Parameters

tag string required
value double required

Returns

FontSpec

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 required
The instance.
value int? required
The value.

Returns

FontSpec The same instance.

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 required
The instance.
value int required
The value.

Returns

FontSpec The same instance.

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 required
The instance.
value string? required
The value.

Returns

FontSpec The same instance.

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 required
The instance.
value string required
The value.

Returns

FontSpec The same instance.

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 required
The instance.
value string? required
The value.

Returns

FontSpec The same instance.

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 required
The instance.
value bool = true optional
The value; true when omitted.

Returns

FontSpec The same instance.

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 required
The instance.
value ChartForgeX.Typography.FontVariationSettings required
The value.

Returns

FontSpec The same instance.

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 required
The instance.
value int required
The value.

Returns

FontSpec The same instance.

Examples

// C# initializer or property                                      // C# fluent
new global::ChartForgeX.Typography.FontSpec { Weight = value };    fontSpec.Weight(value);