Skip to content

html: honour text color alpha (transparent -> invisible text) - #287

Merged
fschutt merged 2 commits into
masterfrom
claude/nice-bardeen-hjit6y
Oct 2, 2026
Merged

fschutt merged 2 commits into
masterfrom
claude/nice-bardeen-hjit6y

Conversation

@fschutt

@fschutt fschutt commented Sep 30, 2026

Copy link
Copy Markdown
Owner

The bridge built text fill colors from the RGB channels only, so color: transparent rendered opaque black and rgba(..., a) rendered fully opaque. OCR text layers (transparent spans over a page scan) came out as black text on top of the image.

Text runs with a < 255 now render in their own q/Q scope: a == 0 uses text rendering mode 3 (invisible but selectable/extractable), 0 < a < 255 loads a fill-alpha ExtGState. Opaque runs are unchanged. The glyph-run inline background pass gets the same ExtGState treatment.

Claude-Session: https://claude.ai/code/session_01GPPrSydyY9syEfGC74Kch2

… ExtGState)

The bridge built text fill colors from the RGB channels only, so
`color: transparent` rendered opaque black and `rgba(..., a)` rendered
fully opaque. OCR text layers (transparent spans over a page scan) came
out as black text on top of the image.

Text runs with a < 255 now render in their own q/Q scope: a == 0 uses
text rendering mode 3 (invisible but selectable/extractable), 0 < a < 255
loads a fill-alpha ExtGState. Opaque runs are unchanged. The glyph-run
inline background pass gets the same ExtGState treatment.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GPPrSydyY9syEfGC74Kch2
fschutt pushed a commit to fschutt/pdfocr that referenced this pull request Sep 30, 2026
…tches

printpdf comes from fschutt/printpdf#287 (text honours color alpha) as a
git dependency; azul-css from fschutt/azul#480 (invalid selectors drop
their rule) via [patch.crates-io]. azul-core/-layout stay on 0.0.16:
azul master's azul-layout does not build with printpdf's feature set.
Cargo.lock is committed so the exact upstream commits are pinned, and CI
builds with --locked. patches/ is removed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GPPrSydyY9syEfGC74Kch2
…kept beside this one)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WyGP18BMbfHvnTRYqNVjbP
@fschutt
fschutt merged commit 5cc7cfd into master Oct 2, 2026
49 checks passed
fschutt added a commit that referenced this pull request Oct 2, 2026
…r alpha)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WyGP18BMbfHvnTRYqNVjbP
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants