Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

what can cause ATSUI to not anti-alias?



OK, I have the strangest problem. I'm drawing text with ATSUI via ATSUDrawText, but the text is not being anti-aliased. I know this because when I use universal access to zoom way in, it's clear there's no aliasing. On top of that, the text just looks terrible: the tracking and spacing of some glyphs seems to be just wrong.

Now, some things I know about this code:

- the CGContext I'm associating with the layout is the same CGContext my HIView is telling me to draw into
- calling CGContextSetShouldAntialias(true) seems to have no effect (even when called right before drawing)
- using kATSLineApplyAntiAliasing in the Line Layout options has no effect
- if I rip the core code that draws out of my app and drop it into a "simple" app the text is drawn beautifully anti-aliased
- no errors are being returned from any of the ATSUI related APIs


My logic for drawing is pretty simple:

- create unciode text from the macroman text
- create an ATSUI style based on the desired font, size, tracking, color and h/v scale
- create an ATSUI layout for the unicode text and style, adding just two "layout controls" (layout options and the CGContext).
- call ATSUDrawText


It's really very very straight-forward code and works perfectly in modified Hello World sample app.

*Something* is causing ATSUI to draw in a really undesired way, but for the life of me, I can't figure out what's causing this. It might be some side effect elsewhere in the app, but I can't even begin to guess where to look. I've searched for every call to CGContextSetShouldAntialias() and it's always true. I've verified that the same CGContext we get when told to draw our HIView is the same CGContext used with ATSUI. We're not using QuickDraw anywhere that I can think of. I'm at a bit of a loss here, any suggestions would be appreciated.

Bryan

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Quartz-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/quartz-dev/email@hidden

This email sent to email@hidden


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.