Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: Subpixel functions
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Subpixel functions

>>> What do the various subpixel functions do in iOS 4.0 etc.?
>>> Specificially,
>>> CGContextSetAllowsFontSmoothing
>>> CGContextSetAllowsFontSubpixelPositioning
>>> CGContextSetAllowsFontSubpixelQuantization
>> They adjust the settings related to subpixel antialiasing in bitmap contexts.
> Yes but what is font smooting vs. subpixel positioning vs. subpixel quantization?

From my book:

When drawing text on a context attached to a color LCD display, Quartz takes advantage of the nature of LCD monitors to improve the legibility of text. This technique is called Font Smoothing. The pixels of an LCD monitor are made up of red, green, and blue sub-pixels. If you take these sub-pixels into account the screen appears to have three times the resolution commonly attributed to it, at least in one dimension. Font smoothing takes advantage of this increased resolution to improve the rendering of text. Quartz turns different sub-pixels off and on by changing the color of a pixels along the edge of letter shapes. Because your eye expects to see a hard line at the edge of the glyphs, the computer tricks it into ignoring the color in favor of perceiving a smooth edge. One disadvan- tage of font smoothing is that it relies on the fixed ordering of the sub-pixels of an LCD display. That makes the technique of limited use on other types of monitors. Font smoothing is also of limited use on offscreen bitmaps.

Subpixel positioning concerns whether or not the glyphs in a line of text will be aligned to pixel boundaries or not.  If subpixel positioning is off then when glyphs are drawn their positions might be shifted slightly to take pixel boundaries in account.  This can improve the visual definition of the glyphs (making them slightly less "blurry") at the expense of honoring the font metrics.

Subpixel quantization is only enabled if subpixel positioning is enabled. Subpixel quantization improves the rendering of fonts whose glyphs are at subpixel positions by more closely examining how the shapes that make up the glyphs cover an individual pixel.  This improvement, requires additional processing so changing this value can affect text drawing performance.


Do not post admin requests to the list. They will be ignored.
Quartz-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

 >Subpixel functions (From: Glen Low <email@hidden>)
 >Re: Subpixel functions (From: Scott Thompson <email@hidden>)
 >Re: Subpixel functions (From: Glen Low <email@hidden>)

Visit the Apple Store online or at retail locations.

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.