MuTsunTsai / fontfreeze

Freeze variations and features in font.
https://mutsuntsai.github.io/fontfreeze/
MIT License
117 stars 1 forks source link

Suggestion: Read the font family from the font #5

Closed th-bu closed 1 year ago

th-bu commented 1 year ago

Currently we can only use 4 font styles with this tool: Regular, Italic, Bold, Bold Italic.

It would be good if the tool could just read the font style from the uploaded font instead of having the user to select one of the four.

This is not that critically as I'm currently fine with the default ones but there are many fonts like Cascadia Code/Mono and JetBrains Mono that have different styles like Light, Semi Bold etc..

MuTsunTsai commented 1 year ago

This is related to #3, where I explained that the 4 styles are actually in the specs. So the best I can do is to detect that the font name has one of the 4 in it.

kenmcd commented 1 year ago

Use the Typographic Family (Name ID 16) and Typographic Subfamily (Name ID 17) instead. This is what the users are expecting. And with modern fonts these names are already there. These Typographic names should be what fills-in automatically.

Users do not know or understand the style-linking of Font Family name (Name ID 1) and Font Subfamily name (Name ID 2). Those names are also already in the font so you can also add those automatically. Either visible separately or not visible in the interface, (or in an optional panel).

Focus should first be on Typographic Name/Subfamily automatically from the font. And then Font Family/Subfamily from the font, or simply derived behind the scenes.

The current way is confusing, and backwards.

P.S. You could make it possible for those who know what they are doing to create their own RIBBI style groups by putting the Font Family/Subfamily settings on an advanced panel.

MuTsunTsai commented 1 year ago

@kenmcd Glad we have an expert here! Unfortunately I'm in fact quite a novice on the subject and I'm not sure if I completely understand what you mean. Just to make sure that I don't get the message wrong, could you help me with a complete example as for what I should be filling into each name ids? Also I have no idea what RIBBI is, could you also explain? Thanks.

P.S. Oh I get the last one now. Regular/Italic/Bold/Bold Italic.

kenmcd commented 1 year ago

The safest thing to do is read all the name fields from the font as is. As suggested in the original post above. Otherwise the fonts may not work as expected in different applications. Some applications use the Typographic Family/Subfamily - Affinity Publisher, InDesign, etc. Some applications use the Font Family/Subfamily - MS Word, LibreOffice, etc. And different programming editors may use either. Allowing users to change only some of the fields may cause issues when using different applications, and export to PDF, etc. So the safe bet is to use all the original name fields.

I like the ability to add a suffix to the family name such as "Freeze", but you need to be careful with a couple of things. First, you could go over the 32 character limit on the Font Family (Name ID 1) used by MS Word. Second, all the relevant names should be changed to add the suffix - Typographic Family, Font Family, Full Font Name, Unique Font Name, PostScript Name (used in PDFs), etc. - or there could be unexpected issues.

The FontSquirrel Web Font Generator Expert tab allows the user to set the Font Name Suffix in an input field - you may want to do something similar. See here: https://www.fontsquirrel.com/tools/webfont-generator Select Expert button and see bottom of page. (note: Expert mode also does OpenType feature "flattening.")

So the safest, and easiest, thing to do is use all the name fields in the original font. If you add a suffix, it needs to be added in multiple name fields.

MuTsunTsai commented 1 year ago

Alright then. I'm a little busy lately, but I will handle this as soon as possible.

MuTsunTsai commented 1 year ago

OK I think I've done all that @kenmcd suggested. See if this works.

MuTsunTsai commented 1 year ago

I will assume the issue is fixed and close it. Feel free to reopen it if needed.

th-bu commented 1 year ago

So, I just tried the new version with JetBrains Mono 2.304 and the font it generates works as expected in Rider and VS Code.

Notepad++ only shows the regular weight in the list, but I have no idea why. You can still access bold and italic/bold italic with the checkboxes but not the thin or light variants. Programs that use the default Windows file dialog have no problem selecting the other weights though. And even though VS Code and Rider have there own methods for selecting fonts I can access all weights there.

So I guess it's a quirk of Notepad++ and I wouldn't worry too much about it.