Closed pat-s closed 4 years ago
Thanks @pat-s ... You're right, a single google_font()
wasn't handled properly by extra_fonts
and I fixed this in xaringanthemer@dev
. In that branch you should be able to use
extra_fonts = c(font_url1, font_url2)
extra_fonts = list(google_font(font_name1), google_font(font_name2))
extra_fonts = list(font_url1, google_font(font_name1))
I don't think I handled the edge case of accidentally concatenating a URL and a google_font()
-- e.g. extra_fonts = c(font_url, google_font(font_name))
-- and I'll look into adding that.
extra_fonts = c(font_url, google_font(font_name))
so many edge cases - I guess no one would expect that to work OOB. But great effort as always :rocket:
so many edge cases
So true! So many that I realized I mistyped in my answer, google_font()
only takes one font, but you can put multiple google fonts into a list()
.
Help page
However, other font arguments such as "text_font_google" and friends accept a single font only (which makes sense). Though if one specifies a single font only for "extra_fonts", not
is parsed into the resulting CSS but only
The latter results in the font not being available.
Suggestion: Either support only a list for
extra_fonts
or also support singlegoogle_font()
calls.(I know these are the ugly details of a package that comes with functions that have so many args... :smile: )