text failing to display on SVG and X11 surface even though it works correctly on PDF and PS surfaces
Submitted by Antony Lee
Assigned to Chris Wilson @ickle
Link to original bug (#104042)
Description
Created attachment 135887 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!
Attachment 135887, "cairo-script that reproduces the reported issue":
test.cairoscript