Skip to content

Instantly share code, notes, and snippets.

@huachaohuang
huachaohuang / asterisk.py
Last active June 15, 2025 06:43
Use fontforge to center the asterisk in a font
import fontforge
def center(c):
return (c.boundingBox()[1] + c.boundingBox()[3]) / 2
def transform(input, output):
font = fontforge.open(input)
plus = font["plus"]
asterisk = font["asterisk"]
asterisk_shift = center(plus) - center(asterisk)