SF Symbols on macOS

Is there a way to access the library of SF Symbols on macOS with a declare?

I see you can access them on iOS with the IOSImage.SystemImage method so I’m wondering if anyone has a workaround for getting them on macOS.

1 Like

Not a solution, but I already created a Feedback Case for this: <https://xojo.com/issue/60751>. Add some points if you want.

1 Like

Done. 75 points added.

Also, Feedback links don’t work in the forum :frowning:

2 Likes

After a little digging I found a temporary solution.

You can use this command line tool to export all the symbols to PNG and then use them as a regular image. Not as elegant as getting them at runtime but it’ll do until I can figure out a better way…

Another potential (but certainly not ideal) method is to copy and paste them anywhere text is used. I have been able to use them as symbols in SegmentedButtons to form a custom toolbar.

Catalina:

Big Sur:

This has the advantage of looking very native on both Catalina and BigSur, and it seems to play well with DarkMode and Retina resolutions.

2 Likes

This, I treat them just like I did Emoji when they were supported but were harder to type. Just copy paste them and the style should travel along and show the proper icon.

It also means they take zero space, as they’re calling the system font rather than a bunch of PNGs or even an embedded font.

I have an article scheduled on this for my shiny new weblog :slight_smile:

4 Likes

Awesome!

Where’s that high five emoji…

1 Like

How do you find the text codes for these icons? Did you just use macOS’s own “Show Emoji & Symbols” viewer? Those are not the new SF symbols, though, right? (SF Symbols appear to not be available on macOS, I read elsewhere).

Does this help @Thomas_Tempelmann?

That doesn’t explain how @William_Koperwhats accomplished to use SF symbols on older macOS versions.

Or is your app only working on 10.15+, William? Or do you require that users install the SF font via Apple’s app?

Licensing issues aside - can you install SF Symbols on Windows or Linux systems? Is it just a font? I’m curious as you can paste them into the IDE.

I have created a tool to use them everywhere i need so I have a consistent UI on any platform

1 Like

Is this a tool you’re willing to share?

That’s right Thomas, the app will only run correctly on 10.15+.

Yes. But before I have to make it ready for general use, now is made for my own approach :slightly_smiling_face:

1 Like

Are there any updates on using SF Symbols on MacOS?

Blog Post

EDIT: Sorry, I thought this had made it over to Desktop. Guess not. I think @Sam_Rowlands has it in his App Kit. You can find more info here.

1 Like

There’s this article https://ohanaware.com/blog/202048/Preparing-your-Xojo-made-Mac-App-for-Big-Sur---part-4.html

Which talks about using a new API I added to the App Kit, which allows you to specify a SF Symbol on 10.16 and a image name for use on older versions of the macOS.

If you don’t have the Ohanaware App Kit, you can also use the SF Rasterizer in App Wrapper 4 to convert the symbols to multi-representation tiff files, so they work on a much larger range of OS versions. One of the last betas of AW4 added an option to resample the SF Symbols on rasterization, which makes them clearer on a low-dpi screens than Appe’s original symbols.

1 Like

Oh and before I forget…

The SF Symbols app, makes it easy to copy a symbol and use it anywhere you can paste text, labels graphics and so on. But they won’t draw unless the typefaces are installed on the users computer, so using the image routines is the safest way. Which is disappointing, because I’ve hoped for years that Apple would enable some symbols to be used in labels and such.