Skip to content

Fonts

Overview

The SDK handles fonts via the M2ResourcesService (accessed from Evs.resourcesService).

Font resources are uploaded from the application to the glasses over BLE and bound to text drawables for rendering.

Font Format

Maverick AI uses SIF2 (System Independent Font 2) format for on-board text rendering. Standard font files (TTF, OTF, WOFF) must be converted to SIF2 before uploading.

Stock Fonts

The SDK includes built-in stock fonts for common use cases, accessible via M2FontResource:

  • M2FontResource.fontSmall - 22px height
  • M2FontResource.fontMedium - 44px height

Limitations

Constraint Value
Maximum font data size 48 KB (per resource)
Maximum active font slots 24 (including 2 reserved for stock fonts)

Converting Fonts - font2sif2.py

The font2sif2.py tool converts standard fonts to SIF2 format. It can be found in the SDK repository.

Basic usage:

# Convert a TTF font at size 36, 2 bits per pixel
python3 font2sif2.py --path MyFont.ttf --size 36 --bpp 2

# Convert with larger size and higher quality
python3 font2sif2.py --path MyFont.otf --size 48 --bpp 4

# Convert specific character ranges (e.g. ASCII + extended Latin)
python3 font2sif2.py --path MyFont.ttf --size 28 --ranges 0x0020:0x00FF

Options:

Flag Default Description
--path (required) Input font file (TTF, OTF, WOFF)
--size 36 Pixel height
--bpp 2 Bits per pixel for glyph rendering (1, 2, 4, or 8)
--ranges 0x0020:0x007E Unicode character ranges to include (hex START:END)
--exclude - Hex character codes to exclude
--norender - Skip preview image generation

How it works:

  1. FreeType renders each glyph at the requested pixel size.
  2. Glyph bitmaps are quantized to the target BPP depth.
  3. All glyphs are packed into a single SIF2 binary file with a header, range metadata, character info table, and bitmap data.
  4. Optional RLE compression is applied to reduce size.

Output files:

  • <font>.<height>x<width>.<bpp>bpp.sif2 - the binary font file for the glasses
  • <font>.<height>x<width>.<bpp>bpp.json - metadata (character map, metrics)
  • <font>.<height>x<width>.<bpp>bpp.png - optional visual preview of all glyphs

Requirements: Python 3, numpy, freetype-py, Pillow.


See Also