lionel- / fontquiver

Set of fonts with permissive licences
Other
17 stars 1 forks source link

How to add new fonts w/o needing to change this package? #8

Open bhaskarvk opened 7 years ago

bhaskarvk commented 7 years ago

If I want to add more fonts, I need to create a fontXYZ package similar to fontBitStreamVera and then fork this project and add corresponding functions. This seems counter intuitive. It would be better if this package provides functions, that font packages can hook into, so that we can create font packages w/o needing to make changes every time to fontquiver pacakge. Or I am completely missing something very obvious.

lionel- commented 7 years ago

fontquiver exports fontset_register() so other packages can provide their own fonts. I think you only need to register a fontset getter function, i.e. fontset_xyz(), and a fontset data structure. The easiest way is probably to take https://github.com/lionel-/fontquiver/blob/master/R/fontset-liberation.R as a template.

bhaskarvk commented 7 years ago

Awesome, I was probably confused because of files fontset-bitstream-vera.R in this package, as opposed to the fontBitStreamVera package. This led me to believe that if I want to add some more fonts I'll probably have to do the same. Good to know that I can add more fonts w/o touching this package.

lionel- commented 7 years ago

hmm I should probably export the font constructors (e.g. sans() etc). In the mean time you can just copy them over in your package (from the file fontset.R).

bhaskarvk commented 7 years ago

Cool thanks. I'll keep this open for your reference.