GDQuest / GDQuest/learn-gdscript
Download specialized fonts on-demand to save on PCK size
- Dominant language
- GDScript
- Stars
- 2.8k
- Forks
- 235
- PR merge metrics
- No merged PRs in 30d
Description
## Description
There are two types of font assets in the project:
- Base fonts
- Fallback fonts
All fonts are referenced in FontVariation, which are then referenced in the theme. Fallback fonts are used when characters that aren't in the base fonts appear, and our fallback fonts are currenty:
- NotoSansSC-regular and NotoSansSC-bold (chinese, japanese, russian, greek, korean)
- NotoSansArabic-regular and NotoSansArabic-bold (arabic)
NotoSansSC is 10mB each, more notably, and takes up a fair percentage of the PCK's size. For people who aren't using the extra languages, this could save loading time. If we upgraded to the NotoSans-CJK ttc it could be 20 mB.
## Implementation
Given the architecture of our theming, this feature would:
- Define which languages need additional fonts (ar, zh, ja, ru, etc) and where the font lives in the cloud as a const dictionary in translation manager
- Define which font-variations require regular and which require bold somewhere
- If the user switches to such a language:
- Download the prerequisite regular and bold fonts from a GDQuest controlled cloud solution, or google fonts or something stable, into user://
- After that, and at boot-up, if we detect those fonts are in user://, we add them as a fallback to each font-variation
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with the translation manager, FontVariation references, and theme font setup described in the issue. Trace how fallback fonts are selected and how files in user:// can be loaded at startup, then investigate a stable cloud font source. Done means language-specific regular and bold fonts are downloaded on demand and applied as fallbacks without bundling them in the PCK.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- godot
- Domain
- localization, performance
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100