Bug 165732 - FILEOPEN PPTX: Text appears right aligned instead of centered
Summary: FILEOPEN PPTX: Text appears right aligned instead of centered
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Impress (show other bugs)
Version:
(earliest affected)
7.0 all versions
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: PPTX-Textbox
  Show dependency treegraph
 
Reported: 2025-03-14 01:29 UTC by Gerald Pfeifer
Modified: 2025-08-06 19:23 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
Sample slide (PPTX) (96.90 KB, application/vnd.openxmlformats-officedocument.presentationml.presentation)
2025-03-14 01:29 UTC, Gerald Pfeifer
Details
Visual comparison: PowerPoint (left) - Impress (right) (5.73 KB, image/png)
2025-03-14 01:29 UTC, Gerald Pfeifer
Details
Minimal experimentation file from PP (19.77 KB, application/vnd.openxmlformats-officedocument.presentationml.presentation)
2025-08-06 19:21 UTC, Gabor Kelemen (allotropia)
Details
The example file in PP and Impress side by side (53.64 KB, image/png)
2025-08-06 19:23 UTC, Gabor Kelemen (allotropia)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Gerald Pfeifer 2025-03-14 01:29:14 UTC
Created attachment 199803 [details]
Sample slide (PPTX)

Comparing the rendering of the sample slide between PowerPoint and
Impress, the latter appears to right align the text (a sole character,
the letter four) versus centering it.

Version: 25.8.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 477138a0570589e8dcecdbfe104a055f432638ce
CPU threads: 12; OS: Linux 6.13; UI render: default; VCL: gtk3
Locale: en-US (en_US.UTF-8); UI: en-US
Comment 1 Gerald Pfeifer 2025-03-14 01:29:48 UTC
Created attachment 199804 [details]
Visual comparison: PowerPoint (left) - Impress (right)
Comment 2 m_a_riosv 2025-03-14 01:47:14 UTC
Reproducible
Version: 25.8.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: bff3d755c8c11721054f4ff40a3d5f723b0c6b96
CPU threads: 16; OS: Windows 11 X86_64 (build 26100); UI render: Skia/Vulkan; VCL: win
Locale: es-ES (es_ES); UI: en-GB
Calc: CL threaded
Comment 3 Gabor Kelemen (allotropia) 2025-08-06 19:21:07 UTC
Created attachment 202216 [details]
Minimal experimentation file from PP

Here the issue is that the grey textbox is very small, 0.4 x 0.37 cm.
Then the inner margins are set as 0.19 cm left and right - together, they almost take up the 0.4 cm width of the textbox. And then there is a number to render...
so what should happen here?

Looks like PP tries to be more clever than the user, and when the inner margin size is too large, it prioritizes rendering the text, then some margin based on the opposite values given and the available space in the box:
- if there is more left margin given than right, it shows some more left margin
- if the left and right margins match, then it shows an equal amount of margin
- if there is more right margin given than left, it shows some more right margin

This algorithm is roughly mirrored in Impress, but for some reason when the left+right margins are (~about) equal, this algorithm seems to prefer the left side margin a bit more.

Here I have left and right margin set to equal sizes from 0 to 1 cm in 0.1 cm steps on copy-pasted shapes. Most cases, these look good, but something goes very bad in case of 0.2 cm (in the original, it was 0.19).
Comment 4 Gabor Kelemen (allotropia) 2025-08-06 19:23:46 UTC
Created attachment 202217 [details]
The example file in PP and Impress side by side