gonum / plot

A repository for plotting and visualizing data
BSD 3-Clause "New" or "Revised" License
2.74k stars 203 forks source link

vg: streamline font handling #613

Closed sbinet closed 3 years ago

sbinet commented 4 years ago

611 (and its fix #612 ) uncovered the fact we have a bit of code rot in vg's handling of fonts (and especially locating fonts)

originally, vg would load ttf files according to a list of directories (vg.FontDirs, optionally seeded from $VGFONTPATH) with some default pre-packaged fonts under vg/fonts directory.

nowadays, vg/fonts doesn't hold any ttf files, just a regular Go package with []byte of the content of ttf fonts.

we should probably revamp or at least consolidate a bit how fonts are handled in gonum/plot.

sbinet commented 4 years ago

wrt fonts.Handler. perhaps have a look at what gioui is doing? e.g.