Massimo Variolo
Massimo Variolo

Reputation: 4777

load custom font into html (webview) - metro app

I'm working on a metro app: c# and xaml. The app loads a html file (stored in a directory) into a webview with its css file. I want to use a custom font: how can I accompish that?

I've tried

@font-face {
    font-family: 'Geeza_Pro';
    src: url('ms-appx-web:///Fonts/Geeza_Pro.ttf') format('truetype');
    }


#div_name{
    font-size:30px;
    font-family: "Geeza_Pro";
}

and

@font-face {
    font-family: 'Geeza_Pro';
    src: url('Fonts/Geeza_Pro.ttf') format('truetype');
    }


#div_name{
    font-size:30px;
    font-family: "Geeza_Pro";

but is doesn't work!

Upvotes: 2

Views: 933

Answers (1)

Tommaso Belluzzo
Tommaso Belluzzo

Reputation: 23675

@font-face /* Define New Font */
{
    font-family: coolfont; /* Assign Font Name */
    src: url('fonts/coolfont.ttf'); /* Font File Location */
}

#div_name
{
    font-family: coolfont;
}

Upvotes: 1

Related Questions