Thank you for the reply Josh,
I followed all the instruction to generate a report with R Markdown that can be downloaded through a shiny app.
When I work locally, inside the YAML of the .rmd file I write this code:
---
output:
pdf_document:
latex_engine: xelatex
header-includes:
- \usepackage{fontspec}
- \setmainfont{Times}
---
and I am able to download the report with the desired font. I need the “xelatex” engine to make the functions of the fontspec package working properly.
When I use this function locally, I don’t need any .otf file (normal and bold). Moreover, locally I can also not use the fontspec package and its main function “setmainfont”, because I can also just specify in the YAML mainfont{Times} and everything works again.
When I deploy the app online these functions don’t work.
Hence, I downloaded the .otf files for the Times font, I put them in the App folder of my shiny app (or a subdirectory) and I specified the path inside the YAML always using the fontspec package, this time through this code:
---
output:
pdf_document:
latex_engine: xelatex
header-includes:
- \usepackage{fontspec}
- \setmainfont[Path = \string~/inst/App/, BoldFont = TimesBold, Extension = .otf]{Times}
---
Again, this command works when I use the application locally, but not on the shinyapps.io server.
It seems that things work differently for a markdown report, because I can’t specify a path like I do for the files that I need in my shiny app (as dataset, modules, etc.).
Do you think I should try with the "." before the subdirectory? Thanks a lot.