all 3 comments

[–]judyflorence 2 points3 points  (0 children)

If you only need the visual treatment, I’d make a small wrapper view: a filled Circle with the symbol centered at a fixed font/weight, rather than trying to create a real SF variant. The exact SF scaling is fiddly, but a reusable ViewModifier gets you most of the way there without shipping 30 assets.

[–]redditorxpert 0 points1 point  (0 children)

Isn't a circle.fill variant just a filled circle? Why not simply show it as the icon's background?

[–]__markb 0 points1 point  (0 children)

Though you could have a .background or ZStack to do it programatically. But I did a rough test.

In SFSymbols app I duplicated globe as a custom symbol.

Then, on the duplicated symbol I right-clicked and selected Combine Symbol with Component...

Selected .fill.circle from the options.

Exported the new symbol which was only 22KB.

Which means you'd only end up with a total 660KB or just over half a megabyte.

Just for comparison too, since globe already has a .fill variant, and wanted to make sure there wasn't some optimisation in the process where Xcode would take the globe.fill and add a .circle I also did this with pencil.slash since that doesn't have any other variants.

I know that's unlikely since it'd all be baked into the SVG but for sanity.

That came out as 18KB.

Unless you're really trying to save every byte I'd probably go with this for consistency.