• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
lining up baseline of adjacent NSAttributedString s
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

lining up baseline of adjacent NSAttributedString s


  • Subject: lining up baseline of adjacent NSAttributedString s
  • From: Ken Victor <email@hidden>
  • Date: Mon, 17 Oct 2005 16:41:34 -0700

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:
This email sent to email@hidden


  • Prev by Date: Re: NSTableView and variable row heights problem
  • Next by Date: Re: NSTableView and variable row heights problem
  • Previous by thread: Re: Can you float a window above iPhoto slide show?
  • Next by thread: Cocoa framework bug? - Checkboxes turning black on 10.4
  • Index(es):
    • Date
    • Thread