• 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
baseline alignment of NSTextAttachment doesn't seem to always align...?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

baseline alignment of NSTextAttachment doesn't seem to always align...?


  • Subject: baseline alignment of NSTextAttachment doesn't seem to always align...?
  • From: Michael Link <email@hidden>
  • Date: Wed, 19 Apr 2006 12:00:08 -0500

I'm rendering an attributed string in the drawRect: method of an NSTextAttachmentCell (the title for the button). I determine the baseline offset by creating a text container, text storage and layout manager and setting the text storage to an attributed string of the button title and the adjacent text to the button and then asking the layout managers typesetter for the baseline offset.

I seem to get the right baseline offset once in awhile. For example...

boldSystemFontOfSize:11 userFontOfSize:11
----------------------- -----------------
                  genre Rock <- baseline is aligned
                  genre rock <- baseline is not-aligned

'genre' is the rendered text of the text attachment and 'rock' and 'Rock' are just text. Is there a different calculation that needs to be done to get the text attachment's rendered title to align correctly with the rest of the text on the line? Thanks.

--
Michael

Attachment: smime.p7s
Description: S/MIME cryptographic signature

 _______________________________________________
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

  • Follow-Ups:
    • Re: baseline alignment of NSTextAttachment doesn't seem to always align...?
      • From: Michael Link <email@hidden>
  • Prev by Date: Re: RTF to HTML
  • Next by Date: Re: Which method is called absolutetly last?
  • Previous by thread: Re: Generating a "left-arrow key" event
  • Next by thread: Re: baseline alignment of NSTextAttachment doesn't seem to always align...?
  • Index(es):
    • Date
    • Thread