[cairo] PDF + open type fonts

antonio antonio_macchi at alice.it
Sun Apr 12 02:37:43 PDT 2009


Hi
I'm tryng to draw some (musical) glyphs over different cairo-surfaces

the format of those font is OpenTypeFormat (from lilypond software)

I use the same drawing code for every surface... but it works only on 
GdkDrawable, PNG and SVG
PDF and PS does does not work (but they works too if I use TrueType font)

when I try to draw over PDF/PS, it sometimes creates a valid-but-empty 
ps/pdf file, sometimes crashes with Segmentation Fault



this is the drawing code


-----

void drawing(cairo_t *cr) {
  FT_Library library;
  FT_Face freetypeface;
  cairo_font_face_t *cairoface;
  cairo_glyph_t glyph;

  FT_Init_FreeType(&library);
  FT_New_Face(library,
    "/home/antoniomac5/Desktop/lilypond-fonts/otf/emmentaler-26.otf",
    0, &freetypeface);

  cairoface = (cairo_font_face_t *)
              cairo_ft_font_face_create_for_ft_face(freetypeface, 0);

  cairo_set_font_face(cr, cairoface);

  glyph.index = 171;
  glyph.x = 100.0;
  glyph.y = 100.0;

  cairo_show_glyphs(cr, &glyph, 1);
}





may be someone can help me?
I'm really newbie... and I can't go ahead
thanks a lot
bye


More information about the cairo mailing list