How can I fix the EMF text spacing in Mathematica 11?
For example
Export["an.emf",
a = Graphics[{{Yellow, Rectangle[{0, 0}, {240, 30}]},
{Black,
Inset[Style["Information table example",
FontSize -> 20], {0, 15}, {Left, 0}]}},
BaseStyle -> FontFamily -> "Franklin Gothic Book",
ImageSize -> 240, PlotRange -> {{0, 240}, {0, 30}}]];
Print[a]
The EMF produced by Mathematica 11 has irregular spacing
On the same PC Mathematica 7 produces the expected result
I am running Mathematica 11.0.1 and 7.0.1 on Windows 10 Pro.
Edit
Here is a better example to further illustrate the problem.
These tables were produced with the code below. Displayed in Mathematica they look fine.
First using the font "Franklin Gothic Book", then "Verdana".
However, when exported to EMF there are spacing problems.
- There is a big space between "Information" and "table" in the Franklin Gothic Book version.
- big spaces in "Category Item Text".
- irregular space between 1,234 and ,567.00
- big space between 123.456 and % which shouldn't be there at all
big space between (123.120 and ) which shouldn't be there
In the Verdana version no space in "CategoryItem" and no space in "CategoryText".
- the % and closing bracket in (123.12) are squashed to the preceding character.
As I mentioned earlier, the EMF exports from Mathematica 7 look perfect.
Code
a = Graphics[{GrayLevel[1],Rectangle[{-1,-60},{740,25}],
{{GrayLevel[1],Rectangle[{0,0},{739,25}]},
{Black,
Inset[Style["Information table example",FontSize->16,FontSlant->Italic],
{0,43/3},ImageScaled[{0,1/2}]]}},
{{GrayLevel[0.3],Rectangle[{0,0},{739,-35}]},
{GrayLevel[1],
{Inset[Style["Category Heading Text",FontSize->12,FontSlant->Italic],{6,-35/4},ImageScaled[{0,1/2}]],
Inset[Style["",FontSize->12,FontSlant->Italic],{6,-105/4},ImageScaled[{0,1/2}]]},
{{Inset[Style["First Column",FontSize->12,FontSlant->Italic],{190,-35/4}],
Inset[Style["Part One",FontSize->12,FontSlant->Italic],{190,-105/4}]},
{Inset[Style["Column Two",FontSize->12,FontSlant->Italic],{306,-35/4}],
Inset[Style["Part Two",FontSize->12,FontSlant->Italic],{306,-105/4}]},
{Inset[Style["%",FontSize->12,FontSlant->Italic],{404,-35/4}],
Inset[Style["",FontSize->12,FontSlant->Italic],{404,-105/4}]},
{Inset[Style["Column 4",FontSize->12,FontSlant->Italic],{989/2,-35/4}],
Inset[Style["",FontSize->12,FontSlant->Italic],{989/2,-105/4}]},
{Inset[Style["",FontSize->12,FontSlant->Italic],{1199/2,-35/4}],
Inset[Style["Type",FontSize->12,FontSlant->Italic],{1199/2,-105/4}]},
{Inset[Style["",FontSize->12,FontSlant->Italic],{1393/2,-35/4}],
Inset[Style["% Total",FontSize->12,FontSlant->Italic],{1393/2,-105/4}]}},
Inset[Style["Summary",FontSize->12,FontSlant->Italic],{642,-35/4}]}},
{{{GrayLevel[0.9],Rectangle[{0,-35},{739,-57}]},{Black,
Inset[Style["Category Item Text",FontSize->12],{6,-46},ImageScaled[{0,1/2}]],
{Inset[Style["1,234,567.00",FontSize->12],{233,-46},ImageScaled[{1,1/2}]],
Inset[Style["Category Text",FontSize->12],{349,-46},ImageScaled[{1,1/2}]],
Inset[Style["123.456%",FontSize->12],{429,-46},ImageScaled[{1,1/2}]],
Inset[Style["(123.120)",FontSize->12],{530,-46},ImageScaled[{1,1/2}]],
Inset[Style["Category Text",FontSize->12],{639,-46},ImageScaled[{1,1/2}]],
Inset[Style["10.7",FontSize->12],{724,-46},ImageScaled[{1,1/2}]]}}}},{GrayLevel[1],Rectangle[{652.9,-35},{655.1,-123}]},
{{GrayLevel[1],Rectangle[{130.9,0},{133.1,-123}]},
{GrayLevel[1],Rectangle[{246.9,0},{249.1,-123}]},
{GrayLevel[1],Rectangle[{362.9,0},{365.1,-123}]},
{GrayLevel[1],Rectangle[{442.9,0},{445.1,-123}]},
{GrayLevel[1],Rectangle[{543.9,0},{546.1,-123}]}}},
BaseStyle->FontFamily->"Franklin Gothic Book",ImageSize->739,
PlotRange->{{0,739},{-59,25}}]
Export["a.emf", a]