esphome / firmware

Holds firmware configuration files for projects that the ESPHome team provides.
https://esphome.io/projects
Apache License 2.0
126 stars 89 forks source link

Ability to substitute the font family on S3 Boxes #188

Closed kyutov closed 1 week ago

kyutov commented 2 months ago

Adds ability to substitute the font family on S3 Boxes.

Currently the firmware uses Google Font with font family Figtree. This font cannot display all the characters, which are listed in allowed_characters so the S3 Boxes are unable to display text in some language (for example Cyrillic - #185 ).

With this PR the font family can be loaded as substitution so the user can change it with different font family which can display the characters of its language.

Specific changes of the firmware.

The font family can be substituted by specifying the font family name as substitution in the following parameter: gfont_family.

Example:

substitutions:
  gfont_family: Roboto

Note that only Google Fonts are supported!

jesserockz commented 1 week ago

You can actually override the fonts in your adopted yaml using !extend Example:

font:
  - id: !extend font_request
    file:
      family: Roboto

You are not even restricted to gfonts, you can completely override the file variable to whatever you want as long as it is valid

kyutov commented 1 week ago

@jesserockz, thanks for your clarification! I will close the PR since the ability with it adds to the firmware seems unnecessary.