TikTok for Developers

Developer Docs

Last updated October 2, 2026

Fonts

Enables you to load custom font files for use in your mini game's text rendering. Use loadFont to register a custom font and obtain a font family name that can be applied to canvas text rendering contexts.

TTMinis.game.loadFont(path)

Loads a custom font file.

Parameters

Field

Type

Description

Required

path

string

The font file path. Supports local paths and code package paths.

Yes

Returns

string - The font family name if the font loads successfully. Returns null otherwise.

Example

const fontFamily = TTMinis.game.loadFont('fonts/custom.ttf');
console.log(fontFamily);
TikTok for Developers