Version: Unity 6.7 Alpha (6000.7)
LanguageEnglish
  • C#

FontAsset.CreateFontAsset

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Declaration

public static FontAsset CreateFontAsset(string familyName, string styleName, int pointSize);

Parameters

Parameter Description
familyName The family name of the source font.
styleName The style name of the source font face.
pointSize Optional point size.

Returns

FontAsset An instance of the newly created font asset.

Description

Creates a new font asset instance from the given family name and style.


Declaration

public static FontAsset CreateFontAsset(string familyName, string styleName, int pointSize, int padding, GlyphRenderMode renderMode);

Parameters

Parameter Description
familyName The family name of the source font.
styleName The style name of the source font face.
pointSize The desired point size.
padding The font padding.
renderMode The glyph render mode (ie. sdf vs. bitmap).

Returns

FontAsset An instance of the newly created font asset.

Description

Creates a new font asset instance from the given family name, style, point size, padding and render mode.


Declaration

public static FontAsset CreateFontAsset(string fontFilePath, int faceIndex, int samplingPointSize, int atlasPadding, GlyphRenderMode renderMode, int atlasWidth, int atlasHeight);

Parameters

Parameter Description
fontFilePath The file path of the font file.
faceIndex The index of font face.
samplingPointSize The sampling point size.
atlasPadding The padding between individual glyphs in the font atlas texture.
renderMode The atlas render mode.
atlasWidth The atlas texture width.
atlasHeight The atlas texture height.

Returns

FontAsset An instance of the newly created font asset.

Description

Creates a new font asset instance from the font file at the given file path.


Declaration

public static FontAsset CreateFontAsset(Font font);

Parameters

Parameter Description
font The source font object.

Returns

FontAsset An instance of the newly created font asset.

Description

Creates a new font asset instance from the provided font object.


Declaration

public static FontAsset CreateFontAsset(Font font, int samplingPointSize, int atlasPadding, GlyphRenderMode renderMode, int atlasWidth, int atlasHeight, AtlasPopulationMode atlasPopulationMode, bool enableMultiAtlasSupport);

Parameters

Parameter Description
font The source font object.
samplingPointSize The sampling point size.
atlasPadding The padding between individual glyphs in the font atlas texture.
renderMode The atlas render mode.
atlasWidth The atlas texture width.
atlasHeight The atlas texture height.
atlasPopulationMode The atlas population mode.
enableMultiAtlasSupport Enable multi atlas texture.

Returns

FontAsset An instance of the newly created font asset.

Description

Creates a new font asset instance from the provided font object.