[cairo] Unicode error causing Cairo to crash.

Hancock, Damion C Damion.C.Hancock at usa-spaceops.com
Tue Apr 26 12:10:03 PDT 2005

I'm using cairo 0.1.23 snapshot, but wanted to try to move to cairo 0.4.
I'm trying to cache my own font metrics for each character.

The following code worked before but now causes a crash.  

#include <cairo.h>

#define NUM_CHARS 254

int main(int argc,char **argv) {
   unsigned char c[2];
   cairo_t cc=cairo_create();
   cairo_text_extents ce;
   int i;

   for (c[0]=0;i=0; i < NUM_CHARS;c[0]++;i++)cairo_text_extents(cc,c,&ce);

If NUM_CHARS is 128 it works fine.  Should this cause I crash, even if some of
the characters are not displayable? 

Any suggestions?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freedesktop.org/archives/cairo/attachments/20050426/a8e54326/attachment.htm

More information about the cairo mailing list