Vixen
02b45cc4
csharp
public sealed class FontAsset

A font asset: a face, the faces behind it, and how it is put in an atlas.

No guide page documents this yet — the page shows what the code says about itself.

Remarks

⚠ A document beside the .ttf rather than settings on it, and the reason is the fallback chain. A chain is a property of *this use* of a face: the same NotoSans.ttf is the primary face of one font asset and the CJK fallback of another, and import settings on the file could only express one of those. Doc 11's row names three things — coverage, atlas preview, fallback chain — and the third is what makes this an asset of its own.

⚠ The faces are GUIDs, so moving a .ttf needs nothing done to this file — doc 08's rule, and it is what lets ReferenceIndex report that deleting a font breaks three chains.

Fields and properties (13)

  • public const int Current

    The version this reader and writer speak.

  • public const string Extension

    What a font asset is written as.

  • public int Version

    Which version of the format this file is.

  • public string Name

    What the font is called, in a style sheet.

  • public AssetId Face

    The face it is mostly made of.

  • public int FaceIndex

    Which face inside a collection, for a .ttc.

  • public List<AssetId> Fallbacks

    The faces consulted, in order, for a code point the primary does not have.

  • public float PixelSize

    How large a glyph is rasterised, in pixels.

  • public int AtlasWidth

    How wide the atlas page is, in pixels.

  • public int AtlasHeight

    And how tall.

  • public int Padding

    How many pixels of margin each glyph gets.

  • public bool DistanceField

    Whether glyphs are stored as a distance field rather than as coverage.

  • public List<FontRangeData> Ranges

    The code-point ranges the atlas is pre-populated with.

Methods (2)

  • public static FontAsset FromYaml(string yaml)

    Reads YAML into a font asset.

  • public string ToYaml()

    Writes it as YAML.

Used by (5)

  • FontAtlasViewVixen.Editor.AssetEditors
  • FontDocumentVixen.Editor.AssetEditors
  • FontViewVixen.Editor.AssetEditors
  • TypeRegistrationVixen.Editor.AssetEditors
  • Vixen_Editor_AssetEditors_Fonts_FontAssetSerializerVixen.Editor.AssetEditors