--force-fast-kern-format - always use more fast kering storage format,
at cost of some size. If size difference appears, it will be displayed.
--lcd - generate bitmaps with 3x horizontal resolution, for subpixel
smoothing.
--lcd-v - generate bitmaps with 3x vertical resolution, for subpixel
smoothing.
--use-color-info - try to use glyph color info from font to create
grayscale icons. Since gray tones are emulated via transparency, result
will be good on contrast background only.
--lv-include - only with --format lvgl, set alternate path for lvgl.h.
Per font:
--font - path to font file (ttf/woff/woff2/otf). May be used multiple time for
merge.
-r, --range - single glyph or range + optional mapping, belongs to
previously declared --font. Can be used multiple times. Examples:
-r 0x1F450 - single value, dec or hex format.
-r 0x1F450-0x1F470 - range.
-r '0x1F450=>0xF005' - single glyph with mapping.
-r '0x1F450-0x1F470=>0xF005' - range with mapping.
-r 0x1F450 -r 0x1F451-0x1F470 - 2 ranges.
-r 0x1F450,0x1F451-0x1F470 - the same as above, but defined with single -r.
--symbols - list of characters to copy (instead of numeric format in -r).
--symbols 0123456789., - extract chars to display numbers.
--autohint-off - do not force autohinting ("light" is on by default).
--autohint-strong - use more strong autohinting (will break kerning).
Additional debug options:
--no-compress - disable built-in RLE compression.
--no-prefilter - disable bitmap lines filter (XOR), used to improve
compression ratio.
--no-kerning - drop kerning info to reduce size (not recommended).
lvgl - format for LVGL, C file. Has minor limitations and a bit
bigger size, because C does not allow to effectively define relative offsets
in data blocks.
dump - create folder with each glyph in separate image, and other font
data as json. Useful for debug.
Merged font metrics
When multiple fonts merged into one, sources can have different metrics. Result
will follow principles below:
No scaling. Glyphs will have exactly the same size, as intended by font authors.
The same baseline.
OS/2 metrics (sTypoAscender, sTypoDescender, sTypoLineGap) will be
used from the first font in list.
hhea metrics (ascender, descender), defined as max/min point of all
font glyphs, are recalculated, according to new glyphs set.
Development
Current package includes WebAssembly build of FreeType with some helper
functions. Everything is wrapped into Docker and requires zero knowledge about
additional tools install. See package.json for additional commands. You may
need those if decide to upgrade FreeType or update helpers.
This builds image with emscripten & freetype, usually should be done only once:
npm run build:dockerimage
This compiles helpers and creates WebAssembly files: