Skip to content

Game.Prefabs.FontInfo

Assembly: Assembly-CSharp.dll
Namespace: Game.Prefabs

Type: class

Base: System.Object

Summary:
Serializable container used to store configuration for a Font asset used by the game. Holds a reference to a UnityEngine.Font and parameters used when sampling/generating a font atlas (point size, padding and atlas dimensions). Typically exposed in prefabs or serialized assets and editable from the Unity inspector.


Fields

  • public Font m_Font
    Reference to the UnityEngine.Font asset to use for this FontInfo. This is the actual font resource whose glyphs will be sampled.

  • public int m_SamplingPointSize = 90
    Point size used when sampling/generating glyph bitmaps from the font. Larger values increase glyph detail/resolution in the generated atlas.

  • public int m_AtlasPadding = 9
    Padding in pixels added around each glyph inside the atlas to avoid texture bleeding and allow for effects like outlines/blur.

  • public int m_AtlasWidth = 1024
    Width in pixels of the generated font atlas texture.

  • public int m_AtlasHeight = 1024
    Height in pixels of the generated font atlas texture.

Properties

  • None

Constructors

  • public FontInfo()
    Default parameterless constructor. The class is marked [Serializable], so instances are typically created/initialized by Unity's serialization system (e.g., when assigned in the inspector or deserialized from assets). Fields have default values as shown in the source.

Methods

  • None

Usage Example

// Create and configure a FontInfo at runtime
var fi = new Game.Prefabs.FontInfo();
fi.m_Font = Resources.GetBuiltinResource<Font>("Arial.ttf"); // example: assign a font
fi.m_SamplingPointSize = 90;
fi.m_AtlasPadding = 8;
fi.m_AtlasWidth = 2048;
fi.m_AtlasHeight = 1024;

// Use fi where the mod/game expects a FontInfo (e.g., assign to a prefab component or serialization target)
someComponent.fontInfo = fi;

Notes: - The class is simple data-only and does not perform atlas generation itself. Those operations are handled by font/texture processing systems elsewhere in the codebase. - Because it is [Serializable], prefer editing instances of this class via Unity inspector or serialized asset files for persistent changes.