Skip to content

Instantly share code, notes, and snippets.

@nwillc
Created December 29, 2021 17:09
Show Gist options
  • Save nwillc/04656cacae7725f87a835d8d987bb04b to your computer and use it in GitHub Desktop.
Save nwillc/04656cacae7725f87a835d8d987bb04b to your computer and use it in GitHub Desktop.
func readBitmaps(embedFs embed.FS, path string) Font {
files, err := embedFs.ReadDir(path)
if err != nil {
panic(err)
}
toFontRuneKV := func(f fs.DirEntry) (rune, FontRune) {
return toCharName(f.Name()), toFontRune(embedFs, path, f.Name())
}
return genfuncs.Associate(files, toFontRuneKV)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment