neetly / figma-agent-linux

Figma Agent for Linux (a.k.a. Font Helper)
MIT License
157 stars 9 forks source link

SF Pro Regular is not being detected #39

Closed heysupratim closed 1 year ago

heysupratim commented 1 year ago

Thank you for making this wonder service. I thought installing SF pro for some of my figma designs should be relatively easy however, once installed on PoP OS 22.04. Figma lists all font variants except regular. Medium, Bold, Semibold every variant is listed perfectly but regular font weight is just missing.

I think its something to do with font matching that FontConfig is doing for that particular font weight.

latin-1 commented 1 year ago

Hi, could you please provide me the output of this command?

fc-list "SF Pro" : family style variable

Thanks.

heysupratim commented 1 year ago
SF Pro:style=Thin:variable=False
SF Pro:style=Light Italic:variable=False
SF Pro:style=Heavy:variable=False
SF Pro:style=Black Italic:variable=False
SF Pro:variable=True
SF Pro:style=Semibold Italic:variable=False
SF Pro:style=Black:variable=False
SF Pro:style=Regular Italic:variable=False
SF Pro:style=Thin Italic:variable=False
SF Pro:style=Bold:variable=False
SF Pro:style=Heavy Italic:variable=False
SF Pro:style=Ultralight:variable=False
SF Pro:style=Medium:variable=False
SF Pro:style=Light:variable=False
SF Pro:style=Ultralight Italic:variable=False
SF Pro:style=Regular:variable=False
SF Pro:style=Bold Italic:variable=False
SF Pro:style=Semibold:variable=False
SF Pro:style=Medium Italic:variable=False
latin-1 commented 1 year ago

There appears to be a bug in the variable font handling code. Variable font implementation is naive, and I haven't tested it against many files. Could you please send me a copy of that font file, if possible?

(I may add a config to completely disable the variable font support though.)

heysupratim commented 1 year ago

SF-Pro.zip

latin-1 commented 1 year ago

Please test the new version to see if the problem has been resolved. Thanks.

heysupratim commented 1 year ago

Absolutely wonderful. I saw you changed something to do with how you are de-serializing the font,would love to know what the issue was if you don't mind.

Btw let me tell you this, by porting this Figma font service and with this variable font service, you have literally made it possible for me to completely switch over to POP OS for daily driving and doing production UI design work. A big thank you for this wonderful work @latin-1 ❤️

latin-1 commented 1 year ago

I'm glad to hear that! cheers!

would love to know what the issue was if you don't mind.

Sure. I misinterpreted what index=0 meant in the fontconfig result. It should be the default instance rather than the first MM var instance. The default style name and all axes' default values should be used.