problem with vml-shape-types file
vmiklos at collabora.com
Mon Jan 9 09:34:34 UTC 2023
On Sat, Jan 07, 2023 at 10:11:46PM +0100, Regina Henschel <rb.henschel at t-online.de> wrote:
> The vml-shape-types file is used, when a shape is exported to VML. If I
> understand it correctly, then this file is generated from
> presetShapeDefinitions.xml and presetTextWarpDefinitions.xml respectively by
> preset-definitions-to-shape-types.pl script. The file itself is located in
> <installation directory>/share/filter, not in repository (Why?).
preset-definitions-to-shape-types.pl generates vml-shape-types from XML
files which are part of the OOXML spec. It seems logical to generate
such data only once at build-time (as opposed to generating it every
time at runtime), but we tend to not add such generated data to git.
> This file does not work for handles in Fontwork shapes. The problem is the
> position attribute of a handle:
> (A) The reference to the adjustment value is made by a reference to a
> formula (@), but it needs to be a reference to the adjustment value itself
> (B) The positions left, right, top, bottom, center are written with numbers
> 0, 10800 and 21600. But it need to be topLeft, center, bottomRight.
> VML is needed for export of Fontwork shapes with fill other than solid or
> gradient, because such fill cannot be expressed with Words "abc Transform".
> Therefore I need a way to get correct VML shapetype markup for Fontwork
> shapes. There exist 40 types of Fontwork shapes in
> presetTextWarpDefinitions.xml. All of them have handles.
> There are 8 binary WordArt shapes, where the relationship to the shapes in
> presetTextWarpDefinitions.xml is unclear.
> I could manually make a file for the markup of the WordArt shapetypes and
> use that. I'm not familiar with Perl scripts.
> Better ideas or suggestions?
I'm not an expert in perl, either, but hopefully with a bit of
experimenting you can tweak
oox/source/export/preset-definitions-to-shape-types.pl so that when it's
invoked with the --vml-shape-types-data switch, then it outputs the
markup that you would want.
My expectation is that the tricky part is not perl but to find out how
the mapping from drawingML presets to VML markup goes wrong.
> BTW, Word uses VML WordArt, when it opens a doc file with binary WordArt or
> opens an odt file with custom-shape with textpath on. And it keeps it as
> VML, when converting the file to docx, even if it would be possible to use
> "abc Transform". But that is a -not jet fixed- import problem and not
> effected by the above mentioned file.
I guess it affects the VML export all the time, just Word >= 2010
ignores VML if there is drawingML for a shape.
More information about the LibreOffice