FontForge brand fonts: why changeWeight failed and offset outlines worked
Описание и применение
Скрипт на FontForge заменил встроенную функцию изменения веса на ручной отрисовку контуров с митровыми соединениями, что позволило сделать шрифты более жирными, но с острыми углами, соблюдая правила лицензии OFL.
Задача
Existing free fonts needed a slightly heavier version with sharp corners, but built‑in weight change produced poor results.
Результат
The offset‑outline method produced heavier, sharper fonts with minimal distortion, while the built‑in changeWeight failed.
Рабочий процесс
- Install FontForge Python bindings via apt
- Write 82‑line script to open source font, loop glyphs, modify outlines, rename, write .otf/.ttf, render specimen with Pillow
- Attempt v1: use glyph.changeWeight() with 3%/3.4% weight and tighten spacing
- Observe poor output: clogged counters, nicked terminals, letters kissing
- Implement v2: removeOverlap, stroke outline with circular pen, butt caps, miter joins, keep outer band, merge back, removeOverlap again
- Apply small weight (1%/2%) to preserve shape
- Add chamfer cuts to straight‑line corners meeting angle criteria
- Perform housekeeping: correctDirection, addExtrema, round, adjust side bearings
- Rename font properly, strip old name table entries, append license notice
- Ship modified font with full OFL 1.1 license file
- Deploy iC Volt on tech site and newsletter; C1 Cut not yet used
Доказательства
FontForge has a built‑in for this, glyph.changeWeight(). One call per glyph, give it a stroke amount, job done.
It just looked rubbish. The heavy Anton one clogged up, the holes in R, G and 8 nearly closed.
What I actually wanted was "the same letter, a bit fatter, corners still sharp".
v2 also uses way less weight: 1% of the em on C1 Cut, 2% on iC Volt.
Both source fonts are under the SIL Open Font License 1.1.
- Дата записи: 2026-10-22T09:11:13.752Z