简体   繁体   English

每次ClearType字体渲染都会绘制完全相同的相同字符吗?

[英]Does ClearType font rendering draw the same character exactly the same every time?

I am developing some OCR software for small on-screen fonts. 我正在开发一些用于较小的屏幕字体的OCR软件。 The fonts are rendered in the browser. 字体在浏览器中呈现。 I notice that they are rendered with ClearType onto the screen and the letters in the words seem to be the same no matter where they are located on-screen, although I have not checked many cases, just some common cases. 我注意到它们是用ClearType呈现到屏幕上的,无论它们在屏幕上的什么位置,单词中的字母似乎都是相同的,尽管我没有检查很多情况,只是一些常见的情况。

For example in the following image the letter a is repeated twice, once at the beginning and nice later 3rd from the end. 例如,在下图中,字母a重复两次,一次在开头,一次在末尾第3个。 The letter a looks exactly the same, pixel for pixel. 字母a看起来完全一样,一个像素一个像素。 My question is, is the letter a always the same for the same font and same font size within ClearType rendering? 我的问题是,对于ClearType渲染中的相同字体和相同字体大小,字母是否总是相同? Does the same apply for all letters within the same font? 同一字体内的所有字母都一样吗?

在此处输入图片说明

ClearType is here. ClearType在这里。

It might or it might not, depending upon the font, the size, and which version of ClearType is in use (and which application settings are applied for rendering). 它可能会或可能不会,取决于字体,大小和使用的ClearType版本(以及用于渲染的应用程序设置)。 Microsoft's explanation of ClearType gets into this somewhat, and even shows an example where you can observe a case where two instances of a character do not render the same (see 'elle', on the right; both the 'e' and 'l' render differently in the second instance). 微软对ClearType 解释有些涉及这一点,甚至显示了一个示例,您可以在其中观察到字符的两个实例呈现相同情况的情况(请参见右侧的“ elle”;同时显示“ e”和“ l”在第二种情况下呈现不同)。 This has to do with the use of fractional advance widths, which get resolved to the nearest 1/64th of a pixel. 这与使用分数超前宽度有关,该宽度被解析为最接近像素的1/64。 Thus you could potentially end up with many different instances of a single character (though as you can see, the differences are fairly subtle). 因此,您可能最终会遇到单个字符的许多不同实例(尽管您可以看到,差异非常微妙)。

In short: I would not write anything that depends on any two instances of a character ending up exactly the same. 简而言之:我不会写任何依赖于字符的两个实例完全相同的东西。 They will be pretty similar, but not identical. 它们将非常相似,但不完全相同。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM