You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Text rendering modes 4-7 paint nothing and never clip #137
paintGlyph (text.go:243-253) paints a glyph only when the text rendering mode is fill (0), stroke (1) or fill-then-stroke (2). Modes 4, 5 and 6 (fill, stroke, or fill-then-stroke, each also adding the glyph to the clip) are not painted at all. Mode 7 (add to clip only) adds nothing to the clip either.
PDF 32000-1:2008 §9.3.6, Table 106: modes 4–6 paint exactly like 0–2, and also add the glyph outlines to the clipping path, which takes effect at the next ET. Mode 7 paints nothing and only adds to the clip.
Effect
Text set in modes 4–6 is invisible on the rendered page, where poppler and MuPDF show it.
Anything drawn after ET that should be clipped to the glyph shapes (the "image seen through the letters" effect, modes 4–7) is drawn unclipped.
Repro
A content stream with BT /F1 48 Tf 4 Tr 72 700 Td (Clip) Tj ET renders no ink, while 0 Tr renders the word.
Found while designing PDF to SVG output for go-pdfkit/bentogap (the SVG device will need the same mode handling).
Activity
feat: PageSVG, an SVG device behind the device seam
feat: PageSVG, an SVG device behind the device seam
feat: PageSVG, an SVG device behind the device seam (#140)