[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[ft-devel] Windows default rendering
From: |
Werner LEMBERG |
Subject: |
[ft-devel] Windows default rendering |
Date: |
Fri, 06 Feb 2009 11:05:26 +0100 (CET) |
In private communication, Greg Hitchcock from Microsoft gave some
interesting insights how Windows selects rendering modes, which I post
here (with permission). The main question was whether a font can
request ClearType rendering. Below is his answer. Note that Windows
provides three user-selectable rendering modes: CLEARTYPE_QUALITY,
ANTIALIASED_QUALITY, and NONANTIALIASED_QUALITY.
For Windows, fonts cannot request ClearType, although they can
provide data to font rendering to indicate how well they work with
ClearType.
Typically what happens in Windows is there is the default rendering
type for GDI. When we added anti-aliasing support (which we called
`font smoothing') to the system we had a system variable that
indicated what the default should be: bi-level or anti-aliased.
That variable did not guarantee, though, how text would be rendered.
Other factors such as the bit depth of the device or bitmap, an
application making an explicit per font choice on rendering (by
using the *_QUALITY flags in the LogFont) or the font indicating
rendering thresholds through the `gasp' table could all impact what
was displayed. Note that if there is no gasp table in the font, the
system uses its own default `gasp' table.
For Windows 95 the default state of the variable was bi-level
rendering. This default changed to anti-aliasing for Windows 2000,
and ClearType for Windows Vista. This default is irrespective of
the actual display surface -- so ClearType will be displayed on
non-LCD screens. These defaults are changeable by the user through
the control panel or a Windows OEM can change the default behavior
when they ship a version of Windows.
When a font is rendered in the system, it uses the system default
setting unless overridden by the application or the gasp table.
Non-GDI applications in Windows can and do have different behavior;
these include GDI+, WPF, and the new DirectWrite.
The `ClearType' bit in the head table is just guidance mostly for
East Asian complex scripts that have embedded bitmaps for smaller
sizes, and only impacts WPF rendering.
[...] here is the rough flow chart for GDI [in Vista]. [...] My
intent with this flowchart is not to show every detail but instead
to give the gist of the decision tree.
00 Display Font
01 If Application chooses ClearType (CLEARTYPE_QUALITY), goto 11
02 If Application chooses Font Smoothing (ANTIALIASED_QUALITY), goto 08
03 If Application chooses Bi-Level (NONANTIALIASED_QUALITY), goto 07
04 If ClearType is system GDI default, goto 11
05 If Font Smoothing is system GDI default, goto 09
06 If Bi-Level is system GDI default, goto 07
07 Render Font bi-level with hinting, goto 12
08 If bit-depth < 16bpp, goto 07
09 If gasp indicates no font smoothing, goto 07
10 Render Font anti-aliased with hinting, goto 12
11 Render Font ClearType with hinting, goto 12
12 END
Werner
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [ft-devel] Windows default rendering,
Werner LEMBERG <=