From 4d3403f69fc2f94b5a328a93320c9a825829317b Mon Sep 17 00:00:00 2001 From: Eibriel Date: Fri, 6 Nov 2026 15:42:39 -0300 Subject: [PATCH] docs(sdk7): custom fonts on mobile, Google Fonts family names, support by client Refs decentraland/docs#238 --- .../mobile-client/missing-features.md | 1 - creator/sdk7/2d-ui/ui_special_types.md | 2 +- creator/sdk7/2d-ui/ui_text.md | 23 ++++++++--- creator/sdk7/3d-essentials/text.md | 40 +++++++++++++++---- 4 files changed, 52 insertions(+), 14 deletions(-) diff --git a/creator/build-for-mobile/mobile-client/missing-features.md b/creator/build-for-mobile/mobile-client/missing-features.md index 6a0177a6..ab1020ed 100644 --- a/creator/build-for-mobile/mobile-client/missing-features.md +++ b/creator/build-for-mobile/mobile-client/missing-features.md @@ -23,7 +23,6 @@ These are no longer gaps as of mobile app **v1.15.0**, which is rolling out to t ## SDK Features Missing on Mobile -- [Custom fonts (`fontSrc` on `TextShape`, `Label`, `Button`, `Input` and `Dropdown`)](../../sdk7/2d-ui/ui_text.md#custom-fonts) — the mobile app ignores `fontSrc` and renders the fallback `font` — No ETA - [`AvatarNametag` (scene-authored label above a player's nametag)](https://github.com/decentraland/godot-explorer/issues/2811) — No ETA - [Tween sequences (`TweenSequence`)](../../sdk7/3d-essentials/move-entities.md#tween-sequences) — not implemented; sequenced tweens don't animate — No ETA - [SDK7 UiBackground nine-slice tiles instead of stretching](https://github.com/decentraland/godot-explorer/issues/2060) — No ETA diff --git a/creator/sdk7/2d-ui/ui_special_types.md b/creator/sdk7/2d-ui/ui_special_types.md index 3b288ae1..8771a86e 100644 --- a/creator/sdk7/2d-ui/ui_special_types.md +++ b/creator/sdk7/2d-ui/ui_special_types.md @@ -220,7 +220,7 @@ The following properties are also available to customize the look of the text fi * `font`: The font to use. Supported values are: - `'sans-serif'` _(default)_ - `'serif'` - `'monospace'` -* `fontSrc`: Path to a `.ttf` font file in your scene, to render the text with a custom font. `font` is used as the fallback. See [Custom fonts](ui_text.md#custom-fonts). +* `fontSrc`: Path to a `.ttf` font file in your scene, or a Google Fonts family name, to render the text with a custom font. `font` is used as the fallback. See [Custom fonts](ui_text.md#custom-fonts). * `textAlign`: How the text will align with its parent. It takes a value from the \`TextAlignType\`. TextAlignType = 'top-left' | 'top-center' | 'top-right' | 'middle-left' | 'middle-center' | 'middle-right' | 'bottom-left' | 'bottom-center' | 'bottom-right'; diff --git a/creator/sdk7/2d-ui/ui_text.md b/creator/sdk7/2d-ui/ui_text.md index c924f4d9..754d7f74 100644 --- a/creator/sdk7/2d-ui/ui_text.md +++ b/creator/sdk7/2d-ui/ui_text.md @@ -17,7 +17,7 @@ A `Label` entity has the following fields that can be configured: * `'serif'` * `'sans-serif'` _(default)_ * `'monospace'` -* `fontSrc`: Path to a `.ttf` font file in your scene, to render the text with a custom font. `font` is used as the fallback. See [Custom fonts](#custom-fonts). +* `fontSrc`: Path to a `.ttf` font file in your scene, or a Google Fonts family name, to render the text with a custom font. `font` is used as the fallback. See [Custom fonts](#custom-fonts). * `textAlign`: How the text will align with its parent. It takes a value from the `TextAlignType` type. TextAlignType = 'top-left' | 'top-center' | 'top-right' | 'middle-left' | 'middle-center' | 'middle-right' | 'bottom-left' | 'bottom-center' | 'bottom-right'; * `textWrap`: Sets if the text uses line-breaks to prevent exceeding the maximum width. It's on by default (`'wrap'`), to deactivate it pass the value `'nowrap'`. @@ -90,7 +90,7 @@ Because this differs per explorer, a preview that looks right in one client does ## Custom fonts -To render a `Label` with your own font, add a TrueType (`.ttf`) font file to your scene folder and set the `fontSrc` property to its path, relative to the scene's root folder. Keep `font` set too: it's the fallback used whenever the custom font can't be loaded. +To render a `Label` with your own font, set the `fontSrc` property to the path of a TrueType (`.ttf`) font file in your scene folder, relative to the scene's root folder, or to a [Google Fonts](https://fonts.google.com/) family name, like `"Playfair Display"`. Keep `font` set too: it's the fallback used while the custom font loads, and whenever it can't be used. {% hint style="warning" %} **📔 Note**: `fontSrc` needs `@dcl/sdk` 7.31.0 or later. On earlier versions the property doesn't exist. @@ -106,19 +106,32 @@ To render a `Label` with your own font, add a TrueType (`.ttf`) font file to you /> ``` +With a Google Fonts family name, the client downloads the font, so you don't add any file to your scene: + +```tsx +