• 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: NSTextView baseline for line of text
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSTextView baseline for line of text


  • Subject: Re: NSTextView baseline for line of text
  • From: Satoshi Matsumoto <email@hidden>
  • Date: Thu, 27 May 2004 09:19:36 +0900

Hi Mark,

on 04.5.27 5:38 AM, Mark Alldritt at email@hidden wrote:
> How do I find the baseline of a line of text rendered within an NSTextView?
> I can find the bounding rectangle for a range of text, but I cannot
> determine the baseline within that rect.


You can find it using NSTypesetter method:

- (float)baselineOffsetInLayoutManager:(NSLayoutManager *)layoutMgr
glyphIndex:(unsigned)glyphIndex

Returns the distance from the bottom of the bounding box of the glyph in
layoutMgr at glyphIndex to its baseline. The text system uses this value to
calculate the vertical position of underlines.

--------

float baseline=[[[yourTextView layoutManager] typesetter]
baselineOffsetInLayoutManager:[yourTextView layoutManager]
glyphIndex:glyphIndex];


Hope that helps,

Satoshi
-----------------------------------------------------
Satoshi Matsumoto <email@hidden>
816-5 Odake, Odawara, Kanagawa, Japan 256-0802
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.


References: 
 >NSTextView baseline for line of text (From: Mark Alldritt <email@hidden>)

  • Prev by Date: Re: How far with accessors?
  • Next by Date: Re: window rotation
  • Previous by thread: NSTextView baseline for line of text
  • Next by thread: Forum notify
  • Index(es):
    • Date
    • Thread