wch / extrafont

Tools for using fonts in R graphics
315 stars 48 forks source link

call loadfonts in .onAttach() #17

Closed jrnold closed 11 years ago

jrnold commented 12 years ago

It seems weird that loadfonts needs to be called everytime extrafont is used. It seems that loadfonts should be a natural side-effect of loading the package, and should only have to be called if new fonts are imported during a session.

I defined .onAttach to call loadfonts for all the relevant devices; this required adding some packages to depends. Something else needs to be done in order to suppress, or provide a way to suppress messages.

This may be a bad idea for reasons that I haven't considered, but if it can be done, it seems like the kind of outcome I'd expect as a user.

wch commented 11 years ago

Thanks! Rebased and merged in c6a76f5. I also made the output a bit quieter.