css - 字体在深色背景上看起来更浓

标签 css fonts google-fonts roboto

我正试图解决一个恼人的字体问题。特定的 Googles Roboto 字体。

问题是,在我的测试(OSX Sierra 10.12.6 上的 Chrome 62.0.3202.62)中,该字体在深色背景上显得更强(粗),而它在谷歌深色字体版本(https://fonts.google.com/specimen/Roboto?selection.family=Roboto:300,500,700 - 选择深色)上表现不错背景)。

我出现的截图:

enter image description here

与谷歌的出现(它的光)

enter image description here

我开始相信我的渲染有问题,但在几台不同设置的机器上尝试后,一切都一样。

有人知道如何解决这个问题吗?或者解释为什么 Google 和我的测试不同。

测试网址: https://jsfiddle.net/fb3umv2e/

.btn {
   display: inline-block;
   padding: 7px 8px;
   text-align: center;
   background: #fff;
   color: #000;
   font-family: "Roboto";
   font-weight: 300;
   text-decoration: none;
   font-size: 20px;
 }
 .btn.inverted {
   background: #222;
   color: #fff;
 }

最好的问候 理查德

最佳答案

尝试将这些添加到您的按钮样式中:)

-moz-osx-font-smoothing: grayscale; -webkit-font-smoothing: antialiased;

关于css - 字体在深色背景上看起来更浓,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46927586/

相关文章:

html - 如何在 html css 表外可见的表的每个 td 内放置一个链接

html - Bootstrap 到 PDF 转换

html - 在固定高度的父 div 中为子 div 添加省略号

css - 更改 Blogger 页面的字体大小

reactjs - 在 create-react-app 构建中完全包含 Google Web 字体(不弹出)

html - Firefox 57.0.1 将自定义字体渲染得更低

HTML 在 div 中对齐一个词

html - 是否有与@font-face 等效的内联?

php - 从php中的ttf-font获取单个字符的宽度?

html - 如果不缩放,粗体字体在移动设备上看起来很奇怪