go-figure icon indicating copy to clipboard operation
go-figure copied to clipboard

PrintFonts for visualization purposes

Open mh-cbon opened this issue 6 years ago • 0 comments

hi,

small func i had to write that might be added to the package


func PrintFonts(dst io.Writer, phrase string) {
	fonts, _ := figure.AssetDir("fonts")
	for _, f := range fonts {
		f = strings.TrimSuffix(f, ".flf")
		myFigure := figure.NewFigure(phrase, f, true)
		fmt.Fprintf(dst, `> %v
%v
`, f, myFigure)
	}
}

mh-cbon avatar Jul 02 '19 12:07 mh-cbon