Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > appendBezierPathWithGlyph:inFont:

appendBezierPathWithGlyph:inFont:
Thread Tools
Dedicated MacNNer
Join Date: Apr 2004
Status: Offline
Reply With Quote
Dec 1, 2005, 08:14 PM
 
OK. I've got an app I'm working on with an NSMatrix (with the default inverted coordinate system). For some drawing in the cells in the matrix, I'm usng an NSBezierPath and I want to (at some point) use the method appendBezierPathWithGlyph:inFont:

The problem is that due to a change in the appkit as of 10.3, in 10.2, the glyph gets drawn right-side up, but in 10.3 and higher it is upside-down. I can fix it for 10.3 but then it breaks for 10.2

Does anyone have an idea how to fix this?

According to Apple's developer site, the change in the 10.3 app kit is described as follows:
Also, -appendBezierPathWithGlyphs:count:inFont: no longer modifies the current graphics context (it doesn't call -[NSFont set]). This means it is the caller's responsibility to use fonts with matrix to flip when the target view is flipped
I was hoping that there'd be something simple I could do that would make it work in both (ex. it says that in 10.3, it doesn't call -[NSFont set], so I was thinking maybe if I called that, it would fix itself, but no luck.) I know I could do OS checking, but I'd rather not, and I'm not sure exactly what the code looks like. I was trying to figure out the method [NSFont fontWithName: matrix:], but I haven't had a lot of luck with finding what the different parts of the font matrix do, so I don't know what to do to the matrix to flip my font back...
     
Dedicated MacNNer
Join Date: Apr 2004
Status: Offline
Reply With Quote
Dec 3, 2005, 11:13 AM
 
So, I figured out what the format for the font transform matrix SHOULD be... it goes:
[a b c d t1 t2]
and x and y are in theory mapped to x' y' by the equations:
x'=ax+cy+t1
y'=bx+dy+t2

which is nice and would let me do what I want fairly easily, but for the fact that [NSFont fontWithName: matrix:] seems to completely ignore the matrix unless a=d and b=c=t1=t2=0, which means it's pretty much COMPLETELY POINTLESS because the same effects possible (namely scaling to achieve size) are much eaiser by simply doing [NSFont fontWithName:size:] for the given size.

Am I doing something wrong with the matrix?
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 07:44 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2