gregory
gregory

Reputation: 431

How to add a custom font to an ExtJS app?

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!

Upvotes: 4

Views: 2484

Answers (1)

Sergey Novikov
Sergey Novikov

Reputation: 4196

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.

Upvotes: 2

Related Questions