4

I've got problem with polish signs in shinydashboard. When I'm using just shiny everything is ok, but in shinydashboard ą and ę are written in different font. I've tried to change encoding of a document, but it didn't help. I don't really know how to deal with it... Could you help me?

My code:

library("shiny")
library("shinydashboard")

ui <- dashboardPage(
    dashboardHeader(),
    dashboardSidebar(),
    dashboardBody(h1("przejścią"))
)

server <- function(input, output) { }

shinyApp(ui, server)

And visualisation of my problem:

enter image description here

Marta
  • 3,032
  • 3
  • 17
  • 34
  • 1
    Have you tried open in google chrome? Sometimes the rstudio builtin browser is not that good to render fonts and images. – jbkunst Mar 08 '16 at 14:22
  • @jbkunst, yes, I've tried and it still doesn't work... – Marta Mar 08 '16 at 14:23
  • You can try to manipulate with locale https://stat.ethz.ch/R-manual/R-devel/library/base/html/locales.html. For me setting locale to "Polish" helped. – zuku Mar 08 '16 at 14:30
  • 1
    @zuku, I've added `Sys.setlocale("LC_ALL", "Polish")` and `Sys.setenv(LANG = "POLISH_POLAND.UTF-8")`, but it didn't help. – Marta Mar 08 '16 at 14:41
  • 4
    It's probably due to the font used by `shinydashboard` (Source Sans Pro), you could try with another font: `dashboardBody(tags$style(HTML("h1 {font-family: Arial;}")),h1("przejścią"))` – NicE Mar 11 '16 at 13:37
  • @NicE, thanks! It really works. Do you know how to change font in the whole dashboard, not only in the `h1` header? – Marta Mar 14 '16 at 07:25
  • Maybe have a look here https://github.com/vnijs/radiant/issues/25 – Pork Chop Mar 14 '16 at 08:50
  • 1
    These [answers](http://stackoverflow.com/questions/10041706/applying-a-single-font-to-an-entire-website-with-css) should work to set the font for the whole website. – NicE Mar 14 '16 at 11:34

0 Answers0