Table of Contents

Class FontAssetBuilder

Namespace
CustomFont
Assembly
CustomFont.dll

A builder class to create font asset.

public class FontAssetBuilder
Inheritance
FontAssetBuilder
Inherited Members

Constructors

FontAssetBuilder(Font)

public FontAssetBuilder(Font font)

Parameters

font Font

The source font to create font asset from.

Properties

AtlasHeight

A parameter directly passed to FontAsset.CreateFontAsset(). Default: 1024

public int AtlasHeight { get; set; }

Property Value

int

AtlasPadding

A parameter directly passed to FontAsset.CreateFontAsset(). Default: 9

public int AtlasPadding { get; set; }

Property Value

int

AtlasWidth

A parameter directly passed to FontAsset.CreateFontAsset(). Default: 1024

public int AtlasWidth { get; set; }

Property Value

int

CharList

The characters to be included in the font asset. If this is empty, all characters are included.

public ISet<uint> CharList { get; set; }

Property Value

ISet<uint>

FaceIndex

A parameter directly passed to FontAsset.CreateFontAsset(). Default: 0

public int FaceIndex { get; set; }

Property Value

int

Font

The source font to create font asset from.

public Font Font { get; set; }

Property Value

Font

RenderMode

A parameter directly passed to FontAsset.CreateFontAsset(). Default: GlyphRenderMode.SDFAA

public GlyphRenderMode RenderMode { get; set; }

Property Value

GlyphRenderMode

SamplingPointSize

A parameter directly passed to FontAsset.CreateFontAsset(). Default: 90

public int SamplingPointSize { get; set; }

Property Value

int

Methods

AddChars(ISet<uint>)

Add unicode code points to font asset. It's caller's responsibility to ensure the code points are valid.

public FontAssetBuilder AddChars(ISet<uint> unicodes)

Parameters

unicodes ISet<uint>

Returns

FontAssetBuilder

The FontAssetBuilder that calls this method

AddChars(string)

Add a sequence of characters to font asset. If there are duplicate characters, only one of them is added.

public FontAssetBuilder AddChars(string chars)

Parameters

chars string

The sequence of characters to add

Returns

FontAssetBuilder

The FontAssetBuilder that calls this method

AddChars(uint, uint)

Add range of unicode code points to font asset (inclusive-inclusive). It's caller's responsibility to ensure the range does not include invalid code points.

public FontAssetBuilder AddChars(uint start, uint end)

Parameters

start uint

The start of the range (inclusive)

end uint

The end of the range (inclusive)

Returns

FontAssetBuilder

The FontAssetBuilder that calls this method

Exceptions

ArgumentException

start is greater than or equal to end

Create()

Create font asset with the properties.

public TMP_FontAsset Create()

Returns

TMP_FontAsset

Exceptions

CustomFontException

Failed to create font asset