<div dir="ltr">Thanks Tobias. I think you nailed it. The font is indeed a stroke user-font on the cairo side.<div><br></div><div>So this is a cairo bug. I'll try to see if I can make sense of fixing it. Or Adrian can... I'll file a gitlab issue.</div><div><br></div><div>Thanks again.</div><div><br clear="all"><div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature">behdad<br><a href="http://behdad.org/" target="_blank">http://behdad.org/</a></div></div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Nov 30, 2023 at 10:12 AM Tobias Hoffmann <<a href="mailto:lcairo-list@thax.hardliners.org">lcairo-list@thax.hardliners.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div>
<div>Hello Behdad,</div>
<div><br>
</div>
<div>from your PDF, e.g.:<br>
</div>
<div>---</div>
<div>% Small pink circle left to the string
"Point causing kink..."<br>
</div>
<div>1 0 1 RG /a3 gs<br>
10 w<br>
1 J<br>
48 954 m 48 954 l S</div>
<div><br>
</div>
<div>% Text "Suggested new contour..."<br>
</div>
<div>0 0 0 rg /a0 gs</div>
<div>BT<br>
36 0 0 -36 80 911 Tm<br>
/f-1-0 1 Tf<br>
<2c192727110023112105171125050a1d17231d191a050023021a23052d1d141723>Tj<br>
ET<br>
---</div>
<div><br>
</div>
<div>1 0 1 RG sets the Stroking Color to
DeviceRGB pink,</div>
<div>0 0 0 rg sets the Non-Stroking Color to
DeviceRGB black. <br>
</div>
<div><br>
</div>
<div>Evince / XPDF / Chrome PDF Plugin
render the text with the non-stroking color, other views with the
stroking color...</div>
<div><br>
</div>
<div>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><br>
</div>
<div><br>
</div>
<div><br>
</div>
<div>On 28/11/2023 18:37, Behdad Esfahbod
wrote:<br>
</div>
<blockquote type="cite">
<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:ii_18c214bc94da76729f21" alt="image2.png" 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">behdad<br>
<a href="http://behdad.org/" target="_blank">http://behdad.org/</a></div>
</div>
</div>
</blockquote>
<p><br>
</p>
</div>
</blockquote></div>