[cairo] Problem with ft fonts

Fred Kiefer fredkiefer at gmx.de
Thu Jan 26 13:29:43 PST 2006


In my library (actually the GNUstep cairo backend) I use the following
code to draw strings with the FT font system:

  cairo_matrix_init(&font_matrix, matrix[0], matrix[1], matrix[2],
		    -matrix[3], matrix[4], matrix[5]);
  cairo_set_font_face(ct, [_faceInfo fontFace]);
  cairo_set_font_matrix(ct, &font_matrix);

  // FIXME: Need some adjustment here
  cairo_rel_move_to(ct, 0.0, -5.0);
  cairo_show_text(ct, str);


The statement [_faceInfo fontFace] is a bit of Objective-C code, that
returns a reused, fully resolved cairo_font_face_t* structure. So far
everything looks fine, it is possible to set different fonts and they
get displayed nicely. Now my problem is that for some fonts text is
drawn with the same point size, no matter what matrix gets set for it.
What am I doing wrong here? Or is there any known limitation to the FT
font system in cairo?
This happens for example with the Adobe Helvetica and the Adobe Courier
font, but works fine for some other Adobe fonts (Adobe Utopia even fails
with a segmentation fault, but this is probably a different problem),
but also with some other fonts from other vendors.
All of this takes place on a SuSE Linux 10 system with the CVS version
of cairo and lib freetype 2.1.10

Cheers
Fred


More information about the cairo mailing list