[cairo-bugs] [Bug 104042] text failing to display on SVG and X11 surface even though it works correctly on PDF and PS surfaces

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Wed Dec 27 12:15:09 UTC 2017


https://bugs.freedesktop.org/show_bug.cgi?id=104042

--- Comment #1 from Uli Schlachter <psychon at znc.in> ---
I don't really know my way around cairo-script, so bear with me.

First, to test your script with the xlib backend:

diff --git a/util/cairo-script/csi-replay.c b/util/cairo-script/csi-replay.c
index 4c66b7752..e25e6fc63 100644
--- a/util/cairo-script/csi-replay.c
+++ b/util/cairo-script/csi-replay.c
@@ -40,6 +40,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#include <unistd.h>

 static const cairo_user_data_key_t _key;

@@ -119,6 +120,7 @@ static void
 _destroy_window (void *closure)
 {
     XFlush (_get_display ());
+    sleep(3);
     XDestroyWindow (_get_display(), (Window) closure);
 }


Then, let's take a look at your script (could you provide a self-contained C
program instead if the following is not what you want to hear?):

    %!CairoScript
    << /content //COLOR_ALPHA /width 460 /height 345 /fallback-resolution
[100 100] >> surface context
    1 g set-source
    paint

The above creates a surface of size 460x345, creates a context for it, sets the
source to all white (1 g is apparently r=g=b) and paints it, i.e. this fills
the surface with white.

    //ALPHA [] record
    dup /s6 exch def dup context

Uhm... I'm not quite sure. I guess this creates another cairo context for the
same surface?

    [12 0 0 12 0 0] set-font-matrix
    << /type 42 /index 0 /flags 32 /source < ... > >> font dup /f0 exch def
set-font-face /scaled-font get /sf0 exch def
    [0 7 <~6i~>] show-glyphs

Font setup and draw some glyph somewhere.

    pop pattern

Turn the surface that is on the stack into a surface pattern.

    [1 0 0 1 -227.4 -9.312] set-matrix
    set-source

Set this pattern as the source with the above matrix (just some offset).

    paint
    pop

Draw the cairo surface. Is this a self-copy (drawing a surface to itself)? If
so, that's not allowed in cairo.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.cairographics.org/archives/cairo-bugs/attachments/20171227/902ad2e0/attachment.html>


More information about the cairo-bugs mailing list