Repository navigation
Prepend bold/italic styles for XHTML B/I elements (issue 22023) - #22083
Open
cestercian wants to merge 1 commit into
Open
cestercian wants to merge 1 commit into
cestercian wants to merge 1 commit into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #22083 +/- ##
=======================================
Coverage 90.30% 90.30%
=======================================
Files 269 269
Lines 67362 67363 +1
=======================================
+ Hits 60828 60835 +7
+ Misses 6534 6528 -6
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Snuffleupagus
left a comment
Collaborator
There was a problem hiding this comment.
#22023 (comment) outlines a another possible, and shorter, solution. Would that work instead?
B and I called measure.pushFont in $pushGlyphs, but TextMeasure never had that method, so rich text with <b> or <i> in an auto-sized field failed during layout. Prepend font-weight:bold / font-style:italic in the constructors (so explicit overrides like font-weight:normal still win) and drop the $pushGlyphs overrides, letting the existing XhtmlObject path handle measurement and rendering.
cestercian
force-pushed
the
xfa-rich-text-push-font
branch
from
October 7, 2026 01:12
b9b6390 to
11e274b
Compare
Author
|
@Snuffleupagus Good call, thanks. Switched to the shorter style-prepend approach from that issue comment: |
TextMeasure.prototype.pushFont method (issue 22023)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.
BandIcalledmeasure.pushFont()in$pushGlyphs, butTextMeasurenever had that method, so laying out rich text with<b>or<i>in an auto-sized field threw and the whole form failed to render.Following the shorter approach from #22023 (comment): prepend
font-weight:bold/font-style:italicin theBandIconstructors (so explicit styles likefont-weight:normalstill win) and drop their$pushGlyphsoverrides, letting the existingXhtmlObjectpath handle measurement and rendering.Added a unit test with bold and italic rich text in a draw without a height; it fails without the change.
Fixes #22023