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 (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to