Documentation
¶
Overview ¶
Package symbols draws the platforms' own icon sets: SF Symbols on iOS, and Google's Material Symbols on Android. Each icon is named per platform, since the two sets name things differently.
nimbus native plugin add symbols
nimbus native font add -name "Material Symbols Rounded" MaterialSymbolsRounded.ttf
symbols.Symbol{IOS: "cup.and.saucer.fill", Android: "local_cafe", Size: 28, Label: "Coffee"}
iOS has SF Symbols built in. Android has no named icon set, so it draws Material Symbols from the font, which you download from Google Fonts (github.com/google/material-design-icons, under variablefont/) and add as above. For the same icon on every platform and the web, ui.Icon is built in.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var AndroidFont = "Material Symbols Rounded"
AndroidFont is the family name the Material Symbols font was added under. Use "Material Symbols Outlined" or "Material Symbols Sharp" for those styles.
Functions ¶
This section is empty.
Types ¶
type Symbol ¶
type Symbol struct {
IOS string // an SF Symbol's name, such as "heart.fill"; empty draws nothing on iOS
Android string // a Material Symbol's name, such as "favorite"; empty draws nothing on Android
Size float32 // points; 0 means 24
Color ui.Color // the theme's text color when 0
Weight uint16 // 100..900, like FontWeight; 0 means 400
// Label is what screen readers say. On iOS, empty leaves the icon out
// for them, as for one beside text that says the same. On Android the
// icon is text, so empty says its name: "local cafe".
Label string
}
Symbol is one icon.