Repository navigation
Place the caption outline outside the letter - #14
Merged
Merged
Conversation
A text stroke is centred on the glyph edge. Half its width is inside the letter, always, and the only thing left to decide is which half gets painted over — either the outline eats the letterform, or it shows at half the width the author asked for. Neither is an outline around the outside of a word. Placing it needs Paint rather than style, and Text Flow already has that vocabulary: a stroke layer carries `placement`, and the renderer builds the ring by dilating the glyph's alpha and subtracting the glyph from it. Nothing of the letter is spent. Plain text elements could not say this, so they now carry the same `paints` the Text Flow element does — the same type, validated by the same assertion, drawn by the same filters. Caption Fine keeps its per-word elements, its karaoke layers and its Pill exactly as they were. Measured on "Coffee" at size 64 through the real pipeline, with the outline at 8px: the letter body is 2957 pixels with the outline and 2957 without it, to the pixel, while the ring adds 9345 outside. The centred stroke it replaces showed 3044 — half the width, because that is all a centred stroke can show. Two smaller things fall out. A filter layer now sets `text-shadow:none`, because it shapes itself from its own alpha and an inherited shadow would be dilated into the outline. And a plain text element may not declare Paint beside a raw stroke style, since that is two ways to say one thing and both would draw. Known limit: shadow, glow and long shadow stay CSS text-shadow — long shadow is up to 32 stacked shadows and the IR shadow Paint is one offset — so they paint above the ring rather than beneath it. Outline and shadow are both dark in every recipe here, so it does not show; a light shadow over a dark outline would. Co-Authored-By: Claude <[email protected]>
overlordkim
pushed a commit
that referenced
this pull request
Sep 9, 2026
Place the caption outline outside the letter
overlordkim
pushed a commit
that referenced
this pull request
Sep 9, 2026
Place the caption outline outside the letter
SanHsien
referenced
this pull request
in SanHsien/hypit
Oct 24, 2026
Co-Authored-By: Claude Opus 5.5 <[email protected]>
SanHsien
referenced
this pull request
in SanHsien/hypit
Oct 24, 2026
* fix: remove ReDoS in markup references and double unescaping in video attributes - markup: REFERENCE's character class already contains ".", so the trailing (\.X*)* group only added exponential backtracking. The simplified pattern accepts exactly the same strings (exhaustively checked for all strings up to length 6 over a small alphabet). - provider-hyperframes-local: decode & last so "&lt;" yields "<" instead of "<". - Record both fixes in docs/fork/DECISIONS.md. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01LzPwoJBKJ97mwPJq3Uohmv * test(markup): express the original reference grammar without a regex The oracle regex in the test reintroduced the js/redos pattern that CodeQL flags; check the same language character by character instead. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01LzPwoJBKJ97mwPJq3Uohmv * docs(fork): record CodeQL alert numbers #12 and #14 Co-Authored-By: Claude Opus 5.5 <[email protected]> * docs(fork): keep CodeQL alert numbers only in the table Co-Authored-By: Claude Opus 5.5 <[email protected]> --------- Co-authored-by: Claude <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The previous change put the caption's centred stroke behind the fill, which stopped it eating the letterform but left it showing at half the authored width — and did nothing at all when the fill is a gradient, because a gradient fill is a
background-clip: textbackground andpaint-orderonly orders the text's own fill and stroke. Both are symptoms of the same thing: a text stroke is centred on the glyph edge, so half its width is inside the letter no matter what, and the only remaining choice is which half gets painted over.Placing an outline needs Paint rather than style. Text Flow already has that vocabulary — a stroke layer carries
placement, and the renderer builds the ring by dilating the glyph alpha and compositing the glyph out of it, so nothing of the letter is spent. Caption Fine could not reach it because it emits the plain text element, which had no Paint. That element now carries the samepaintsfield Text Flow does: the sameVisualTextPaintLayertype, the sameassertTextPaintvalidation, the same filters. Caption Fine keeps its per-word elements, karaoke layers and Pill unchanged.Measured
Rendered through the real pipeline at size 64, outline 8px, and counted from the framebuffer:
The body is identical to the no-outline baseline to the pixel — the outline takes nothing from the letter — and the ring is three times what a centred stroke could show at the same width.
The emitted document contains
feMorphology operator="dilate" radius="8"and theoutcomposite, and no-webkit-text-strokeanywhere.Also
text-shadow:none. It shapes itself from its own alpha, so a shadow inherited from the element around it would be dilated into the outline. This applies to Text Flow too, where it was latent.sizecloses the counters of a, e and o. That was describing the centred stroke; the outline now grows outward and what a heavy one closes is the gap between letters.Known limit
Shadow, glow and long shadow stay as CSS
text-shadow. Long shadow is up to 32 stacked shadows and the IR shadow Paint is a single offset, so they cannot move across without losing it. They therefore paint above the ring rather than beneath it. Every recipe in the repository uses a dark outline with a dark shadow, so it does not show; a light shadow over a dark outline would.Verification
pnpm check,pnpm test(544, 0 failures),pnpm test:release(8), andpnpm test:browser-visual(12 against a real browser) all pass.🤖 Generated with Claude Code