/material-icons

Simple Swift package for Material Icons on macOS

Primary LanguageSwiftMIT LicenseMIT

MaterialIcons

Simple Swift package for Material Icons. We currently support only macOS 10.13 or higher. Include it via SwiftPM and use as follows

import MaterialIcons

let bookIcon = Icon.book.asImage(
  dimension: 320,
  padding: 12,
  style: .filled,
  color: .black,
  backgroundColor: .white
)

Please note that due to bundled font resources, you need at least SwiftPM 5.3. The bundled fonts in the package were downloaded from fonts.googleapis.com.

The font loading code is a slightly modified version of thii/Fontawesome.swift.

Generate Icons from ijmap

Execute the generate script as follows

$ ./bin/generate_icons.py \
    --input-file ./Sources/MaterialIcons/MaterialIcons-Regular.ijmap
    --output-file ./Sources/MaterialIcons/Icon.generated.swift