sfsymbols
sfsymbols copied to clipboard
sfsymbols.ArgumentParserError error 5.
% sfsymbols The operation couldn’t be completed. (sfsymbols.ArgumentParserError error 5.)
System: MacOS Big Sur/11 Device: Macbook Air 2018 Version: Latest
I have the issue also on macOS Catalina 10.15.4 and Xcode-12-Beta.
Same here on Big Sur and Xcode 12 Beta 2, looks like there's something amiss with Xcode 12.
Edit : I tried building with Xcode 11.5 on Big Sur, same issue (unless I missed something)
just install this https://developer.apple.com/design/downloads/SF-Symbols.dmg
just install this https://developer.apple.com/design/downloads/SF-Symbols.dmg
@IntZer0 thanks a lot for this, you got me on the right track !
So to all, the issue is actually the beta version of SF Symbols 2 that we likely had all installed (that one: https://developer.apple.com/design/downloads/SF-Symbols-2.dmg)
I'm pretty sure that when you install version 2, it uninstalls the first. I installed back the 1.1 version on top (it overrode the fonts, so the new symbols are gone and apparently so is the app launcher, not sure what happened here), but it works, so I guess there's something with the code and the fonts bundled with SFSymbols 2 ?
Also unless I'm mistaken, the fonts are supposed to be bundled this time with Big Sur (finally ! or is that just a symbol library and not the fonts ?) so there might be some interaction coming from here too.
I'm not 100% sure it's just the app fallback, because unless I messed up, I'm fairly sure I had tried specifying the font manually too and that failed also.
I also tried to recompile with a quick fix to use the SF Symbols beta bundle (it has a different bundle identifier, com.apple.SFSymbols-beta
) here :
https://github.com/davedelong/sfsymbols/blob/072b45330d885457a981b228924864e68d204e75/Sources/SFSymbolsCore/Font%2BDiscovery.swift#L53
But that didn't change a thing, so the argument issue is probably elsewhere.
So I had another look with SF Symbols 2 beta, with the code as is in the repo, we get the basic argument error thing but should really get "Unable to locate suitable SF Symbols font", it looks like the correct error while thrown is not surfaced correctly in the end (I'm not super familiar with how thrown errors are supposed to bubble up in Swift so not exactly sure how to fix that one sorry).
With the change I suggested above, we go past that, but quite frankly I'm neither familiar with fonts nor with the code so I'm not super clear why it hangs, @davedelong maybe you can have a look, here's what I found it may give you a head start:
- For SF-Symbols beta, the bundle is called
com.apple.SFSymbols-beta
(so doing the change above does help finding the "correct" bundle) - There is still the
SFSymbolsFallback.ttf
in Resources, and that is located correctly - As far as I understand, the code fails somewhere here :
https://github.com/davedelong/sfsymbols/blob/072b45330d885457a981b228924864e68d204e75/Sources/SFSymbolsCore/Font.swift#L111
I tried tracking it but I have quite frankly no idea what its doing, the code goes through once correctly and fails the second time.
My best guess is that the new SF Symbols 2 fonts have something different, maybe it's linked to the color thing, although I'm not 100% clear on how they have implemented colors. In any case, specifying the font manually probably won't help as it's the font loading that fails with the SF Symbols 2 fonts.
(and answering one of my previous questions from above, I still don't know if they are currently bundled with big sur, but if you install SF Symbols 1, you can still reinstall SF Symbols 2 and it will overwrite the fonts with the new ones).
Improved error output in PR https://github.com/davedelong/sfsymbols/pull/26.
I think it's failing to convert the symp data into a UTF8 string... but I don't know why. Maybe the decryption is failing @davedelong?
https://github.com/davedelong/sfsymbols/blob/master/Sources/SFSymbolsCore/Font.swift#L85
Edit: there's some more discussion here, suggesting that the glyph data is obfuscated before the AES encryption.
Wow, that's wild. Swimming upstream, huh?
Any news to support SF Symbols version 2.1?
Anyone got any ideas for exporting a handful of symbols as PNG? I'm on macOS 11 + SFSymbols 2.1 so I'm hitting the sfsymbols.ArgumentParserError error 5
. I've got about 40 symbols I want to export, so doing them by hand in Illustrator isn't sounding fun. I've seen people suggest using Figma but TBH I am not sure how to do that either.
@luckman212 and others who need a workaround today: Download the SF Symbols v1. During the installation, install to your home directory so the SF Symbols 2.1 in /Applications doesn't get overwritten. (Alternatively you could probably rename the 2.1 before installing 1.0) Now you can use:
sfsymbols --font-file ~/Applications/SF\ Symbols.app/Contents/Resources/SFSymbolsFallback.ttf