Re: drawGlyphsForGlyphRange layout issue
Re: drawGlyphsForGlyphRange layout issue
- Subject: Re: drawGlyphsForGlyphRange layout issue
- From: "email@hidden" <email@hidden>
- Date: Fri, 21 Sep 2012 21:38:57 +0100
On 21 Sep 2012, at 17:12, Ross Carter <email@hidden> wrote:
>
> On Sep 21, 2012, at 6:54 AM, "email@hidden" <email@hidden> 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 (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