office-gobmx/svgio
Khaled Hosny 3901e029bd tdf#104921: Cleanup Kashida insertion logic
Communicate Kashida insertion positions in an explicit way.

Rest of LibreOffice communicate adjustments to character widths (e.g.
for justification or spacing) using so-called DX array. DX array is an
array of absolute character positions (e.g. DX[n] is the position after
character n from the start of the lines, and its widths is DX[n] -
DX[n-1]).

This DX array is modified also when Kashidas are inserted after a given
character for Arabic justification, by expanding its width. VCL would
use this to know where to insert the Kashidas and how many ones.

But because DX array is used for both widths adjustments and kashida
insertion, this turns out to be a source of bugs since VCL has tosecond
guess the DX array to find which is pure width adjustment and which also
involves Kashida insertion, and the heuristics it uses are fragile.

This change adds a second array of booleans that records where Kashida
is inserted and communicates it all the way from where Kashida insertion
is decoded in Writer and down to VCL layout.

This change passes the Kashida array only when it seems necessary (e.g.
during drawing but not when measuring text since the DX array is enough
in this case). Hopefully no places where Kashida insertion needs to be
passed down were missed.

A couple of glyph and layout flags that were used for old heuristics and
no longer needed and are removed.

This also fixes:
tdf#87731
tdf#106309
tdf#108604
tdf#112849
tdf#114257
tdf#127176
tdf#145647
tdf#146199

Change-Id: I4ed0850ef2fdc3e9143341afac649e7e7d463c39
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138068
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
2022-08-14 21:10:24 +02:00
..
inc svgio: Add support for clip-rule="evenodd" 2022-07-29 08:21:59 +02:00
qa/cppunit tdf#150323: also add markers if there is a css style parent 2022-08-11 13:03:06 +02:00
source tdf#104921: Cleanup Kashida insertion logic 2022-08-14 21:10:24 +02:00
CppunitTest_svgio.mk
CppunitTest_svgio_read.mk
CppunitTest_svgio_tools.mk
IwyuFilter_svgio.yaml
Library_svgio.mk
Makefile
Module_svgio.mk
README.md
svgio.component

SVG Reader

Introduction

The svgio module is used to read SVG (Scalable Vector Graphics[1]) files. It is an XML based format for vector graphics.

This module contains svgio/source/svgreader which is used for embedding an SVG file with "Insert -> Picture -> From File".

SVG is an open standard provided by the World Wide Web Consortium (W3C).

[1] Scalable Vector Graphics

How does it work?

svgio module uses sax for reading xml and turns it into drawinglayer primitives. The rendering is done via drawinglayer primitives. For more information, you should refer to drawinglayer documentation.

Known Bugs

Known remaining bugs for this module are gathered here:

Dependencies

Direct dependencies for emfio are drawinglayer and sax.

References

Documentation for the SVG format is available on the W3C website: