forked from amazingfate/loongoffice
DXArray gives much more reliable data compared to font width, which is known to require complex corrections (see tdf#127471 and commit 3d33e4ce3987ea17e73a72e84f7f0df7af8101a6). This fix uses tspan's `lengthAdjust` and `textLength` attributes for automatic justification, which are already documented as early as in SVG 1.0 ( https://www.w3.org/TR/SVG10/text.html#TSpanElement ). This works in LibreOffice and in Chrome, but is not supported in Firefox yet ( see https://bugzilla.mozilla.org/show_bug.cgi?id=890692 ). I considered using these attributes on `text` element level, which is supported in both browsers - but that breaks text elements with multiple tspans. The `transform` attribute can't be used with tspan both in Chrome and in Firefox, which creates the same problem, and has an additional drawback that tspan offsets need tweaks. Change-Id: I7d4bbb7542a9d60e53bdf6f6cac7fae0729e6e48 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/186033 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> (cherry picked from commit a6eb3588d9717eb01c03bdc100565eb692362ded) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/186048 Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>