Skip to content

Instantly share code, notes, and snippets.

@nwillc
Last active December 29, 2021 02:33
Show Gist options
  • Save nwillc/3ed017bd70cf8250e4163328c1d6e689 to your computer and use it in GitHub Desktop.
Save nwillc/3ed017bd70cf8250e4163328c1d6e689 to your computer and use it in GitHub Desktop.
func toFontRune(fs embed.FS, fontName string, name string) FontRune {
txt, err := fs.ReadFile(fontName + "/" + name)
if err != nil {
panic(err)
}
var lines = genfuncs.Slice[string](strings.Split(string(txt), "\n")).
Filter(hasData)
return [][]bool(genfuncs.Map(genfuncs.Map(lines, toRuneSlice), toPixelSlice))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment