Last active
December 29, 2021 02:33
-
-
Save nwillc/3ed017bd70cf8250e4163328c1d6e689 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 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