Skip to content

Commit

Permalink
chore: comments
Browse files Browse the repository at this point in the history
  • Loading branch information
eligao committed Jul 31, 2023
1 parent 128b980 commit cf9b9e8
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,15 @@
def main() -> None:
i = 0
font = TTFont(FONT_FILE)
# transform fonts, fixing size and upside-down
# see: https://github.com/fonttools/fonttools/issues/2388
unitsPerEm = font['head'].unitsPerEm
ttf2em = transform.Identity.scale(1/unitsPerEm, 1/unitsPerEm)
svgPerEm = 700
xform = transform.Identity.translate(
(1000-svgPerEm)/2, svgPerEm).scale(svgPerEm, -svgPerEm).transform(ttf2em)
glyphSet = font.getGlyphSet()

for letter in LETTERS:
i += 1
pen = SVGPathPen(glyphSet)
Expand All @@ -41,6 +44,7 @@ def main() -> None:
pen.closePath()
path = pen.getCommands()

# TODO: extract to function
dwg = svgwrite.Drawing(
f'{SMALL_SUBDIR}/{i:03d}_{letter}.svg', size=(100, 100))
dwg.viewbox(0, 0, 1000, 1000)
Expand Down

0 comments on commit cf9b9e8

Please sign in to comment.