如何在ExtJS应用程序中添加自定义字体? [英] How to add a custom font to an ExtJS app?
问题描述
同事!
请提出建议,如何为ExtJS添加自定义字体,以便将其与应用程序一起加载,以防用户未在系统中安装该字体?>
必须将其加载到哪个文件夹,以及在何处以及如何将其包含?
谢谢您的回答!
您可以简单地将新字体文件添加到 myApp \ resources \ fonts
并将相应的CSS规则添加到 sass \ etc \all.scss
(由于scebotari66)喜欢
@ font-face {字体家族:Pragmatica;src:url(fonts/Pragmatica.ttf)format('truetype');}
如果在ExtJS上传文件之前需要字体,则可以将CSS规则添加到自定义文件夹(例如 myApp \ resources \ css \ app.css
),并包含 app.css
在 myApp \ index.html
中,例如< link rel ="stylesheet" type ="text/css" href ="resources/css/app.css"> 代码>.它与Sencha CMDs
sencha应用程序构建
一起很好地工作.
colleagues!
Please suggest, how to add a custom font to ExtJS so, that it would be loaded together with the applicaton, in case the user doesn't have this font installed in his system?
What folder must it be loaded to, and where and how should it be included?
Thank you for answers!
You can simply add new font files to myApp\resources\fonts
and add corresponding CSS rules to sass\etc\all.scss
(thanks to scebotari66) like
@font-face {
font-family: Pragmatica;
src: url(fonts/Pragmatica.ttf) format('truetype');
}
If you need your font before ExtJS upload its files you can add CSS rule to custom folder like myApp\resources\css\app.css
and include app.css
within myApp\index.html
like <link rel="stylesheet" type="text/css" href="resources/css/app.css">
. It works well with Sencha CMDs sencha app build
.
这篇关于如何在ExtJS应用程序中添加自定义字体?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!