cairo + open type fonts

View: New views
2 Messages — Rating Filter:   Alert me  

cairo + open type fonts

by Antonio Macchi :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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


--
To UNSUBSCRIBE, email to debian-gtk-gnome-REQUEST@...
with a subject of "unsubscribe". Trouble? Contact listmaster@...


Parent Message unknown Re: cairo + open type fonts

by Antonio Macchi :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

antonio wrote:

> 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
>
>



hmmm... may be I'm not in the right place...


--
To UNSUBSCRIBE, email to debian-gtk-gnome-REQUEST@...
with a subject of "unsubscribe". Trouble? Contact listmaster@...