Google Fonts Lining Numbers

2019-03-20 14:51发布

问题:

I'm using the Raleway font and Google Font's description says that "the download features both old style and lining numerals".

I can't find any documentation that says how to line numerals. Does anyone know how I can go about doing this?

回答1:

To answer my own question:

First I had to add &subset=all as a parameter for the Google font:

<link href="http://fonts.googleapis.com/css?family=Raleway:400,100,200,300,500,600,700&subset=all" rel="stylesheet" type="text/css">

Then I just added this CSS:

body {
    font-family: "Raleway", Arial, sans-serif;
    -webkit-font-feature-settings: "lnum";
       -moz-font-feature-settings: "lnum";
        -ms-font-feature-settings: "lnum";
         -o-font-feature-settings: "lnum";
            font-feature-settings: "lnum";
}