Domanda

I've a program written in python3 gtk webkit, and would like to start using some fonts in the CSS and HTML files. I see fontsquirrel creates four different types of fonts, and the CSS for them.

Now I'm not sure, but I believe that different font types are just for cross browser compatibility? And I can't upload compiled files so I would like to just use the SVG format of the font file.

I believe the CSS for this would be just be:

@font-face {
    font-family: 'comfortaaregular';
    src: url('font/comfortaa-regular-webfont.svg#comfortaaregular') format('svg');
    font-weight: normal;
    font-style: normal;

}

And then I think I could just set a useragent inside of the program that is most compatible with SVG formats.

So my question is, first off all is my assumption correct, and if so what useragent will work best with SVG, and second of all how compatible will this method be with other peoples computers.

È stato utile?

Soluzione

You can see the global support of SVG fonts here.

As you can see, only WebKit-based browsers (Chrome, Safari, Opera the most known) support that kind of format. The usage is simple:

@font-face {
  font-family: ‘comfortaaregular’;
  url(‘comfortaaregular.svg#comfortaaregular’) format(‘svg’);
}

If you plan to support other browsers and agents (like IE's Trident) you will have to add other formats.

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