arrowtype / recursive

Recursive Mono & Sans is a variable font family for code & UI
https://recursive.design
SIL Open Font License 1.1
3.29k stars 53 forks source link

Font style-linking is broken on macOS because "cursive" substring is in family name - FIXED by macOS 11 šŸŽ‰ #153

Closed thundernixon closed 4 years ago

thundernixon commented 5 years ago

UPDATE: I've tested various workarounds to determine the source of this issue. Test files and instructions to reproduce this are available at https://github.com/arrowtype/recursive/tree/master/docs/ribbi-style-linking-macOS (permalink).

Problem

Regular-Italic style isn't currently working in Recursive, as of v1.037 statics (as well as in earlier versions).

Examples

Kapture 2020-02-09 at 14 22 11

Questions to answer

Extra context

In some code themes, italics are very important.

However, it is surprisingly difficult to make sure a font displays with italics, as expected.

image

Test

These static fonts work

image

image

These do not work

image

image

image

Differences

arrowtype commented 4 years ago

This issue is still a problem. :/

As an example: in VS Code, if I set the preferred font to nameID 1 or 16 ("Recursive Mono Casual Static"), the result is all-Italic (whereas I expect Regular with Italic comments, etc, as works with other fonts). If I use the postscript nameID 6 ("RecursiveMonoCslSt-Regular"), I can get the Regular, but no Italic comments.

The following images are using the Night Owl theme, and should have a mix of roman & italics:

image

image

How the theme should look (this uses IBM Plex Mono, in which style-linking does work):

image

I've also tried fiddling with fsSelection (it seemed that Regular had bit 9 set, "contains oblique glyphs"), but that seemingly doesn't have an effect on my issue.

The Style Map Family Name & Style Map Style Name in a way that should be working well, but it's still showing issues.

One thing that may be related is that often, there are issues where the Regular is treated as if it were an italic. For example, when I set text and then change it to Recursive, it will often be italic off the bat. And then, if I change it to an upright of Recursive, then into another font, it will be italic. So, clearly it seems that something is telling my mac that the Italic style is the "regular," but it's hard to say what might be doing that. The "Italic" name is everywhere I expect it to be in the TTX.

arrowtype commented 4 years ago

Ohhhh my god. I am fairly certain that the problem was that "Recursive" contains the substring cursive. I have heard that in the past, a font containing the substring ita would set off a similar issue.

However, if I change the font name to be simply "Arrowtype", things work just fine:

image

Further proving this theory: family names "xcursivex" and "Discursive" also suffer from the same issue:

Kapture 2020-02-09 at 15 15 18

Kapture 2020-02-09 at 15 16 29

benkiel commented 4 years ago

To chime in: this comes from how MacOS handles style-linking as a combination of weight values, fsSelection bits, and custom heuristics. I have run into this mastering MVBā€™s Solitaire, as it contains ita (bug filed with Apple, 14928748, was marked as a dupe on Oct. 15, 2014). This started happening after 10.4.11 for ita and appeared in 10.6-10.8. It is fixed in 10.14 at least (I can't recall when exactly it got fixed).

MacOS seems to be doing the same thing, marking Recursive italic because of cursive in the name. The only fix is to either change the name or wait for the heuristic to be updated/fixed.

giovanicascaes commented 4 years ago

Could you please tell how to rename the fonts?

arrowtype commented 4 years ago

@giovanicascaes please see https://github.com/arrowtype/recursive/tree/master/docs/ribbi-style-linking-macOS for a script and description of my process

arrowtype commented 4 years ago

@giovanicascaes are you hoping to get these for coding? If so, let me know and I can put together some. :) I still have to figure out a better strategy for a public release, but I can make some specific workaround fonts in the meantime.

giovanicascaes commented 4 years ago

Yes, it is for coding. I was checking this repo almost daily for a fix :)

arrowtype commented 4 years ago

Woah! Thanks for your patience, and sorry it took so long to find a fix/workaround. As you can probably guess, undocumented OS heuristics based on the font name itself is not something we expected to be the blocker, here. šŸ˜…

I've made some workaround fonts and posted them at https://github.com/arrowtype/recursive/tree/78c4432a8fa2f600d67131021afa0f6f67dd08a2/fonts_1.037/rec_mono-for-code

For convenience, here's a zip download with these fonts: rec_mono-for-code.zip

To get these working, install them as usual, then quit & restart your code editor. Potentially, you may need to restart your computer for font updates to take effect, but usually not in a case like this, where the family names are changed. Let me know if you have any issues getting these working!

giovanicascaes commented 4 years ago

Yeah, it is an unexpected issue, maybe some macOS legacy. It must be truly difficult to track such a problem.

Thank you very much for your promptness. Already using the new builds, they work perfectly!

