问题
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