[cairo] Text in Windows Metafiles (EMF)
mikhailkozhevnikov at yandex.ru
Sat Mar 7 07:30:08 PST 2009
I also found out that the same works well when using normal HDC as a target. But I can't make it work with Metafiles.
Anybody's familiar with the code of cairo-win32-printing-surface.c? I have no idea what could be the problem.
> The following code attempts to write some text to windows metafile using Cairo:
> HDC hdc = 0;
> hdc = CreateEnhMetaFile(NULL, "test.emf", NULL, NULL);
> cairo_surface_t *surface = cairo_win32_printing_surface_create(hdc);
> cairo_t *cr = cairo_create(surface);
> cairo_rectangle(cr, 0, 0, 100, 100);
> cairo_set_source_rgb(cr, 0.5, 1, 0.5);
> cairo_move_to(cr, 0, 80);
> cairo_set_source_rgb(cr, 0, 0, 0);
> cairo_show_text(cr, "hello world");
> Attached are results of the above code execution and the output of the same code when using PNG surface. On the first one the text is missing.
> Any ideas why it might not work?
> 1) It looks like some drawing code for text is executed - if we use much larger font, the size of the image will be increased, as it is determined automatically.
> 2) I tried setting up font size and face, it doesn't fix the thing.
> Considerations are appreciated!
Яндекс.Открытки. Свежие открытки у вас в почтовом ящике http://cards.yandex.ru/subscribe.xml
More information about the cairo