~aleteoryx/muditaos

56e5b758627d9b3c59919ccf83e6029e1da039a3 — Wojtek Cichoń 5 years ago 232042a
[EGD-5787] Adding font-related docs to i18n article

Added missing content regarding adding special glyphs
and rendering the font inside MuditaOS
1 files changed, 44 insertions(+), 1 deletions(-)

M doc/i18n.md
M doc/i18n.md => doc/i18n.md +44 -1
@@ 66,7 66,50 @@ Definition for every key code used in the phone is in [the key_codes.hpp file (K

### Date and time

MuditaOS follows [Linux `date`](https://man7.org/linux/man-pages/man1/date.1.html) to format date and time. 
MuditaOS follows [Linux `date`](https://man7.org/linux/man-pages/man1/date.1.html) to format date and time.

## Font conversion

MuditaOS doesn't have built-in support for ttf/otf fonts, so we generate bitmap files for fonts. The official release uses GT Pressura Typeface which is a licensed font ([more info](../LICENSE.md))

MuditaOS supports the following languages (and characters) out-of-the-box:

- English
- German 
- Spanish 
- Polish
- French

For other languages there might be a need to add language-specific glyphs, build them using [fontbuilder](https://github.com/mudita/fontbuilder) and add them to the repository.

[Here's a list of glyphs that are supported by GT Pressura](https://www.grillitype.com/api/storage/app/uploads/public/5b6/c52/16b/5b6c5216b40a8675629257.pdf) (our current license covers only the Latin alphapbet characters).

[Here's a list of characters currently added to the build](https://github.com/mudita/fontbuilder/blob/master/charset.txt).

If your characters aren't currently supported please know that we're working on adding a fallback font inside MuditaOS that would enable to render the UI in more languages without the need of using proprietary typefaces.

### Adding glyphs

We use [fontbuilder](https://github.com/mudita/fontbuilder). It has font sets saved in files. This is not the best solution to store system presets (we should rather have it in release process). In order to do this:

- feed FontBuilder headless run with preset file and build MPF (Mudita Pure Font)
- put these fonts in build folder

On Mudita Pure phone we use:

- default font (`gt_pressura` font family)
- fallback font (other font with all characters available)

`▯` ← indicates when there is no glyph for a unicode character in current font

#### Naming convention

It’s a good practice not to rename font names - these are stored in font metadata too and metadata is used in code (**not the font file name**). Please just keep names as they are.

#### Where are the files?

- Source font files used for the build: `PurePhone/image/assets/fonts/`
- Font files used at runtime (copied upon build): `PurePhone/<build_folder>/assets/fonts/`

## How to start localizing the interface