shiny에서 글꼴 지정

Written by

in

역시 코파일럿과 함께.

shiny는 /srv/shiny-sever가 기본 디렉토리이다. 그 하위에 www라는 폴더를 만든다.

글꼴 파일을 복사하고, 다음과 같은 css 파일을 생성한다.

font-face {
  font-family: 'D2Coding';
  src: url('D2Coding-Ver1.3.2-20180524.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
}

body {
  font-family: 'D2Coding', monospace;
}

app.R에서 다음 부분을 추가한다.

ui <- navbarPage(
...
header = tagList(
  includeCSS("www/style.css")
),
...