How buttaiwan/writemyfont works
Project type and purpose
• This is a single-page, client-side font-drawing tool (“FontDrawer”) built with HTML5 Canvas and JavaScript.
• It supports Traditional Chinese and Japanese interfaces and persists in-progress work in IndexedDB.
File structure
• Top level:
• pages/ — static assets (HTML, CSS, JS) served to the browser.
• brushes/ — (presumably custom drawing brushes or presets).
• glist/ — offline tools/scripts and data for generating character lists (Ruby and JavaScript scripts plus text tables).
• .github/, .prettierignore, ChangeLog.md, LICENSE, README.md.
• Static pages:
• index.html, ja.html — UI shells for different languages.
• style.css — shared styling.
• fontdrawer.js (in pages/) — core drawing and font-gen logic.
• potrace.js, pressure-drawing.js, cglyphlist.js, jglyphlist.js — supporting scripts loaded by pages.
• No server-side code — fully client-side with build/deploy via static hosting.
README for additional insights
• Architecture is implicit:
• Canvas drawing component
• IndexedDB persistence
• Vectorization pipeline (raster → SVG via potrace.js)
• Font packaging pipeline (SVG → glyph outlines → OTF via opentype.js)
• Offline glist/ folder is a generator for character list inputs.
Elements
• User input → Canvas → IndexedDB
• Canvas output → potrace.js → SVG paths → opentype.js → Font blob → Download
• Offline data files → glist scripts → output JS → served to UI
• UI components (light blue)
• Data-transformation pipeline (orange)
• Persistence/storage (green)
• Offline tooling (grey)
Detailed capture of essential elements
• External libraries (potrace.js, opentype.js) as labeled modules.
• If desired, annotate protocols/APIs (e.g., Canvas API, IndexedDB API, Blob API).