-1
NSFont *fontRef = [NSFont fontWithName:@".SFNS-Light" size:20];

Above line of code used to work just fine but now it is not working in Catalina. I am getting nil for fontRef. .SFNS-Light stills show as available Fonts. Interesting enough it is still working for

[NSFont fontWithName:@"Arial" size:size];

Anyone experience this issue? What is the best way to resolve it?

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62

1 Answers1

1

Your code was always wrong. It is illegal and unsupported to specify by name a font whose name begins with a dot, like your fontWithName:@".SFNS-Light". If the goal is to use the system font, ask for the system font.

matt
  • 515,959
  • 87
  • 875
  • 1,141