Dev3 pptx text wrap fix - kept updated - #267
Open
hiroshisuga wants to merge 15 commits into
Open
Conversation
…xes.py Omit the condition judging the Asian-Western letter adjacency. Texts with only western letters has the same problem.
🚨 Automated tests failed |
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.
What does this PR do?
This PR adds a pre-processing step of PPTX conversion to fix three textbox problems that break the layout of slides.
Closes Issue(s)
Closes #
Motivation
Problems addressed here are:
LibreOffice sometimes did not recalculate text boxes configured to resize to fit their contents during headless PPTX-to-PDF conversion. As a result, text that should remain on one line was wrapped unnecessarily.
Some PPTX files omit explicit marL and indent values for bullet paragraphs. PowerPoint and LibreOffice interpret these omitted values differently, causing wrapped bullet lines to start at the wrong horizontal position and changing line breaks. This typically happens when a user convert an old ppt file to pptx. I have not encountered it when working on a pptx from the beginning. But it may happen also in other cases (like copying an old slide to a pptx file) because omitting these settings is not banned in the OOXML format.
LibreOffice could insert additional spacing between Japanese (and perhaps other Asian) text and Latin letters or numbers. This increased the effective text width and sometimes caused additional line wrapping.
Solution: a PPTX-specific conversion step was added before PDF export as follows:
These corrections are applied before exporting the presentation from the same in-memory LibreOffice document.
You can omit this pre-processing by adding options as indicated as the comment in run-pptx-fixes-in-container.sh.
This PR could also be applied after the PPTX animation expansion (PR bigbluebutton#25422). The merged PR sample is #269.
How to test
sample.pptx
sample_preprocess.pdf
sample_nopreprocess.pdf
The problem 1 and 2 happen also in Latin text presentation.
english_bullet_implicit_indent_example_final.pptx
More
LibreOfficeでは文字位置がわずかに下がる現象も確認。現在のところ原因不明。アンダーラインの有無は関係なさそう。
underline.pptx
Posted as an issue bigbluebutton#25462 and a PR bigbluebutton#25463.
[Additional problem and its solution - removing the trailing spaces] 27 July 2026
Problem: PowerPoint ignores trailing normal or full-width spaces when calculating line wrapping, but LibreOffice may include them in the line width. As a result, text that fits on one line in PowerPoint can wrap onto a second line in LibreOffice.
Solution: Trim trailing normal spaces (U+0020) and full-width spaces (U+3000) from each DrawingML paragraph before opening the PPTX in LibreOffice. The existing bullet indentation normalization remains unchanged and runs independently.
Example pptx:
ICT2.pptx
ICT.pptx