Good workaround to the paragraph wrapping issues#244
Good workaround to the paragraph wrapping issues#244vincedarley wants to merge 11 commits intobash0:masterfrom
Conversation
- Implement rendering of <ul> and <li> HTML elements - Add proper hanging indent for list items that scales with font size - Include bullet character inside font styling to ensure visibility - Add validation to warn about unprocessed body children - Merge duplicate style attributes in preprocessor to fix CEWE XML bugs
- Skip drawing borders when color has alpha channel = 00 (transparent) - Parse ALIGNVCENTER from textFormat element and vertically center text in frame - Fixes cover page text rendering issues where transparent borders appeared black and text was not centered despite ALIGNVCENTER attribute
- Adjusted font size calculations in CreateParagraphStyle to include a font size adjustment factor. - Updated CollectFontInfo to preserve fractional font sizes and apply a global adjustment multiplier. - Improved formatting of font size in AppendSpanStart for consistent float representation. - Modified AppendItemTextInStyle to pass the font scale factor to CollectFontInfo for better font size management. - Added a .gitignore file to exclude IDE-specific files and directories from version control. - Fixes to vertical centering of text. Carefully tested this time.
…nd undesired text borders
|
Hi @vincedarley. I'm just trying to pull this PR into a branch of my fork, but am getting a strange message, see below. This happens both with the Github desktop and with Visual Studio. I'm wondering if it has something to do with the question mark at the end of the path it is complaining about. You work on Mac, right? On Windows a question mark in a file name is illegal. Any suggestions?
Aha, it seems to be a return character in the file name, as shown in the github web interface. Probably just displaying as a ? in the error message. But still not legal in Windows!
|
|
You correctly diagnosed the problem - weird return character that MacOS uses in a hidden Icon-for-directory thing. I've added that to .gitignore to avoid any future issues, and in fact that entire directory (.xmcf) is not required, so have also removed that. I believe you should now be able to test it. |


This seems to be caused by cewe2pdf rendering fonts with a slightly thicker stroke than CEWE's Qt renderer.
It is unclear why that is. However a workaround here is that we can compensate, only when
needed, by applying a 0.99^n scale factor to the font rendering. We do that up to n=3 times.
Generally it resolves the wrapping issue with n=1.
I've also fixed some vertical text centering & border issues.
This is pretty well tested now. I've carefully examined test pdf results visually, and the discrepancies that exist seem to be either (a) genuine improvements/fixes, or (b) visually indistinguishable pixel differences.
There is a new test added, which covers both vertical centering/borders and the paragraph text wrapping.
Text centering & borders issues:
Skip drawing borders when color has alpha channel = 00 (transparent)
Parse ALIGNVCENTER from textFormat element and vertically center text in frame
Fixes cover page text rendering issues where transparent borders appeared black and text was not centered despite ALIGNVCENTER attribute
Transparent borders appearing as black - When text areas have a border color with alpha channel = 00 (transparent), the border should not be drawn. Now checks the color format #RRGGBBAA and returns early if AA == 00. At least on my version of CEWE it seems to like creating a transparent text border when I tell it I don't want a border at all.
ALIGNVCENTER not being applied - Text with ALIGNVCENTER in the textFormat element was not being vertically centered. Now parses the textFormat child element (not attribute), checks for ALIGNVCENTER in the Alignment attribute, and applies proper vertical centering by shrinking the frame to text size and positioning it centered within the original area.