Font weight turns lighter on Mac/Safari

前端 未结 5 595
半阙折子戏
半阙折子戏 2020-11-29 01:15

On my last website, the text is perfect naturally on chrome and firefox without touching font-smoothing or anything else.
But on Mac / Safari 7 the text appears well the

相关标签:
5条回答
  • 2020-11-29 01:35

    Try this:

    transform: translateZ(0.1px);
    

    Webkit browsers on Mac has known problem with antialiasing 2d and 3d text elements differently. Giving the 3d property to the element usually fixes the problem.

    0 讨论(0)
  • 2020-11-29 01:37

    Using -webkit-font-smoothing: subpixel-antialiased worked a little bit, but there was still too much of a difference between Safari, Chrome, and Firefox. I realized trying to make the font thicker in Safari wasn't going to work, so instead I made the font lighter in other browsers and then used a slightly thicker font weight. What ended up normalizing the font weights across browsers for me is this:

    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    
    0 讨论(0)
  • 2020-11-29 01:47

    So I fixed my problem with applying:

    body {
        -webkit-font-smoothing: subpixel-antialiased;
    }
    

    Now my font is consistent on every browsers.

    0 讨论(0)
  • 2020-11-29 01:47

    try both

    {-webkit-font-smoothing: subpixel-antialiased;
    -webkit-text-stroke:1px transparent;}
    
    0 讨论(0)
  • 2020-11-29 01:55

    Just use this: link href="https://fonts.googleapis.com/css?family=Lato:100,100i,300,300i,400,400i,700,700i,900,900i" rel="stylesheet"

    Instead of this: link href="https://fonts.googleapis.com/css?family=Lato" rel="stylesheet"

    problem solved for me this way!

    0 讨论(0)
提交回复
热议问题