Can Unicode.Scalar.Properties include info on SFSymbols?

SFSymbols are unicode characters. Can Unicode.Scalar.Properties include info about SFSymbol? Such as:

isSFSymbol: Bool
sfSymbolName: String?
isSFSymbolMonochrome: Bool
isSFSymbolMultiColor: Bool

I believe you should use Apple's feedback assistant for enhancement request.

That said,

I believe this is untrue. Where do you read it from? They seem to be using Unicode's PUA. I'm not sure checking for properties in such region is advisable.

I thought because SE-0211 Add Unicode Properties to Unicode.Scalar, so this belong here. There should be some way in Swift to access additional OS specific Unicode properties in "Supplementary Private Use Area", I think.

Are there nothing Apple specific in Swift? It seems a lot of Foundation is only available under Apple OS's. Adding Apple only features in Swift is allowed, right?

Actually, you're right. Unicode belongs to standard library, not Foundation. So this would belong to Evolution->Pitch at the very least. Though it's also linked to SFSymbol, so kinda hard to say.

It's hard to say. Foundation is actually Obj-C (well, with strong interop, it doesn't matter all that much). It evolves independently from Swift and doesn't follow Swift Evolution.

That said, I'm more worried that the API will misinterpret the symbols. Other than Xcode (and TextEdit, oddly enough), I don't see other apps that treat those characters as SFSymbols.

1 Like

These aren't "OS-specific" properties; SF Symbols is an icon framework implemented as a font, and its use of the PUA is specific to that font and presumably subject to change at any time.

You can certainly request Apple to add APIs for SF Symbols, but they wouldn't have anything to do with the Swift open source project, nor could they. (After all, it's called a Private Use Area for a reason.)

5 Likes

Foundation features available only on Apple platforms are proprietary to Apple and not a part of the Swift open source project.

It works pretty much everywhere in macOS: Terminal, Feedback Assistance, Notes app, Pixelmator Pro

But Apple seems to explicitly not render these glyphs in iOS for some stupid reason.

They cannot change as these glyphs are inside the family of SF fonts and being used already. "Private" in this case here doesn't mean "I can break thing". It's an Apple established/public standard.

Of course they can. The same PUA code point can be repurposed for SF Symbols 2, if Apple so chooses.

2 Likes