[cairo] Font size, how to make it very small?

Behdad Esfahbod behdad at behdad.org
Mon Sep 11 07:49:46 PDT 2006


On Mon, 2006-09-11 at 08:57 -0400, Gustavo Sikora wrote:
> Hi there, 
> 
> Here's some code of what I'm doing:
> 
> cairo_text_extents_t extents;
> 
> cairo_select_font_face (cr, "Sans", CAIRO_FONT_SLANT_NORMAL,
> CAIRO_FONT_WEIGHT_BOLD);
> cairo_set_font_size (cr, 0.01);
> cairo_text_extents (cr, (const char *)str, &extents);
> tx = noAtual->x - (extents.width/2 + extents.x_bearing);
> ty = noAtual->y - (extents.height/2 + extents.y_bearing );
> 
> cairo_move_to (cr, tx, ty);
> cairo_show_text (cr, (const char *)str);
> cairo_fill_preserve (cr);
> 
> ----
> 
> The font size is set to 0.01 and even changing this value, it never
> get smaller... 

So, you really want a font size of 0.01 pixels?  Where did you get that
number from?  I'm told that some of our online tutorials advertise
sub-pixel font sizes...  That should be fixed.

behdad


> Any help? 
> 
> Thanks
> 
> -- 
> Gustavo 
> _______________________________________________
> cairo mailing list
> cairo at cairographics.org
> http://cairographics.org/cgi-bin/mailman/listinfo/cairo
-- 
behdad
http://behdad.org/

"Commandment Three says Do Not Kill, Amendment Two says Blood Will Spill"
        -- Dan Bern, "New American Language"



More information about the cairo mailing list