Update time: 2024-05-11
read-fonts | skrifa | ttf-parser | rustybuzz | ab_glyph | glyph_brush | fontdue | allsorts | swash | cosmic-text | |
---|---|---|---|---|---|---|---|---|---|---|
API Level | L | M | L/M | L | H | H | H | H | M/H | H |
Minimal Deps | ✓ | ✓ | ✓ | ✓ | ✓ | × | ✓ | × | ✓ | × |
No Std | ✓ | ✓ | ✓ | ✓ | ✓ | × | ✓ | × | × | × |
WASM | ✓ | ✓ | ✓ | ✓ | ✓ | × | ✓ | × | × | ✓ |
Tests | ✓ | ✓ | ✓ | ✓ | ✓ | × | ✓ | ✓ | × | ✓ |
Good Document | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | × | ✓ | × |
read-fonts | skrifa | ttf-parser | rustybuzz | ab_glyph | glyph_brush | fontdue | allsorts | swash | cosmic-text | |
---|---|---|---|---|---|---|---|---|---|---|
Loading | ✓ | read-fonts | ✓ | ttf-parser | ttf-parser | ttf-parser | ttf-parser | ✓ | read-fonts | swash |
Shaping | × | × | × | ✓ | × | × | × | ✓ | ✓ | rustybuzz or swash |
Layout | × | × | × | × | × | glyph_brush_layout | ✓ | × | × | ✓ |
Rasterize | × | × | × | × | ab_glyph_rasterizer | ab_glyph | ✓ | × | zeno | swash |
Note: that layout step is very depends on the info the shaping step gives. Layout API of one package may even do not accept shaping info if does not support shaping internally, so you can't glue two crates easily between those two step like other steps.
read-fonts | skrifa | ttf-parser | allsorts | swash | |
---|---|---|---|---|---|
Zero allocation | ✓ | ✓ | ✓ | ✓ | ✓ |
OpenType | ✓ | ✓ | ✓ | ✓ | ✓ |
TrueType | ✓ | ✓ | ✓ | ✓ | ✓ |
WOFF | × | × | × | ✓ | × |
WOFF2 | × | × | × | ✓ | × |
Variable | ✓ | ✓ | ✓ | × | ✓ |
Note1: fontdue uses ttf-parser for parsing font, but then builds a more convenient format from tables, which make allocations.
Note2: fontdue uses ttf-parser for parsing font, but do not provide an API to set variable axis, see fd#121.
Note3: cosmic-text uses swash for parsing font, but do not provide an API to set variable axis, see ct#4.
TODO: Complicated scripts? LTR, RTL?
TODO: Auto word break? Wierd screen shape?
- ×: means do not support a glyph data table.
- R: means only give raw image data, you need process it according to it's format.
- C: means only give curves, you need rasterize it.
- M: means render to bitmap array automatically, you can directly render it.
read-fonts | skrifa | ttf-parser | ab_glyph | fontdue | allsorts | swash | |
---|---|---|---|---|---|---|---|
glyf | R | C | C | M | M | C | M |
CFF | R | C | C | M | M | C | M |
CFF2 | R | C | C | M | M | × | × |
read-fonts | skrifa | ttf-parser | ab_glyph | fontdue | allsorts | swash | |
---|---|---|---|---|---|---|---|
EBDT/EBLC | R | R | M | M | × | M | M |
CBDT/CBLC | R | R | M | M | × | M | M |
read-fonts | skrifa | ttf-parser | ab_glyph | fontdue | allsorts | swash | |
---|---|---|---|---|---|---|---|
sbix PNG | R | R | R | R | × | R | M |
sbix JPEG | R | R | × | × | × | R | × |
sbix TiFF | R | R | × | × | × | R | × |
SVG | × | × | R | × | × | R | × |
read-fonts | skrifa | ttf-parser | ab_glyph | fontdue | allsorts | swash | |
---|---|---|---|---|---|---|---|
COLR/CPAL v0 | R | C | C | × | × | × | M |
COLR/CPAL v1 | R | C | C | × | × | × | × |
read-fonts | skrifa | ttf-parser | ab_glyph | fontdue | allsorts | swash | |
---|---|---|---|---|---|---|---|
TrueType Hinting | ✓ | ✓ | × | × | × | × | ✓ |
glyph_brush | cosmic-text | |
---|---|---|
Cache | glyph_brush_draw_cache | ✓ |
Output Type | Texture and draw coords | colored rectangles |