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

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


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

I've also noticed that baselines don't seem to match up all the time in a NSTextTable either when for instance in a table of 2 columns the left cell is an attachment and the right is text. Using the example below, the 'genre' image of the attachment is in the right cell and the text 'Rock' is in the left cell. The text 'Rock' will float above the image considerably. If the text is changed to 'rock' then the image and the text are aligned. Funny how this is opposite from how it works when the image and text are not in a table. The text blocks were set to NSTextBlockBaselineAlignment.

'genre' is drawn using Lucida Grande 11.0 bold, and the text is Helvetica 11.0.

--
Michael

On Apr 19, 2006, at 12:00 PM, Michael Link wrote:

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

the computed baseline offset was -3.0. 'genre' with float above 'rock'.


'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 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40synthemesc.com


This email sent to email@hidden

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

References: 
 >baseline alignment of NSTextAttachment doesn't seem to always align...? (From: Michael Link <email@hidden>)

  • Prev by Date: Re: WebView in all version of OS X
  • Next by Date: NSDistributedLock question
  • Previous by thread: baseline alignment of NSTextAttachment doesn't seem to always align...?
  • Next by thread: Need some older messages (since 14th April, 2006)
  • Index(es):
    • Date
    • Thread