# New Ticket Created by  chromatic 
# Please include the string:  [perl #29200]
# in the subject line of all future correspondence about this issue. 
# <URL: http://rt.perl.org:80/rt3/Ticket/Display.html?id=29200 >


I've just come across the following signature for which I want to write
NCI bindings:

/* Get the dimensions of a rendered string of text */
int SDLCALL TTF_SizeText(TTF_Font *font, const char *text, int *w, int
*h);

*w and *h are out parameters.

Per my reading of the NCI PDD and the code, this isn't yet supported.

I *could* fake it up by passing in an unmanaged struct and hoping that
the alignment all works out.  That's really not a long-term solution. 
It may also have portability issues, besides the general ugliness.  (I
do love tweaking people who think that C has a working type system,
though.)

Ideally, there'd be an NCI signature that told the NCI wrapper to
generate and pass in the appropriate out parameters and then store them
in the appropriate registers, so I could call this from Parrot with:

        (width, height) = SizeText(font, text);

It does mean revamping PDD16 a bit though.  Dan?

-- c

Reply via email to