On 21 Sep 2012, at 17:12, Ross Carter <rosscarter...@me.com> wrote: > > On Sep 21, 2012, at 6:54 AM, "jonat...@mugginsoft.com" > <jonat...@mugginsoft.com> wrote: > >> The following is used to draw a glyph representing a tab character in an >> NSLayoutManager subclass. >> When using say the Monaco font everything looks fine. >> When switching to Menlo however the glyphs drawn in the method below are >> positioned lower on the line than those drawn by the super implementation. > > Not sure this will help, but you might compare the descender value for the 2 > fonts and see if the difference is equal to the positioning problem.
The font metrics are different (see below). I have studied the font metrics in the font handling section of the Cocoa text architecture guide but I cannot quite see how the offset arises. Perhaps I should use core text directly to draw the glyph rather than using [charString drawAtPoint:pointToDrawAt withAttributes:attributes]; Kyle ==== I watched the WWDC 2012 Font session. Interesting but it didn't unscramble things for me. I will try posting to the core text list. 2012-09-21 21:00:18.515 Fragaria[23292:303] Context isFlipped = 1 2012-09-21 21:00:18.528 Fragaria[23292:303] baseLineOffset = 10.000000, lineHeight = 13.000000 2012-09-21 21:00:18.539 Fragaria[23292:303] descender = -2.594238 2012-09-21 21:00:18.549 Fragaria[23292:303] pointToDrawAt x = 5.000000, y = 13.000000 2012-09-21 21:00:18.550 Fragaria[23292:303] glyphFragment x = 0.000000, y = 13.000000, width = 677.000000, height = 13.000000 2012-09-21 21:00:18.553 Fragaria[23292:303] pointToDrawAt x = 5.000000, y = 13.000000 2012-09-21 21:00:18.554 Fragaria[23292:303] glyphFragment x = 0.000000, y = 26.000000, width = 677.000000, height = 13.000000 2012-09-21 21:03:50.519 Fragaria[23292:303] Context isFlipped = 1 2012-09-21 21:03:50.519 Fragaria[23292:303] baseLineOffset = 11.000000, lineHeight = 15.000000 2012-09-21 21:03:50.520 Fragaria[23292:303] descender = -2.750000 2012-09-21 21:03:50.520 Fragaria[23292:303] pointToDrawAt x = 5.000000, y = 15.000000 2012-09-21 21:03:50.520 Fragaria[23292:303] glyphFragment x = 0.000000, y = 15.000000, width = 677.000000, height = 15.000000 2012-09-21 21:03:50.521 Fragaria[23292:303] pointToDrawAt x = 5.000000, y = 15.000000 2012-09-21 21:03:50.521 Fragaria[23292:303] glyphFragment x = 0.000000, y = 30.000000, width = 677.000000, height = 15.000000 Regards Jonathan Mitchell Mugginsoft LLP ================================================ KosmicTask - the Integrated Scripting Environment for OS X. http://www.mugginsoft.com/KosmicTask ================================================ _______________________________________________ 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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com