سؤال

I am developing some OCR software for small on-screen fonts. 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.

For example in the following image the letter a is repeated twice, once at the beginning and nice later 3rd from the end. The letter a looks exactly the same, pixel for pixel. My question is, is the letter a always the same for the same font and same font size within ClearType rendering? Does the same apply for all letters within the same font?

enter image description here

ClearType is here.

هل كانت مفيدة؟

المحلول

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). 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). This has to do with the use of fractional advance widths, which get resolved to the nearest 1/64th of a pixel. 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 مع الإسناد
لا تنتمي إلى StackOverflow
scroll top