2

I have a folder with all the .png emojis and I should compact them in a ttf file to flash it with magisk but I don't know how to create the .ttf file, how can I do?

Sarti
  • 21
  • 2
  • 1
    What platform(s) or apps do you want the font to work on? There are different formats for colour glyph data that can be used in .ttfs, and different platforms and apps support different subsets of those formats. – Peter Constable Jun 29 '21 at 15:23

1 Answers1

0

Ttfs can use color bitmaps, but (of course) they are not scalable: the bitmaps are intended for a particular size. The font can contain alternate bitmaps for different sizes; these size-specific sets of bitmaps are known as "strikes". If you have one set of .png images, that would comprise a single strike.

The OpenType font spec allows for two different table formats that can be used for colour bitmap glyphs: the 'sbix' table, and the 'CBDT' / 'CBLC' table combination. Different platforms and apps might support one, both, or neither. So, which format you use will depend on which targets you want to support. You can always create two variant fonts, one for each format; or you can also create a font that contains both 'sbix' and 'CBDT'/'CBLC' and let the app pick which it uses.

Btw, a further consideration will be whether to include B/W outlines corresponding to each colour glyph. If the target use is in a context where you know colour glyphs will always be supported, then you can get away without outlines. But for more widespread use, you might want to have B/W outlines as a fallback.

Some professional font development tools support 'sbix' and 'CBDT'/'CBLC' colour glyphs:

If you're familiar with Python and would prefer open source tools, check out fonttools.

Peter Constable
  • 2,707
  • 10
  • 23