📚 Encyclopedia

Games & Graphics · updated 2026-10-13

Turning a photo of handwriting into an OpenType font (Python pipeline)

fontsopentypefonttoolspotraceimage-segmentationpythonflutter

Justin photographed an alphabet drawn with a Sharpie and asked for it as a font he could write TLDR posts in. The result, "TLDR Marker", is a CFF-flavored OTF built entirely with Python (fontTools + potracer), no FontForge or ImageMagick. Version 1.0 had 61 glyphs from one photo; later photos added lowercase and symbols for full printable ASCII (104 glyphs). The pipeline is committed and rebuildable (tool/font/ in the TLDR repo).

Stage 1: segment the photo (segment.py)

Stage 2: build the font (build_font.py)

Gotchas

Using it in a Flutter app

Declare it under fonts: in pubspec.yaml. Missing characters fall back per character to the default font. TLDR applies it only inside the editor (readers see the normal font) by wrapping the editor in DefaultTextStyle.merge; see flutter_quill rich-text editor gotchas (markdown, IME, spell check, fonts).

Linked from

Sources: tldr memory (feature-compose-font), posts #1533, #1548, #1735