Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for SF Symbols 4 #107

Closed
fredpi opened this issue Jun 6, 2022 · 13 comments
Closed

Support for SF Symbols 4 #107

fredpi opened this issue Jun 6, 2022 · 13 comments
Labels
enhancement New feature or request

Comments

@fredpi
Copy link
Member

fredpi commented Jun 6, 2022

As can be seen here, there will be a new version of SF Symbols: SF Symbols 4. Currently, the SF Symbols 4 app isn't available to download, but it probably won't last long until we learn all about it.

This issue can be used to collect ideas / track progress on the SF Symbols 4 support.

@fredpi fredpi added the enhancement New feature or request label Jun 6, 2022
@fredpi
Copy link
Member Author

fredpi commented Jun 16, 2022

I updated

  • layerset_availability.plist
  • name_aliases_strings.txt
  • name_availability.plist
  • symbol_names.txt
  • symbol_previews.txt

from / using the SF Symbols 4 Beta app and regenerated the code. Fortunately, everything went fine, so there's now experimental v4 support: experimental/4.0-support.

I think there are no changes / new features in SF Symbols 4 that require an adaptation of our generator code; but correct me, if I'm wrong.

We just need to update symbol_restrictions.strings and symbol_restrictions_missing.strings. @Stevenmagdy I noticed there's no documentation on how to update them; if I remember correctly you retrieved them from the OS, right? Maybe we can add a file to the Resources folder which describes how to update these two files.

@fredpi
Copy link
Member Author

fredpi commented Jun 16, 2022

Okay, there is one minor issue:

In the localization_availability.plist, there is an entry square.3.layers.3d.down.forward.slash.rtl, but not an entry for the "base variant" square.3.layers.3d.down.forward.slash. In the SF Symbols app, therefore, the symbol is not shown at all. And indeed, it doesn't exist in the OS (causing a crash). Still, SFSafeSymbols assumes that square.3.layers.3d.down.forward.slash must exist. Same goes for square.3.layers.3d.down.backward.slash.

This can be fixed by making the generator tool ignore localizations if the base variant symbol is not listed in the localization_availability.plist. To avoid conflicts, let's wait until #106 is merged before implementing this. Implementing this fix is also a good first issue, if someone is interested.

@fredpi fredpi added the good first issue Good for newcomers label Jun 16, 2022
@fredpi
Copy link
Member Author

fredpi commented Jul 19, 2022

I pushed a new commit with the new symbol restrictions file from Xcode 14 Beta. Thanks @Stevenmagdy for documenting the information where to find it (via #108).

Interestingly, the Xbox and PS symbols introduced in SF Symbols v3 are now also restricted despite not representing Apple products:

This symbol may not be modified and may only be used to refer to Microsoft’s Xbox.

This symbol may not be modified and may only be used to refer to Sony’s PlayStation.

@fredpi
Copy link
Member Author

fredpi commented Jul 21, 2022

To avoid conflicts, let's wait until #106 is merged before implementing this. Implementing this fix is also a good first issue, if someone is interested.

As #106 is now merged, this can now be implemented. I think it's a good first issue, so if someone wants to contribute to this repository, this is a good starting point. If nobody wants to do it, I'll do it before the v4 release.

@fredpi fredpi pinned this issue Jul 21, 2022
@fredpi fredpi removed the good first issue Good for newcomers label Aug 20, 2022
@fredpi
Copy link
Member Author

fredpi commented Aug 20, 2022

I have now fixed the issue mentioned above myself.

@fredpi
Copy link
Member Author

fredpi commented Sep 16, 2022

The 4.0.0 release is now available: https://github.com/SFSafeSymbols/SFSafeSymbols/releases/tag/4.0.0

@fredpi fredpi closed this as completed Sep 16, 2022
@Angelk90
Copy link

@fredpi : You know if there is a way to request to add specific symbols.
For example the one for git, I found this: https://github.com/cameronshemilt/MoreSFSymbols#developer

But it would be nice to have them officers.

@StevenSorial StevenSorial unpinned this issue Nov 6, 2022
@StevenSorial
Copy link
Member

StevenSorial commented Nov 6, 2022

@Angelk90 SFSafeSymbols is only meant for the native symbols and not for symbols included in the assets. For your use case, I would recommend extending UIImage itself:

extension UIImage {
	static let git = UIImage(named: "git")!
}

imageView.image = .git

You can get that automatically using SwiftGen or R.swift

@Angelk90
Copy link

Angelk90 commented Nov 6, 2022

@Stevenmagdy : In fact I say how can I apply to add it as a native symbol?

@StevenSorial
Copy link
Member

StevenSorial commented Nov 7, 2022

@Angelk90 Unfortunately you really can't add native symbols. Even the linked repo couldn't:

It is important to note that you do not use the SFSymbols initialiser (eg. systemName:), but rather the initialiser for images from your assets.

This from their README and in their Usage section you will find Image("symbol.name"), which is the initialiser for the image assets.
SFSafeSymbols just make using the native symbols more convenient and safe, it doesn't add any new symbols.

@vakhid-betrakhmadov
Copy link

vakhid-betrakhmadov commented Dec 25, 2022

Hello ✋

@fredpi, could you please refer me to an explanation on how the files in SymbolsGenerator/Resources are generated, or maybe possibly explain ? Thank you.

@fredpi
Copy link
Member Author

fredpi commented Dec 25, 2022

@vakhid-betrakhmadov This is documented in the 'Updating to a new SF Symbols version' section of the CONTRIBUTING.md. I hope this answers your question – let me know, if you need further help :)

@vakhid-betrakhmadov
Copy link

vakhid-betrakhmadov commented Dec 26, 2022

@fredpi , many thanks 🙏, that answers my question

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants