feat: add text stroke support following -webkit-text-stroke naming#43
Draft
feat: add text stroke support following -webkit-text-stroke naming#43
Conversation
|
|
Co-authored-by: zhanghaocong <180445+zhanghaocong@users.noreply.github.com>
Co-authored-by: zhanghaocong <180445+zhanghaocong@users.noreply.github.com>
Co-authored-by: zhanghaocong <180445+zhanghaocong@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Analyze text stroke effect feasibility
feat: add text stroke support (textStrokeWidth, textStrokeColor)
Mar 9, 2026
… naming Co-authored-by: zhanghaocong <180445+zhanghaocong@users.noreply.github.com>
…rder Co-authored-by: zhanghaocong <180445+zhanghaocong@users.noreply.github.com>
Copilot
AI
changed the title
feat: add text stroke support (textStrokeWidth, textStrokeColor)
feat: add text stroke support following -webkit-text-stroke naming
Mar 9, 2026
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.
Adds text stroke (文字描边) rendering, previously unsupported. Property names follow the
-webkit-text-strokeCSS convention with the vendor prefix removed.API
textStroke— shorthand, e.g."2px red"(parses either order:"red 2px"also works)textStrokeWidth— stroke width in pixelstextStrokeColor— stroke colorIndividual properties override the shorthand, matching CSS specificity behavior.
Changes
style-map.ts: AddtextStroke,textStrokeWidth,textStrokeColortoTextStylesparagraph.ts: Add properties toParagraphStyle, shorthand parser (parseTextStroke), and resolution logic incomputedStylegetterrender-text.ts: Forward all three properties toParagraphBuilder, register change listenerstext-line.ts: Emit aPaintStyle.strokepass before the fill pass when stroke is configuredparagraph.spec.ts: Tests for shorthand parsing, individual properties, override precedence, and edge casesOriginal prompt
🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.