Skip to content

Creating your own fonts

Felix Mariotto edited this page Aug 27, 2022 · 14 revisions

Fonts used by three-mesh-ui are MSDF fonts.

It comes with two files :

  • one JSON containing all the dimension information about the font
  • one PNG image containing a picture of each glyph, that will be used for SDF sampling in the font shader.

To create these files with a custom font of yours, use this online tool.

If you want your font to contain all the characters supported by the Keyboard component layouts, use this charset :

azertyuiopqsdfghjklmwxcvbnAZERTYUIOPQSDFGHJKLMWXCVBNéÉàÀèÈùÙëËüÜïÏâêîôûÂÊÎÔÛíÍáÁóÓúÚñÑłŁçÇýÝčČšŠæÆœŒ/\*-–+7894561230,;:!?¡¿.%$£€={}()[]&~"'‘’\`#_°@АаБбВвГгДдЕеЁёЖжЗзИиЙйКкЛлМмНнОоПпРрСсТтУуФфХхЦцЧчШшЩщЪъЫыЬьЭэЮюЯяüÜöÖäÄñÑςερτυθιοπασδφγηξκλζχψωβνμΕΡΤΥΘΙΟΠΑΣΔΦΓΗΞΚΛΖΧΨΩΒΝΜåÅæÆøØ

As this charset is large however, with most fonts you will have to get a larger PNG size than 256x256 pixels.