<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<div class="moz-cite-prefix">Hello Behdad,</div>
<div class="moz-cite-prefix"><br>
</div>
<div class="moz-cite-prefix">from your PDF, e.g.:<br>
</div>
<div class="moz-cite-prefix">---</div>
<div class="moz-cite-prefix">% Small pink circle left to the string
"Point causing kink..."<br>
</div>
<div class="moz-cite-prefix">1 0 1 RG /a3 gs<br>
10 w<br>
1 J<br>
48 954 m 48 954 l S</div>
<div class="moz-cite-prefix"><br>
</div>
<div class="moz-cite-prefix">% Text "Suggested new contour..."<br>
</div>
<div class="moz-cite-prefix">0 0 0 rg /a0 gs</div>
<div class="moz-cite-prefix">BT<br>
36 0 0 -36 80 911 Tm<br>
/f-1-0 1 Tf<br>
<2c192727110023112105171125050a1d17231d191a050023021a23052d1d141723>Tj<br>
ET<br>
---</div>
<div class="moz-cite-prefix"><br>
</div>
<div class="moz-cite-prefix">1 0 1 RG sets the Stroking Color to
DeviceRGB pink,</div>
<div class="moz-cite-prefix">0 0 0 rg sets the Non-Stroking Color to
DeviceRGB black. <br>
</div>
<div class="moz-cite-prefix"><br>
</div>
<div class="moz-cite-prefix">Evince / XPDF / Chrome PDF Plugin
render the text with the non-stroking color, other views with the
stroking color...</div>
<div class="moz-cite-prefix"><br>
</div>
<div class="moz-cite-prefix">PDF Reference 1.7 Page 391f (5.1.2
Achieving Special Graphical Effects): "The color used for painting
glyphs is the current color in the graphics state: either<br>
the nonstroking color or the stroking color (or both), depending
on the text rendering mode (see Section 5.2.5, “Text Rendering
Mode”) [...] The text rendering mode parameter in the graphics
state specifies whether glyph outlines are to be filled, stroked,
used as a clipping boundary,
or some combination of these effects. (This parameter does not
apply to Type 3
fonts.)"</div>
<p>But your PDF does use Type 3 Fonts (possibly set up as user fonts
on the cairo side??), which also use Stroking operations in the
glyph definitions...<br>
This seems to catch cairo on the wrong foot, which does not expect
text to behave differently for Type 3 fonts(?), and thus only sets
the fill color to black, but not also the stroking color...</p>
<p>The PDF Spec might have changed since 1.7; I might have overseen
some special concession; there might be a subtle difference in how
these Type 3 fonts are represented in PostScript – but AFAIUI
Evince/... seems to do it wrong(?).<br>
</p>
<p>2c<br>
Tobias<br>
</p>
<div class="moz-cite-prefix"><br>
</div>
<div class="moz-cite-prefix"><br>
</div>
<div class="moz-cite-prefix"><br>
</div>
<div class="moz-cite-prefix">On 28/11/2023 18:37, Behdad Esfahbod
wrote:<br>
</div>
<blockquote type="cite"
cite="mid:CAF63+7WNBUPa2b-9Jxij2Hq=Y=6EocuhDhmaV2m1baWWCBFnCw@mail.gmail.com">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<div dir="ltr">[Resending with an even smaller image to pass the
list limit...]
<div><br>
</div>
<div>
<div>Hi everyone,</div>
<div><br>
</div>
<div>I'm facing an issue with the PDF output of cairo.
Basically, the attached PDF *should* render all text in
grayish black. And that's what I see in Evince. But both
GitHub's web PDF viewer, and the MacOS PDF viewer, show them
*wrong*, like below:</div>
</div>
<div><br>
</div>
<div><img src="cid:part1.5RsX6xPb.1AiIqZyz@thax.hardliners.org"
alt="image2.png" class="" width="242" height="198"><br>
</div>
<div>
<div>I've confirmed that HTML and PS output are fine. If I use
ps2pdf to convert the PS to PDF, then the PDF also renders
fine.</div>
<div><br>
</div>
<div>I *am* using multiple cairo contexts at the same time to
draw those things. But trying to use just one context for
all didn't seem to change anything.</div>
<div><br>
</div>
<div>Any help / advice is appreciated. PDF attached.</div>
</div>
<div><br>
</div>
<div>
<div dir="ltr" class="gmail_signature"
data-smartmail="gmail_signature">behdad<br>
<a href="http://behdad.org/" target="_blank"
moz-do-not-send="true" class="moz-txt-link-freetext">http://behdad.org/</a></div>
</div>
</div>
</blockquote>
<p><br>
</p>
</body>
</html>