[cairo-bugs] [Bug 104042] New: 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
Sun Dec 3 02:24:45 UTC 2017


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

            Bug ID: 104042
           Summary: text failing to display on SVG and X11 surface even
                    though it works correctly on PDF and PS surfaces
           Product: cairo
           Version: unspecified
          Hardware: Other
                OS: All
            Status: NEW
          Severity: normal
          Priority: medium
         Component: general
          Assignee: chris at chris-wilson.co.uk
          Reporter: anntzer.lee at gmail.com
        QA Contact: cairo-bugs at cairographics.org

Created attachment 135887
  --> https://bugs.freedesktop.org/attachment.cgi?id=135887&action=edit
cairo-script that reproduces the reported issue

This bug was first reported on the cairo mailing list.


I have an issue of text failing to be displayed onto a SVG surface.  I have
attached a cairo-script to this bug report; the script is quite large because
of the font (DejaVu) definition embedded.  Stripping the font definition yields

    %!CairoScript
    << /content //COLOR_ALPHA /width 460 /height 345 /fallback-resolution
[100 100] >> surface context
    1 g set-source
    paint
    //ALPHA [] record
    dup /s6 exch def dup context
    [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
    pop pattern
    [1 0 0 1 -227.4 -9.312] set-matrix
    set-source
    paint
    pop

where the ellipsis stands for the binary font definition.

Replaying the script with csi-replay (cairo 1.14.10), patched to output the
results to a file

    {
    -    return cairo_pdf_surface_create_for_stream (NULL, NULL, width,
height);
    +    return cairo_pdf_surface_create("/tmp/out.pdf", width, height);
    }


(and similarly for ps and svg) shows that the pdf and ps surfaces (correctly)
create a file that displays a single letter "a" on the surface, but the svg
surface creates a file that displays nothing.  Although I can't showcase the
issue as easily on other surfaces, my tests indicate that the text is also
correctly displayed by the image surface, and also missing when using the X11
surface.

As some side notes: 1) It may be worth documenting somewhere (e.g.
util/cairo-script/README) that the way to build csi-replay is `make
csi-replay`; this took me a while to realize.  2) It may be worth supporting
output to a file from csi-replay, in the manner of the patch I used (but either
with proper integration to the command line, or perhaps just outputting to
$pid.pdf).

Any help would be welcome.  Thanks!

-- 
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/20171203/83dc3b57/attachment.html>


More information about the cairo-bugs mailing list