Hi all,

I am trying to get the width of a text in Quartz through declares. As per the tech note <http://developer.apple.com/qa/qa2001/qa1051.html>, it is achieved by storing the current text position p1.x, drawing the text in invisible mode, and taking the difference between the new text position p2 and the old, that is textWidth = (p2.X - p1.X)

The problem is with the function used to get the current text position:

CGPoint CGContextGetTextPosition (
   CGContextRef context
);

which returns a CGPoint.

Starting from Seth's great articles on ResExcellence, I translated it to:

Declare Function CGContextGetTextPosition Lib "Carbon" (CGContextRef as Integer) As CGPoint

where CGPoint is a 8-byte structure.

Nothing of what I tried so far seems to work as return type, CGPoint, Memoryblock, Ptr, etc.

Any help on this would be much, much appreciated.

BTW: Thanks so much to Real for the Graphics.Handle types and for CFString and CString. Little gems.

--
Andrea Suraci
Mac OS X 10.4.6, RB2006r2
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to