Wondering how can I give some feedback to you guys. Maybe the only thing I can tell you right now is that a semicursive italic variant, like Operator Mono or Dank Mono one's, would be very appreciated, since these are very popular typefaces, much of it because of that feature. Of course, it would be a lot of work, tough.

arrowtype commented 4 years ago

Great, thanks for letting me know that itā€™s working!

a semicursive italic variant, like Operator Mono or Dank Mono one's, would be very appreciated

Thanks! In my view, this is already the case ā€“ almost all lowercase letters have specifically semi-cursive variants in the Italic styles. A single-story /a, long /f, simplified /i, /l, and /r, outstrokes on /n, /h, /s, etc. Of course, the italics donā€™t look cursive to the same degree because it doesnā€™t include things like the looped /l and /f and the scripty /r and /a. This is for two main reasons:

  1. I donā€™t want to make something that already exists. Operator is a great design, and Iā€™m not trying to compete with it or make a free alternative, but rather to make something original and unique.
  2. To me, the ā€œcursiveā€ forms donā€™t seem as immediately readable and they donā€™t work that well within this design, aesthetically (especially due to the Linearā€“Casual axis). Iā€™ve tried drawing them, and I just donā€™t think it looks that good.

Still, Iā€™m not 100% against the idea, and it could potentially be the sort of thing added into a stylistic set or even a forked version. But, yes, it also becomes a factor of time: in the near term, I need to finish the project and do other work. In the long term, I may change my mind and add them in.

(Iā€™ll probably copy this explanation into a different issue, to keep things clean).

davelab6 commented 4 years ago

Iā€™ve tried drawing them, and I just donā€™t think it looks that good.

I'm curious what these sketches look like :) No worries if they were not good enough to share with anyone outside your house though XD

madig commented 4 years ago

Consider renaming the font to "Rekursiv" :grin:

arrowtype commented 4 years ago

@madig itā€™s not such a bad idea ... Iā€™d have to test that it didnā€™t trigger the same bug, though. šŸ˜„ The name is nice, it has good letters, itā€™s meaning is still fairly clear, it sounds sophisticated, and the linear styles do have a little bit of DIN influence in them...

I could also translate to another language. In Danish, the word is ā€œRekursive.ā€

But, my main idea is staying the course and keeping the name overall, but abbreviating it to ā€œRec Mono/Sansā€ for downloads.

ā€œRecursiveā€ works fine on the web. For local fonts, there are secondary benefits to shortening the name (fitting into MS Word menus better, for one). Plus, Iā€™m guessing that most coders will have a better chance of remembering the English spelling than the German spelling.

Though, hmm. Most people will probably download it directly from Google Fonts, and they may not be able to use custom naming rules on the backend when generating static downloads from variable fonts. So, that puts me back to maybe changing the name, after all.

@davelab6 do you have a suggestion one way or the other?

nickshanks commented 4 years ago

"Recurs" might work. I would avoid "Rekursiv" because the heuristics probably cover multiple languages and/or are localised when the OS gets translated.

arrowtype commented 4 years ago

I would avoid "Rekursiv" because the heuristics probably cover multiple languages

That's a good point ā€“ it does seem like that might be a big (and hard to predict) risk.

phineasfrogg commented 4 years ago

This is still an issue as of 12 July 2020. Is there a way for us to rename the files so we can use them correctly? I know the Rec Code files exist, but I want to be able to use the proportional Casual variant in Mac apps without these italic style-linking problems. I'm not experienced enough with Python to build the fonts from scratch. The collection files that the release versions come in can't be opened in Glyphs.

benkiel commented 4 years ago

Hey @phineasfrogg, there isn't anything we can do to fix MacOS, though version 11 seems to fix this. I'll defer to @arrowtype about making re-named proportional set, like the Rec Code set.

arrowtype commented 4 years ago

Thanks @phineasfrogg and @benkiel!

Yes, by my testing of the first beta for macOS 11, this is fixed, thankfully. But, I know that isn't very helpful today.

Yes, this could hacked around with a small addition to release scripts, using FontTools to edit font names in a variant for macOS 10 with the family name set as "Rec" or "Rekursive" (this would need testing, though). The hard part is that the release downloads are already pretty confusing, and this would add another layer of directly included. And, this is hard to prioritize over other issues. I partly didnā€™t change the font name in order to maybe give Apple a nudge to fix this issue for other fonts (no idea if this influenced them or not). But, now that it is fixed, I would be okay making a hacked version if only to link to it from this issue.

I will try to fit this in in the next few days, and update here if I can!

phineasfrogg commented 4 years ago

@arrowtype Thank you so much!

I'm glad to know that Apple has fixed the problem in Big Sur, and look forward to using the final versions there. In the meantime, I'd be happy with a hacked version if you have the time to do that.