<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:tahoma,new york,times,serif;font-size:10pt"><div>Hi , i am new to cairo . i wrote a code for displaying some numbers around a circle using cairo APIs and SDL Backend on Win32 but i have a problem which is some numbers does nt render properly .<br><br><span>look this picture : <a target="_blank" href="http://img198.imageshack.us/img198/8144/filen.png">http://img198.imageshack.us/img198/8144/filen.png</a> this a native png output from cairo . as you see some numbers doesnt render properly . for example look at first circle from left , the number 9 & 3 does not render properly as it should .</span><br><br>i used a simple sin & cos & cairo_arc for placing them around a circle and then i used cairo_show_text . <br><br>this is the code :<br>int NumberedSteps = 0;<br>
<br> for(int i=0;i<=(Range/DegreSteps);i++){<br> <br> NumberedSteps++;<br> <br> if(NumberedSteps == NumberingSteps){<br> <br> NumberedSteps = 0;<br> int Number =
i*DegreSteps/DegreStepsNumbers;<br> double degre = angleFromZero(anglePerDegre * i * DegreSteps);<br> <br> cairo_arc(StaticCr, SPosCX-4, SPosCY+4, Radius+17,<br> rad(angleFromZero(anglePerDegre * RangeMin)),<br> rad(angleFromZero(anglePerDegre *
i*DegreSteps)+1)<br> );<br> <br> char szStr[4];<br> sprintf(szStr, "%i", Number);<br> <br> cairo_text_extents_t extents;<br> cairo_text_extents (StaticCr, szStr,
&extents);<br> <br> double tCX,tCY;<br> cairo_get_current_point(StaticCr, &tCX, &tCY);<br> <br> cairo_move_to(StaticCr, <br> tCX -
((extents.width/2)*(sin(rad(angleFromZero(degre)))/2)),<br> tCY - ((extents.height/2)*(cos(rad(angleFromZero(degre)))/2))<br> ) ;<br> cairo_set_source_rgba(StaticCr, 1, 1, 1, 1);<br> cairo_show_text (StaticCr, szStr);<br> }<br>
<br> <br> }<br><br>the problem does not relate to cairo_arc and extents , i writed another program with only sin & cos for moving the pointer but the problem has been exists .<br><br>this problem happens when i use small fonts sizes , in big sizes there is no problem like this. <br><br>so what can i do to solve this ?!<br><br>Regards.<br><br></div>
</div><br>
</body></html>