• 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
Align attributed string to baseline
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Align attributed string to baseline


  • Subject: Align attributed string to baseline
  • From: Leonardo <email@hidden>
  • Date: Fri, 07 Dec 2012 18:40:02 +0100
  • Thread-topic: Align attributed string to baseline

Hi,
I am getting serious difficulties at drawing an attributed string within an
attachmentCell and get it aligned on the baseline.
I have a NSTextView. I add an attachment with its attachmentCell.
In the method cellFrameForTextContainer I return a
    cell.frame.height = font.ascender - font.descender;
In the method drawWithFrame: of the cell, I draw the string with
drawAtPoint: cellFrame.origin.x, cellFrame.origin.y - font.descender;
It works well with some font and size: the attachment string is aligned with
the rest of the text (with same font and size) in the NSTextView.
E.g. with Futura Medium >= 17 the string is "always" aligned.

But with Futura Medium < 18 the string goes lower than the baseline. Why?
What do I miss there?


Regards
-- Leonardo


_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Align attributed string to baseline
      • From: "email@hidden" <email@hidden>
  • Prev by Date: Re: Localization of Help
  • Next by Date: Re: leak in AVAudioPlayer ?
  • Previous by thread: Re: Create a socket.io connection to node.js server
  • Next by thread: Re: Align attributed string to baseline
  • Index(es):
    • Date
    • Thread