<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7226.0">
<TITLE>Unicode error causing Cairo to crash.</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/rtf format -->
<P><FONT SIZE=2 FACE="Arial">I'm using cairo 0.1.23 snapshot, but wanted to try to move to cairo 0.4.</FONT>
<BR><FONT SIZE=2 FACE="Arial">I'm trying to cache my own font metrics for each character.</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">The following code worked before but now causes a crash. </FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">#include <cairo.h></FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">#define NUM_CHARS 254</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">int main(int argc,char **argv) {</FONT>
<BR><FONT SIZE=2 FACE="Arial"> unsigned char c[2];</FONT>
<BR><FONT SIZE=2 FACE="Arial"> cairo_t cc=cairo_create();</FONT>
<BR><FONT SIZE=2 FACE="Arial"> cairo_text_extents ce;</FONT>
<BR><FONT SIZE=2 FACE="Arial"> int i;</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial"> c[1]='\0';</FONT>
<BR><FONT SIZE=2 FACE="Arial"> for (c[0]=0;i=0; i < NUM_CHARS;c[0]++;i++)cairo_text_extents(cc,c,&ce);</FONT>
<BR><FONT SIZE=2 FACE="Arial">}</FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">If NUM_CHARS is 128 it works fine. Should this cause I crash, even if some of</FONT>
<BR><FONT SIZE=2 FACE="Arial">the characters are not displayable? </FONT>
</P>
<P><FONT SIZE=2 FACE="Arial">Any suggestions?</FONT>
<BR><FONT SIZE=2 FACE="Arial">damion</FONT>
</P>
<BR>
</BODY>
</HTML>