🧩 Background
FONT_MAP in lib/svg/generator.ts maps shorthand keys to full CSS font stacks. As more fonts are added, keeping it in the generator inflates an already large file.
🎯 Objective
Move FONT_MAP and font-resolution logic into lib/svg/fonts.ts and re-export it from generator.ts.
📁 Files to touch
lib/svg/generator.ts
lib/svg/fonts.ts (new)
🛠️ Implementation steps
- Create
lib/svg/fonts.ts exporting FONT_MAP and a resolveFont(font?: string): string | null helper.
- Import and use in
generator.ts.
- Add unit tests for
resolveFont covering predefined, dynamic, and invalid inputs.
✅ Definition of done
🧩 Background
FONT_MAPinlib/svg/generator.tsmaps shorthand keys to full CSS font stacks. As more fonts are added, keeping it in the generator inflates an already large file.🎯 Objective
Move
FONT_MAPand font-resolution logic intolib/svg/fonts.tsand re-export it fromgenerator.ts.📁 Files to touch
lib/svg/generator.tslib/svg/fonts.ts(new)🛠️ Implementation steps
lib/svg/fonts.tsexportingFONT_MAPand aresolveFont(font?: string): string | nullhelper.generator.ts.resolveFontcovering predefined, dynamic, and invalid inputs.✅ Definition of done
generator.tsno longer contains the font map.resolveFontis unit-tested.