Scale is a way for you to adjust your symbols to be a bit larger or smaller, but keep the stroke, baseline, and weight the same as your font. SymbolScale ) ScaleĪs mentioned before, each symbol is also available in three scales: small, medium, and large. Init (pointSize : CGFloat, weight : UIImage. You can pick the one that suit your case. The following are all available options you have. You can also configure SF Symbols with other metrics like point size, weight, scale, and text style. Top: Bold system font of size 24, Bottom: Ultralight system font of size 60Īs you can see, the circular stroke and baseline have matched the weight of the font. The following example shows how SF Symbols adapt to the font it configured with. Let image = UIImage (systemName : "book.circle", withConfiguration : configuration ) I think the most straight forward and precise approach is to configure SF Symbols with a font. We can tell SF Symbols the context of the adjacent text that we want to use with the symbol by passing in a new class, SymbolConfiguration, to UIImage. We would want some way to match this symbol with a font we use. Since SF Symbols are mean to work with a text, the above example might not utilize the full potential of it. SwiftUI: Image (systemName : "book.circle" ) Swift: UIImage (systemName : "book.circle" ) We can initialize it with a new UIImage initializer. We will talk about this in the Scale section SF Symbols are available in a wide range of weights and scales How to use SF Symbols?Īpple treats SF Symbols as an image. It comes in nine weights - from ultralight to black - to match a weight of the San Francisco system font.Įach symbol is also available in three scales: small, medium, and large. It designs to work along with their text. SF Symbols was introduced in WWDC 2019 to work as icon sets (or symbols as Apple called it) to work along with their SF family. Apple keeps developing more and more typeface afterward, e.g., SF Compact Rounded, SF Pro Rounded, SF Mono, and New York. San Francisco (SF) is the name of the Apple typeface that was first released for the watchOS (SF Compact) and later to macOS, iOS, and iPadOS (SF Pro). Sponsor and reach thousands of iOS developers.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |