Skip to content

Instantly share code, notes, and snippets.

@nwillc
Created December 29, 2021 17:06
Show Gist options
  • Save nwillc/da04c592a9dc3d0888d8856972a8fe57 to your computer and use it in GitHub Desktop.
Save nwillc/da04c592a9dc3d0888d8856972a8fe57 to your computer and use it in GitHub Desktop.
func readBitmaps(fs embed.FS, path string) (Font, error) {
runes := make(map[rune]FontRune)
files, err := fs.ReadDir(path)
if err != nil {
return nil, err
}
for _, file := range files {
r, err := toFontRune(fs, path, file.Name())
if err != nil {
return nil, err
}
name, err := toCharName(file.Name())
if err != nil {
return nil, err
}
runes[name] = r
}
return runes, nil
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment