Mailing Lists: Apple Mailing Lists

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

lining up baseline of adjacent NSAttributedString s



i've got several adjacent NSAttributedStrings that i wish to line up their baselines when printing (left, center, and right strings for headers and footers).

i'm doing this successfully by determining the maximum descender for the strings that will print on the same line and then using [NSAttributedString drawWithRect:options:]. and this is working nicely.

however, i originally coded this to use [NSAttributedString drawAtPoint] and calculated the maximum ascender for each string and offset each by an appropriate point. this didn't work! by didn't work, i mean that the baseline of adjacent lines varied by as much as 2 pixels (when viewed with preview).

from my reading of apple docs and cocoa builder archives, it seems to me that either approach should have worked. can someone explain to me why using drawAtPoint and offsetting by ascender didn't work?

just curious.
thanx,
ken
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-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.