Skip to content

Commit

Permalink
style: cleanup and format
Browse files Browse the repository at this point in the history
  • Loading branch information
eligao committed Aug 1, 2023
1 parent cf9b9e8 commit 1884209
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

from LETTERS import LETTERS

FONT_SIZE = 650
FONT_FILE = 'assets/三极隶书简体.ttf'

OUTPUT_DIR = 'dist'
Expand All @@ -18,8 +17,6 @@
os.makedirs(SMALL_SUBDIR, exist_ok=True)
os.makedirs(LARGE_SUBDIR, exist_ok=True)

CANVAS_SIZE = 1000


def main() -> None:
i = 0
Expand All @@ -32,7 +29,7 @@ def main() -> None:
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 @@ -43,7 +40,7 @@ def main() -> None:
glyph.draw(tpen)
pen.closePath()
path = pen.getCommands()

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

0 comments on commit 1884209

Please sign in to comment.