[cairo] Problem with win32 font backend
hrcairo at web.de
hrcairo at web.de
Wed Jan 19 04:10:01 PST 2011
Hi,
I've got a problem when trying to export a pdf with many rotated characters.
This code runs fine:
--------------------------------------
cairo_t *cr;
cairo_surface_t *surface;
cairo_pattern_t *pattern;
cairo_text_extents_t text;
float x_spacing = 10;
float y_spacing = 10;
int ROWS = 70;
int COLS = 70;
surface = (cairo_surface_t *)cairo_pdf_surface_create("test.pdf", 900.0, 900.0);
cr = cairo_create(surface);
cairo_set_source_rgb (cr, 0, 0, 0);
for(int y = 0; y<ROWS; y++) {
for(int x = 0; x<COLS; x++) {
cairo_save(cr);
cairo_move_to(cr, 100+x*x_spacing, 100+y*y_spacing);
//cairo_rotate(cr, (float)rand()/(float)RAND_MAX);
cairo_show_text(cr, "a");
cairo_restore(cr);
}
}
cairo_destroy (cr);
cairo_surface_destroy (surface);
----------------------------------------------
However, as soon as I un-comment the cairo_rotate() I get the following 2 messages:
-------------------
_win32_scaled_font_get_unscaled_hfont:CreateIndirect: Eine Datei kann nicht erst erstellt werden, wenn sie bereits vorhanden ist.
_win32_scaled_font_get_scaled_hfont: Eine Datei kann nicht erstellte werden, wenn sie bereits vorhanden ist.
-------------------
and a corrupt pdf file. The german text reads something like: Can't create file, if it already exists.
Note: when I rotate every character by a constant value like cairo_rotate(cr, 0.5f) everything works fine.
Any hints or workarounds? I really need to rotate each character individually.
___________________________________________________________
NEU: FreePhone - kostenlos mobil telefonieren und surfen!
Jetzt informieren: http://produkte.web.de/go/webdefreephone
More information about the cairo
mailing list