typemytype / batchRoboFontExtension

25 stars 9 forks source link

[ds5] Suffixes #70

Open ryanbugden opened 1 year ago

ryanbugden commented 1 year ago

Example path of some output: .../_batch_generation/Variable/otf-woff/Test_Display-VF_otf.woff2

Questions:

  1. Should this suffix be a default in the settings: variableFontsSuffix="-VF", but output without a suffix if the user removes this suffix in the settings?
  2. Folder names: a. Should the folder names be like otf-woff2 to reflect the new file-type? b. Should all folder names be all-caps like OTF WOFF2 to reflect the UI?
  3. Should the _otf suffix (presumably to clarify the type of woff2) only be placed on the file name if Export in Subfolders is False?
LettError commented 1 year ago

The naming of the variable font file can be stored in the designspace. Could be something to use, if it is present in the file?

typemytype commented 1 year ago

if there is no variableFonts entry in the designspace file fontTools designspaceLib makes up a name of all possible interpolable subdesignspaces see https://github.com/fonttools/fonttools/blob/main/Lib/fontTools/designspaceLib/__init__.py#L3246

the "-VF" suffix starts there... Batch should already use those variableFont names if they are available

in operator it happens here https://github.com/LettError/ufoProcessor/blob/master/Lib/ufoProcessor/ufoOperator.py#L250

typemytype commented 1 year ago
  1. will pushed soon
  2. yeah maybe, adding the format of the woff file (otf, ttf) suffix happens here https://github.com/typemytype/batchRoboFontExtension/blob/ds5/Batch.roboFontExt/lib/batchGenerators/batchTools.py#L283 its necessary to make a different path when both otf woff and ttf woff are exported in the same directory, Im fine with mapping the ext to opentype and truetype like the css @font-face format
typemytype commented 1 year ago

for 2. see ec48490d8e91f07ea95794699b8ddee2c8da8663

ryanbugden commented 1 year ago

Sounds good on all three items! Thanks for the push on #2.

I ran into a couple of additional file naming issues with variable fonts specifically:

  1. Re: https://github.com/typemytype/batchRoboFontExtension/issues/70#issuecomment-1729679370, regardless of my choice here, the Batch generates with the name, not filename from my <variable-font> table in the designspace file. This might be related: https://github.com/fonttools/fonttools/issues/3308

    image
  2. The suffixes set in Batch Settings for Desktop and Web seem to work, but the suffixes added in the Variable section of settings don't get applied to variable fonts.