【问题标题】:How can I force rotated text to anti-alias correctly in Chrome on Windows?如何在 Windows 上的 Chrome 中强制旋转文本正确消除锯齿?
【发布时间】:2019-06-07 12:18:19
【问题描述】:

当我尝试为标签旋转文本时,我可以得到非抗锯齿文本或模糊文本,但不能很好地抗锯齿文本。

此文本在“标准”1920*1080 显示器上看起来糟糕,在更高分辨率的屏幕上您可能不会注意到像素化。

https://jsfiddle.net/ft2s0d71/

<head>
<link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,600,700" rel="stylesheet">
</head>
<div>
<p id="a">
a. (Some Text Label - not pixelated)
</p>
</div>
<div>
<p id="b">
b. (Some Text Label - blurry)
</p>
</div>
<div>
<p id="c">
c. (Some Text Label - pixelated)
</p>
</div>
<div>
<p id="c2">
c2. (Some Text Label - pixelated)
</p>
</div>
<div>
<p id="d">
d. (Some Text Label - pixelated)
</p>
</div>

* {
  font-family:"Source Sans Pro", sans-serif;
  font-size:11pt;
  font-weight:400;

}
#a {
  position:absolute;
  top:0;
  left:10px;
}
#b {
  position:absolute;
  top:130px;
  left:-70px;
  transform: rotate(270deg) translate3d(0,0,0);
}
#c {
  position:absolute;
  top:140px;
  left:-50px;
  transform: rotate(270deg)
}
#c2 {
  position:absolute;
  -moz-osx-font-smoothing: grayscale; /* Firefox */
  -webkit-font-smoothing: antialiased; /* WebKit */
  top:142px;
  left:-30px;
  transform: rotate(270deg)
}
#d {
  position:absolute;
  top:70px;
  left:70px;
  transform: rotate(180deg);
  writing-mode: tb-rl;
}

上图展示了我的尝试。有谁知道如何正确强制渲染?

【问题讨论】:

    标签: windows google-chrome transform blurry


    【解决方案1】:

    经过进一步调查,除了 90 度和 270 度外,字体渲染在所有旋转角度上看起来都不错。将其更改 0.1 度似乎足以修复文本的呈现。

    即。

    transform: rotate(270.1deg)
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-03-21
      • 2015-09-09
      • 1970-01-01
      • 2010-11-21
      • 1970-01-01
      • 2014-08-21
      • 2011-10-14
      相关资源
      最近更新 更多