0
votes

I use cairo to render a simple text onto a cairo surface. I use a freetype font for that (Vera.ttf if that matters). It works, but sometimes characters disappear from the output. In fact only the numbers. I drew a text 'Demostream 1..' and sometimes the '1' disappears from the output and I have absolutely no idea why. The number is defitivly part of the string. There's also no memory corrpution or anything like that. This is the code that draws the text:

font = cairo_ft_font_face_create_for_ft_face(ftFace, 0);
cr = cairo_create(surface);

/* set the foreground color */
cairo_set_source_rgba(cr, ...);

/* render the text */
cairo_set_antialias(cr, CAIRO_ANTIALIAS_GRAY);
cairo_set_font_face(cr, font);
cairo_set_font_size(cr, size);
cairo_move_to(cr, x, y);

cairo_show_text(cr, text);

cairo_destroy(cr);
cairo_font_face_destroy(font);

ftFace is a loaded freetype font face.

I also would use pango to render the text, but I don't have fontcache available - so I have no idea howto load the Font into pango since it obviously only supports fontcache and no direct font loading.

Any input is welcome..

1
Are you sure that some sort of clipping is not involved? Can your post the whole program (a minimal example) that demonstrates the issue? When you say "sometimes" you mean that running the EXACT SAME code a second time produces DIFFERENT results?kazanaki
sorry for not updating. the code was exactly the same (ran within a loop) - however i removed the cairo support from the application and solved it with another approach. so the problem is sovled for me.fen

1 Answers

-1
votes

i removed cairo support - the problem is not longer relevant.