Cairo's Arial font smaller than Arial in browsers

Ken Resander <[email protected]>
Newsgroups gmane.comp.lib.cairo
Message-ID <[email protected]>
I am using GTK3.0 and the Cairo that came with Ubuntu 12.04.

I am only just beginning with Cairo and have gone through the introductory tutorials and written some very tiny fragments to experiment and learn including the following for text:

   cairo_select_font_face(cr, "Arial", CAIRO_FONT_SLANT_NORMAL,
                          CAIRO_FONT_WEIGHT_NORMAL);
   cairo_set_font_size(cr, 12);   // <<<<< assume this is in pts
   cairo_set_source_rgb(cr, 0, 0, 0);
   const char * str = "This is text" ;
   cairo_font_extents_t fexts;
   cairo_font_extents ( cr, &fexts ) ;
   cairo_move_to(cr, 0,fexts.ascent);
   cairo_show_text(cr, str );

The text came out looking smaller than I had expected so I checked using Firefox, Chromium and Opera with the following tiny html file:

<style>
.some_class {
    padding: 0px;
    border: 2px solid green;
    }
</style>
<body>
<p class="some_class" style="font-family:Arial;font-size:12pt;">This is text</p>
</body>

The three browsers showed the text in exactly the same way. The height of the capital letter T was 12 pixels for the browsers and only 8 pixels for the Cairo output.

Why is this?

Ken
P.S. I was using screen capture and the GIMP Image Editor to view the pixels zooming 16x with a pixel grid.
The ascent and descent for the Cairo font choice were 11 and 3 respectively.

-- 
cairo mailing list
[email protected]
http://lists.cairographics.org/mailman/listinfo/cairo
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.