Bug 144988 - Fontwork has wrong size text, if it has more than one paragraph and font size is too large
Summary: Fontwork has wrong size text, if it has more than one paragraph and font size...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
5.4.7.2 release
Hardware: x86-64 (AMD64) Windows (All)
: medium normal
Assignee: Regina Henschel
URL:
Whiteboard: target:7.3.0 target:7.2.3
Keywords:
Depends on:
Blocks:
 
Reported: 2021-10-08 00:20 UTC by Regina Henschel
Modified: 2021-10-18 10:35 UTC (History)
0 users

See Also:
Crash report or crash signature:


Attachments
Fontwork examples (14.02 KB, application/vnd.oasis.opendocument.graphics)
2021-10-08 00:20 UTC, Regina Henschel
Details
Example for wrong rendering (14.66 KB, application/vnd.oasis.opendocument.graphics)
2021-10-16 14:16 UTC, Regina Henschel
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Regina Henschel 2021-10-08 00:20:55 UTC
Created attachment 175587 [details]
Fontwork examples

Open attached document. It has four Fontwork shapes. The style is set by an own style "myFontwork for testing". The font size is so, that the text fits into the width of the shape.
Now open the style and set the font size a little bit larger, e.g. to 28pt.

Notice, that the text in those shapes, which have two paragraphs, is wrongly rendered. The expected behavior can be seen in the examples with one paragraph. If the font size is so large, that the text block does not fit into the width of the bounding box of the path, then the font size used for rendering is decreased until it fits.

The path in these objects are one or two horizontal lines from left to right of the shape. The text-path-scale attribute is set to "shape", which corresponds to "ScaleX=true" in the property "TextPath" in property "CustomShapeGeometry".
Comment 1 Regina Henschel 2021-10-16 14:16:58 UTC
Created attachment 175786 [details]
Example for wrong rendering

The two Fontwork shapes have the same geometry. Only difference is, that one has the long paragraph as first paragraph and the other the short paragraph.

I think, the error is in lines #226 to #229 in EnhancedCustomShapeFontWork.cxx.

There the value (<1.0) from the first paragraph in fScalingFactor is replaced with the value (>1.0) from the second paragraph. But the "<1.0" value in fScalingFactor needs to be kept, because it indicates, that the rendering font size has to be reduced.

I have an idea for a solution, a patch will come.
Comment 2 Commit Notification 2021-10-17 12:05:01 UTC
Regina Henschel committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/3b922eb756d990c16944bbce42ae13142565a835

tdf#144988 correct font size in multiline Fontwork text

It will be available in 7.3.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 3 Commit Notification 2021-10-18 10:35:01 UTC
Regina Henschel committed a patch related to this issue.
It has been pushed to "libreoffice-7-2":

https://git.libreoffice.org/core/commit/460af321a84aae07f699e45700c212fcad50c38a

tdf#144988 correct font size in multiline Fontwork text

It will be available in 7.2.3.

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.