Bug 166789 - SVG Export: text with "fit to size" attribute gets wrong width
Summary: SVG Export: text with "fit to size" attribute gets wrong width
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: filters and storage (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All All
: medium normal
Assignee: Mike Kaganski
URL:
Whiteboard: target:25.8.0 target:25.2.5
Keywords: filter:svg
Depends on:
Blocks: SVG-Save
  Show dependency treegraph
 
Reported: 2025-05-30 09:13 UTC by Mike Kaganski
Modified: 2025-06-02 07:15 UTC (History)
0 users

See Also:
Crash report or crash signature:


Attachments
A text with "fit-to-size" attribute set (2.24 KB, application/vnd.oasis.opendocument.graphics)
2025-05-30 09:13 UTC, Mike Kaganski
Details
A screenshot of the problem (64.50 KB, image/png)
2025-05-30 09:17 UTC, Mike Kaganski
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mike Kaganski 2025-05-30 09:13:16 UTC
Created attachment 201039 [details]
A text with "fit-to-size" attribute set

Open the attached FODG. It contains a single text box with a single line of text, which fits the text to the box size.
Export it to SVG.

Opening the resulting SVG in a browser will show the text using wrong horizontal scale; it will be wider that required, with some characters clipped on the right.
Comment 1 Mike Kaganski 2025-05-30 09:17:48 UTC
Created attachment 201040 [details]
A screenshot of the problem
Comment 2 Mike Kaganski 2025-05-30 09:56:47 UTC
https://gerrit.libreoffice.org/c/core/+/186033
Comment 3 Commit Notification 2025-05-30 14:35:12 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/a6eb3588d9717eb01c03bdc100565eb692362ded

tdf#166789: use text width from DXArray in MetaActionType::TEXTARRAY

It will be available in 25.8.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 4 Commit Notification 2025-06-02 07:15:41 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "libreoffice-25-2":

https://git.libreoffice.org/core/commit/08eb258f957baa4bf39ac2da4f417946995568b9

tdf#166789: use text width from DXArray in MetaActionType::TEXTARRAY

It will be available in 25.2.5.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.