Css shinyapps.io闪亮应用程序中的Custum字体
我正在尝试从本地.ttf文件添加custum字体,然后将其部署到shinyapps.io中 在我的应用程序目录中,我有一个www文件夹,其中包含“font.ttf”和一个style.css,如下所示:Css shinyapps.io闪亮应用程序中的Custum字体,css,shiny,shinydashboard,shinyapps,Css,Shiny,Shinydashboard,Shinyapps,我正在尝试从本地.ttf文件添加custum字体,然后将其部署到shinyapps.io中 在我的应用程序目录中,我有一个www文件夹,其中包含“font.ttf”和一个style.css,如下所示: @font-face { src: url(www/font.ttf); font-family: "font.ttf"; } /* main header */ .skin-blue .main-header .logo { font-family: "mexecellent"
@font-face {
src: url(www/font.ttf);
font-family: "font.ttf";
}
/* main header */
.skin-blue .main-header .logo {
font-family: "mexecellent";
font-size: 12px;
}
然后我将它包含在我的闪亮应用程序中,如下所示
tags$head(includeCSS("www/style.css"))
但是,文本字体没有变化
我非常感谢您的帮助。我会尝试:
@font-face {
src: url(font.ttf);
font-family: myfont;
}
/* main header */
.skin-blue .main-header .logo {
font-family: myfont;
font-size: 12px;
}
经过大量研究,我发现这是一个关于浏览器兼容性和css语法的问题 有效的代码是
@font-face {
font-family: 'mexecellent';
src: url('mexcellent.ttf') format('truetype'),
url('mexcellent.woff') format('woff');
}
正如在这个回答中所建议的那样