• 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: underlining
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: underlining


  • Subject: Re: underlining
  • From: Graham Cox <email@hidden>
  • Date: Fri, 6 Feb 2009 10:31:33 +1100


On 6 Feb 2009, at 10:00 am, Eric Slosser wrote:

I'm trying to draw underlined strings, but they come out wrong


In what way?

The code looks OK to me, the -drawGlyphsForGlyphRange:atPoint: claims it handles all the underlining, etc.

I just had a load of pain with underlining too - what is drawn by NSLayoutManager is different from what the font metrics returned by NSFont suggest are the correct sizes and offsets for underlining. It varies with every font. I couldn't figure out exactly how NSLayoutManager arrived at its underlining decisions so in the end I gave up and just did what NSFont told me plus some minor tweaks to make it come out the same as NSLayoutManager for Helvetica. Not very satisfactory but there is no documentation that I could find that explains how the metrics are to be interpreted.

Is this what you're referring to?

--Graham


_______________________________________________

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: underlining
      • From: Eric Slosser <email@hidden>
    • Re: underlining
      • From: Eric Slosser <email@hidden>
References: 
 >underlining (From: Eric Slosser <email@hidden>)

  • Prev by Date: Needed : set class for Cocoa
  • Next by Date: Simple memory problem
  • Previous by thread: underlining
  • Next by thread: Re: underlining
  • Index(es):
    • Date
    • Thread