fonts

Installation
SKILL.md

Fonts in Decentraland

Every text component has two font fields:

Field What it takes Components
font A built-in face. On TextShape / UiText: Font.F_SANS_SERIF (default), Font.F_SERIF, Font.F_MONOSPACE. On React-ECS props: 'sans-serif' (default), 'serif', 'monospace' All
fontSrc Path to a .ttf file in the scene's content, relative to the scene root TextShape, UiText, UiInput, UiDropdown, and the React-ECS Label, Button, Input, Dropdown and UiEntity uiText

Those three built-in faces are the only ones. There is no font name list beyond them.

RULE: Check the SDK version before writing fontSrc

fontSrc needs @dcl/sdk 7.31.0 or later. On earlier versions the field does not exist: it is a TypeScript error, and even forced past the types the SDK never sends it to the explorer.

Read the installed version from node_modules/@dcl/sdk/package.json (or package.json) before writing it. If the scene is older, either upgrade @dcl/sdk or stay with a built-in font. Never patch the SDK's generated serializers in node_modules; it breaks on the next install.

RULE: Always set font next to fontSrc

Installs
29
GitHub Stars
4
First Seen
10 days ago