Skip to content

Download specialized fonts on-demand to save on PCK size #1342

Description

@Razoric480

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.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions