How to add a custom font to an ExtJS app?

喜欢而已 提交于 2021-02-08 19:31:32

问题


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!


回答1:


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.



来源:https://stackoverflow.com/questions/46462193/how-to-add-a-custom-font-to-an-extjs-app

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!