playcanvas / playcanvas/engine

Be able for text element to use localised font without setting a key

Open
#3,481 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area: ui enhancement
Dominant language
JavaScript
Stars
16.8k
Forks
2k
Avg merge
4h 32m
Merged PRs (30d)
222

Description

Project: https://playcanvas.com/editor/scene/1230709
image

The font have been setup as the following:
image

It is common for a text element to just be numbers set from code. At the moment there is no way to set a text element to use the localised font (fr-FR in this case) without setting a key id.

The workaround is to set a random key id (or a key id that is mapped to " ") so that a localised font asset is used.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Begin by tracing the text element's localized-font selection in the engine source; the issue names no file or test entry point. Reproduce the linked editor scene and compare numeric or code-set text with the current random-key workaround. The work is complete when such text uses the locale's font without requiring a key.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
localization
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.