cssembedded-fontswoffwoff2

embedding font into a html


Yeah, I know it's a question that is being asked and asked again. I prefere to think that I did my homework, but still none of my browsers isn't even pulling the font from a web server (according to logs).

CSS:

@font-face {
    font-family: "Open Sans";
    /*src: local('Open Sans'), local('OpenSans'), url(http://zhegan.in/OpenSans.woff2) format('woff2');*/
    src: url(http://zhegan.in/OpenSans.ttf) format('truetype'), url(http://zhegan.in/OpenSans.woff) format('woff'), url(http://zhegan.in/OpenSans.woff2) format('woff2');
    font-style: normal;
    font-weight: 400;
    unicode-range: U+0460-052F, U+20B4, U+2DE0-2DFF, U+A640-A69F;
}
body {
    color: #3F3F3F;
    font-family: "Open Sans";
    font-weight: 400;
    font-style: normal;
}

The test page is at my test site here. Since I'm out of options and ideas, I decided to ask here, as a last resort measure.


Solution

  • Something is invalid with your unicode-range. Commenting that out fixes the issue.

    If you only want to display Open Sans characters for Cyrillic, then you can do this:

    unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;

    (I found this by looking at Open Sans in Google Fonts and selecting the Cyrillic subset: https://fonts.googleapis.com/css?family=Open+Sans&subset=latin,cyrillic-ext)