[cairo] working with font dimensions

Petr Danecek petr.danecek at gmail.com
Wed Jun 1 08:36:01 PDT 2011


Hi,

I'd like to render glyphs of different heights very accurately. So far I
was not very successful with this. Could anyone recommend a better way
to do this? In the example below, I'd like the glyphs to be of a
particular with and height. I would also like to know how many pixels
were actually used. Any ideas?

Best regards,
Petr

my $matrix = Cairo::Matrix->init_scale($glyph_width,$glyph_height);
$cr->set_font_matrix($matrix);
my $extents = $cr->text_extents($text);
$cr->show_text($base);




More information about the cairo mailing list