adobe-type-tools / opentype-svg

Tools and sample files for making OpenType-SVG fonts
MIT License
212 stars 17 forks source link

Feature request: One folder for all outputs #24

Closed davidgodzsak closed 1 year ago

davidgodzsak commented 3 years ago

It would be nice to have a flag to save all the svg files to the same output folder instead of adding the nested folder.

Using the letter describing the glyph is impossible as some operating sysems are case insensitive: a.svg and A.svg are the same.

I have 2 possible suggestions:

  1. postfix the letter name with the character code (e.g. with unicode it would be something like this A_U0041.svg, a_U0061.svg) automatically (CMAP could be used for this)
  2. pre or postfix the letters that are not unique if lowercased (e.g. --prefix-non-uinque lower_ would produce lower_a.svg)
miguelsousa commented 3 years ago

I like the idea.

Option 1 won't work because not all glyphs are encoded; a font with a.alt and A.alt glyphs would fail.

I think we could just use FontTools' userNameToFileName method, which essentially adds an _ (underscore) after each capital letter.

davidgodzsak commented 3 years ago

I will make a PR next weekend