Closed louisjanin closed 7 months ago
Hi @louisjanin thanks for reporting this issue and for sharing you're also using Robyn :)
What OS are you at? Can you share your R.version$os
? (Probably linux-gnu)
Also, notice /usr/share/fonts/
is included in the code to check the fonts, so that's why it gets fixed.
Would love for it to work for you but given I have no access to your OS, I can't debug for you. Would be great if you could help me with this.
On the other hand, FYI, to turn off this notification (it'll only pop once per session), you can set Sys.unsetenv("LARES_FONT")
.
I've just enabled a parameter called font_dirs
that can be passed to font_exists()
to test and to theme_lares()
as well. It looks out for custom directories (like yours: ~/truetype/msttcorefonts/) for fonts. Can you please try and see how it goes? Not sure it'll work for Robyn yet but this is a first step.
Indeed R.version$os is linux-gnu on my install Sorry I couldnt properly test font_dirs, does this not get the right latest version ?
remotes::install_github("laresbernardo/lares")
Here's what I get
> font_exists('Arial Narrow', font_dirs='/usr/share/fonts/truetype')
Error in font_exists("Arial Narrow", font_dirs = "/usr/share/fonts/truetype") :
unused argument (font_dirs = "/usr/share/fonts/truetype")
Yes, that's right. But you must refresh your R session before you load the latest version and retry.
> font_exists('Arial Narrow', font_dirs='/usr/share/fonts/truetype')
[1] TRUE
It works! Now I just do this and it seems to work fine :1st_place_medal:
library(Robyn)
lares::theme_lares(font_dirs="/usr/share/fonts/truetype")
Amazing, thanks for confirming.
Hi Bernardo,
I use Robyn for my company and tried to fix the warning "Arial Narrow not installed". I came accross the font_exists function from the lares package and I think my problem was that the font was installed but inside a nested directory. So what I did was copy it in /usr/share/fonts which fixed the problem for me:
So i just wanted to let you know, because maybe the function could look in subdirs.. Thanks and sorry for the not so well formatted issue...