Languages

Menu
Sites
Language
How do I use a custom font in my application?

I'm using the Tizen for Wearable IDE and running my app on a Gear 2 Neo. 

I've got the font files in my proejct. 

I have them defined in the CSS like below.

I have the font-family properly defined for the text in the CSS.

But it won't load the font.  Anyone know why? 

 

@font-face {

    font-family: 'TradeGothicLTStd';

    src: url('../font/TradeGothicLTStd-BdCn20/tradegothicltstd-bdcn20.eot');

    src: url('../font/TradeGothicLTStd-BdCn20/tradegothicltstd-bdcn20.eot') format('embedded-opentype'),

         url('../font/TradeGothicLTStd-BdCn20/tradegothicltstd-bdcn20.woff') format('woff'),

         url('../font/TradeGothicLTStd-BdCn20/tradegothicltstd-bdcn20.ttf') format('truetype'),

         url('../font/TradeGothicLTStd-BdCn20/tradegothicltstd-bdcn20.svg#TradeGothicLTStdBoldCondensedNo.20') format('svg');

}

View Selected Answer

Responses

5 Replies

Are you going to use the font on Canvas ?

Mark as answer
Thijs Mergaert

Hi,

Something that I've noticed is that to change fonts, often you need to add '!important' to your CSS rule to prevent it from being overruled by later rules.

For example:

body {
    font-family: 'MyFont' !important;
}

Hope that helps.

Thijs

Michał Macioła

Pin: Is there any list of fonts natively provided by Tizen Os?

Marco Buettner

Tizen OS includes by default only Tizen Sans

Phil rzr

I listed other fonts at :

https://wiki.tizen.org/wiki/User:Pcoval/Notes#EFL_.2F_Fonts