Domanda

I found this link on how to embed custom fonts in XAML apps. Is there some way I can achieve the same while building using JS? The following method did not work.

@font-face {
    font-family: "MimicRoman";
    src: url("/fonts/MimicRoman.otf") format('opentype');
}
È stato utile?

Soluzione

Looks ok to me, that's how it should work. You are sure the path to the font file is correct and you did also actually use the font-face somewhere? For instance,

body {
    font-family: MimicRoman;
}

Also, you are sure there are no other font-family declarations taking precedence over the declaration you've made? (this can be seen quite easily with the DOM Explorer).

If nothing else works, you might want to test some other font file, just in case that file is corrupt or something (some working examples from here, for instance).

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top