diff options
author | Attila Szűcs <attila.szucs@collabora.com> | 2023-11-15 07:04:32 +0100 |
---|---|---|
committer | Caolán McNamara <caolan.mcnamara@collabora.com> | 2023-11-22 11:10:08 +0100 |
commit | 3a5cc107efb843b01193230c56dc8d9c0072348a (patch) | |
tree | 02ac37f0a57475c8eeea444a731270555b13a98b /include | |
parent | 223d2fac61e061478721a7a4a89b1362f5037d8f (diff) |
tdf#148000 impress: improve fontwork text placement.
Improved the calculation of positions of text characters for multi-line texts.
The previous version only fitted the text to the basic outline (curve), and then scale them to the appropriate text line.
This means that the text will be wider or shorter, depending on the shape of the curve, and which line it is on
Now it calculates a curve for each paragraph and fits text on it.
Text will be approximately the same width on each line.
Except if the text is wider as the curve. Because then it shrinks the text to fit on the curve. (this can only happens on inner curves)
Reused the same compat flag that was used in bug148000, now it serves
as a Powerpoint compatible mode for FontWork, so no need to create new
compat flag every time FontWork has improve.
That means that the Fontwork in old documents has remains the same
Refactored horizontal/vertical alignment, but had to keep the old hacks
as well.
Note: if there are too many lines of text, and the vertical alignment causes internal curves, then curves can shrink to 0 length (center point of a circle) or even to negative length,
These cases are impossible to display normally, so it will be glitchy
similar to how it was before this patch.
MS PowerPoint avoid these cases by not allowing vertical alignments that
would result internal (smaller) curves.
Added unittest to check legacy-odb / new-odp / pptx file.
It change the display of fontwork, so in some cases it may feel like
a regression.
Change-Id: Iac2d9bc751bbc2b6f747c33958f969cb3543fae5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159776
Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/svx/compatflags.hxx | 2 | ||||
-rw-r--r-- | include/tools/poly.hxx | 1 |
2 files changed, 2 insertions, 1 deletions
diff --git a/include/svx/compatflags.hxx b/include/svx/compatflags.hxx index f7d021f17bf7..9a64bd2bab80 100644 --- a/include/svx/compatflags.hxx +++ b/include/svx/compatflags.hxx @@ -11,7 +11,7 @@ enum class SdrCompatibilityFlag { AnchoredTextOverflowLegacy, ///< for tdf#99729 - LegacySingleLineFontwork, ///< for tdf#148000 + LegacyFontwork, ///< for tdf#148000 false == Fontwork works in PowerPoint compat mode ConnectorUseSnapRect, ///< for tdf#149756 IgnoreBreakAfterMultilineField, ///< for tdf#148966 }; diff --git a/include/tools/poly.hxx b/include/tools/poly.hxx index 77653d23bda7..24705f6c9e3c 100644 --- a/include/tools/poly.hxx +++ b/include/tools/poly.hxx @@ -114,6 +114,7 @@ public: void SetSize( sal_uInt16 nNewSize ); sal_uInt16 GetSize() const; + sal_uInt16 size() const { return GetSize(); } //for vector compability void Clear(); |