Languages

Menu
Sites
Language
Font - how hook on to the project

Here wrote that we can Use a custom font in wearable/mobile web applications.

 I tried and  got not any success

css

#content-text {
    font-weight: bold;
    font-size: 15em;
    font-family: "AlexiaFont";
    src: url('AlexiaFont.ttf')
}

 

index

 

<body>
    <div id="main" class="page">
        <div class="contents">
            <span id="content-text">Basic</span>
        </div>
    </div>
</body>

"AlexiaFont" is in Root

 Can anyone  say how do it?

Responses

3 Replies
André Reus

You need to load the font using @font-face in the css. And must store the ttf file along with the css file from where you are loading it. 

@font-face{
    font-family: "My-Font";
    src: url('AlexiaFont.ttf');
}


#content-text {
    font-family: My-Font;
    font-weight: bold;
    font-size: 15em;
}

Put the ttf file in the css folder if your style.css is in the css folder. Or if you put your style.css in root, you can put your ttf file in the root. 

Kilim A

I will    try it and answer

André Reus

Did you try it ? @Kilim A