代码之家  ›  专栏  ›  技术社区  ›  RunLoop

在浏览器中字体渲染更厚[已关闭]

  •  17
  • RunLoop  · 技术社区  · 10 年前

    我在一个网站上使用的是OpenSans字体,但它在所有浏览器中都比在AdobeIllustrator中要厚得多(见附图)。为什么会这样?我有没有办法让浏览器中的字体显示“更薄”?

    Illustrator

    Browser

    笔记 浏览器和Illustrator都在渲染Semibold权重(600)

    4 回复  |  直到 10 年前
        1
  •  46
  •   RunLoop    10 年前

    问题在于别名。以下css解决方案适用于safari、chrome和firefox:

    -moz-osx-font-smoothing: grayscale;
    -webkit-font-smoothing: antialiased;
    
        2
  •  4
  •   James Donnelly    7 年前

    确保包含Open Sans的轻(300)和普通(400)权重,然后您可以简单地:

    body {
        font-family: 'Open Sans', sans-serif;
        font-weight: 300; /* Or 400, if 300 is too light. */
    }
    
        3
  •  0
  •   moeses    10 年前

    Open Sans Webfont有10种样式。对我来说,浏览器似乎显示了半粗体。它应该是定期的,你应该没事。

    看看fontsquarer

    http://www.fontsquirrel.com/fonts/open-sans

        4
  •  -1
  •   JustH    10 年前

    简单的答案是没有解决方案。如果您正确加载并调用了所需的样式和权重,那么有时adobe和web浏览器(或浏览器到浏览器)之间的渲染会有所不同。你的选择是达到400磅,或者学会热爱这种勇气。