How to render Segoe UI font in different navigators and OS's

前端 未结 3 625
别跟我提以往
别跟我提以往 2021-02-06 17:16

I have some web applications that follow metro style of the Microsoft (ie.: new outlook). But I\'m having troubles with the fonts that I used. The default font is \"Segoe\" fam

3条回答
  •  日久生厌
    2021-02-06 17:51

    First of all there are difrent types of fonts for every browser. To make sure that it will work in every browser You need to put at least 3 types: eot, ttf, woff (and svg). The best way to get those is to use one of the links: http://www.fontsquirrel.com/fontface/generator, http://fontface.codeandmore.com/

    It's very simple and You will get a set of ready to use fonts. After downloading Your set You will find the example file where You will see how to use Your new fonts.

    In Your case it can be like:

    @font-face {
        font-family: 'Segoe';
        src: url('/font_path/Segoe.eot');
        src: url('/font_path/Segoe.eot?#iefix') format('embedded-opentype'),
             url('/font_path/Segoe.woff') format('woff'),
             url('/font_path/Segoe.ttf') format('truetype'),
             url('/font_path/Segoe.svg#Segoe') format('svg');
        font-weight: normal;
        font-style: normal;
    }
    

    /font_path/ is the relative path to your fonts according to this css file. Usually it's ../fonts/.

    Why You need all those?

    ttf, otf - for: FireFox, Chrome < 6, Safari and Opera

    oet - for: Internet Explorer < 9

    svg - for: Safari Mobile (iPhone, iPad for iOS < 4.2), Android browser

    woff - for: Internet Explorer >= 9, FireFox >= 3.6, Chrome >= 6

    Segoe.eot - and others are links (relative in this case) to those font files.

    EDIT

    Because fontsquirrel.com don't render some fonts, andfontface.codeandmore.com have changed to commercial sometimes You will have to google for some other online font generator.

    EDIT

    If fontsquirrel.com won't help You try to use: http://www.font2web.com/

提交回复
热议问题