问题
I'm using fontawesome icons throughout my Shiny app via the icon function.
I've downloaded the pro version of fontawesome, and used the instructions here: shinydashboard some Font Awesome Icons Not Working to replace the free version that Shiny is using by default (inside shiny\www\shared\font-awesome
) with my paying version. This works very well locally, and all the pro icons show in my app.
However, when I deploy to shinyapps.io
, it seems like Shiny goes back to using the default version. I did try including my pro directory inside the /www/
folder of my app, but without success. Seems like there is no way to tell the icon()
function to look at a local version of fontawesome, something like icon(...,lib=local)
, or icon(...,lib=path_to_fa)
...
Any help would be very welcome.
回答1:
The trick was, inside the htmlDependency call (in icon()
function), to remove package = "shiny"
and replace "www/shared/fontawesome"
by the absolute path to my FA folder (I also updated the version number).
来源:https://stackoverflow.com/questions/55163719/r-shiny-how-to-use-fontawesome-pro-version-with-the-icon-function