Created
December 29, 2021 17:06
-
-
Save nwillc/da04c592a9dc3d0888d8856972a8fe57 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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