Repository navigation
fix(core): paint automatic text white on a dark text box fill - #2153
Open
jamesashbourne-lawhive wants to merge 1 commit into
Open
jamesashbourne-lawhive wants to merge 1 commit into
jamesashbourne-lawhive wants to merge 1 commit into
Conversation
Text with an automatic color (w:color absent or auto, CT_Color, ECMA-376 Part 1, 17.3.2.6) takes its color from the background behind it. Run and paragraph shading already turned it white on a dark fill, but a text box fill (a:solidFill, 20.1.8.54) did not, so white headings on dark text box bars painted black. The text box content now paints automatic text white when the box fill is dark and black otherwise, with the same luma threshold as shading. Word decides it from the box's own fill, so a white or unfilled text box inside a dark cell keeps black text. Paragraph and cell shading (w:shd, 17.3.1.31 and 17.4.32) set automatic text white or black over the box, so a light cell inside a dark box stays readable, and a dark cell takes white text as in Word.
|
@jamesashbourne-lawhive is attempting to deploy a commit to the EigenPal Team on Vercel. A member of the Team first needs to authorize it. |
Contributor
|
All contributors have signed the CLA ✍️ ✅ Posted by the CLA bot. |
This branch has not been deployed
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.
Text with an automatic color has no
w:color, orw:val="auto", anywhere in its style chain. Word picks white or black for it from the background behind the run. The editor already does this for run shading and paragraph shading, but not for a text box fill, so automatic text in a dark text box painted black.We found this in a risk assessment form. Each section heading is a full-width text box with a dark red fill and bold heading text with no color. Word shows white headings. The editor showed black text on dark red, which is hard to read.
Behavior
w:color,CT_Color, ECMA-376 Part 1, §17.3.2.6) in a text box paints white when the box fill (a:solidFill, §20.1.8.54) is dark, and black when it is light or absent. The test is the same luma threshold that run and paragraph shading use (automaticTextColor).w:shd, §17.3.1.31 and §17.4.32) set automatic text white or black over the box. A light-shaded cell or paragraph inside a dark box stays black, and a dark-shaded cell takes white text, as Word shows it. Before, cell shading set no color, so automatic text in a dark cell painted black.docx-fidelity.mdxstates the rule under text and formatting.Tests
textbox-automatic-text-color.test.tsadds 9 paint tests on inline-XML text boxes.semantic-paint.tschanges.typecheck,lint,format:check,check:docs,check:parity,check:lane-boundaries,check:license-headers,i18n:validate,reference:check-citations,collaboration:check,api:check(afterbuild:packages), andopenspec validate typed-ooxml-paragraph-editor --strictpass.test:changedran 1517 files: 15695 tests pass.Collaboration
collaboration:checkasks for no decision. The change is in paint only. Shared state, operations, and synchronization are unchanged.Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.