「‍」 Lingenic

「‍」 Lingenic Compose: Lettering In Development

Western stroke-based font format

GitHub: lingenic-compose-lettering · lingenic-compose-pen-path

The .lettering format defines Western fonts as sequences of pen strokes. Unlike outline fonts (TrueType, OpenType) which store filled contours, lettering fonts store the tool paths — the motion of a pen creating each glyph.

Format Overview

.font-begin MyFont
  units-per-em 1000
  ascender 800
  descender -200

  .circular-pen-begin mono
    diameter 40
  .circular-pen-end

  .glyph-begin A U+0041
    advance-width 650
    stroke mono 50,0 ⏤ 325,750 ⏤ 600,0
    stroke mono 150,250 ⏤ 500,250
  .glyph-end

.font-end

Font Metrics

PropertyDescription
units-per-emDesign units per em (typically 1000)
ascenderHeight above baseline
descenderDepth below baseline (negative)
cap-heightHeight of capital letters
x-heightHeight of lowercase x

Pen Definitions

Define pens before using them in glyphs. Three pen shapes supported:

Circular Pen

.circular-pen-begin mono
  diameter 40
.circular-pen-end

Elliptical Pen

.elliptical-pen-begin broad
  width 60
  height 20
  angle 30
.elliptical-pen-end

Rectangular Pen

.rectangular-pen-begin chisel
  width 50
  height 10
  angle 45
.rectangular-pen-end

Glyph Definition

.glyph-begin A U+0041
  advance-width 650
  left-bearing 50
  stroke mono 50,0 ⏤ 325,750 ⏤ 600,0
  stroke mono 150,250 ⏤ 500,250
.glyph-end
PropertyDescription
advance-widthHorizontal advance after glyph
left-bearingSpace before glyph starts
strokePen stroke path
fillFilled path (for enclosed shapes)

Path Symbols

SymbolUnicodeMeaning
U+23E4Straight line segment
U+2312Smooth curve (Hobby's algorithm)
U+2220Corner / inflection point
U+21BBClose path to start
U+2300Diameter at point (variable width)
U+2221Direction constraint
U+2299Tension modifier

Examples

Simple I

.glyph-begin I U+0049
  advance-width 300
  stroke main 150,100 ⏤ 150,700
.glyph-end

Curved O

.glyph-begin O U+004F
  advance-width 700
  stroke main 350,0 ⌒ 700,350 ⌒ 350,700 ⌒ 0,350 ↻
.glyph-end

Variable Width

.glyph-begin n U+006E
  advance-width 550
  stroke main 100,0⌀40 ⏤ 100,500⌀40 ⌒ 250,500⌀30 ⌒ 400,350⌀40 ⏤ 400,0⌀40
.glyph-end

Kerning

.kerning-begin
  AV -80
  VA -80
  To -40
  Ty -40
.kerning-end

pen-path Primitives

The lettering format builds on the pen-path crate which provides:

Curves use Hobby's algorithm for smooth splines through points.