Export a slide from a ppt from LibreOffice Impress to SVG (file page9_LOImpress.svg).
Open it in Inkscape. It has a custom page size that is gigantic. Change the page size to A4 landscape. Select everything and shrink
it down to fit on the page. (file page9.svg).
Export to emf from Inkscape (file page9.emf).
Open page9.emf in Powerpoint. The fonts are HUGE.
Open page9.em in Inkscape. The fonts are still HUGE.
Am I doing something wrong with the resizing, or is this yet another emf export bug?
Inkscape 0.48.2 r9819 on Windows XP SP3
Thanks.
Mysterious huge text after resizing SVG from LOImpress
Mysterious huge text after resizing SVG from LOImpress
- Attachments
-
- page9_emf.zip
- EMF saved from Inkscape after resize to A4 page. (Is really emf, has .zip to allow the upload).
- (102.01 KiB) Downloaded 152 times
-
- page9.svg
- SVG saved by Inkscape after resized to A4 page
- (114.06 KiB) Downloaded 272 times
-
- page9_LOimpress.svg
- SVG exported by LO Impress
- (104.61 KiB) Downloaded 192 times
Re: Mysterious huge text after resizing SVG from LOImpress
(Note: native EMF export/import in Inkscape is only supported in the Windows port of Inkscape, and cannot be tested on other platforms. The supported features might be limited, and development or bug-fixes slow, because cross-platform features in Inkscape have higher priority).
IIRC LO scales the drawing by means of the 'viewBox' attribute [1]. You might have better results if you adjust/set the page size based on the 'viewBox' attribute in the SVG file (manually, by opening the file in a plain-text editor) before processing it for yet another conversion into other vector formats. At least such an exercise could give another hint where the scale of the text gets not adjusted properly.
In your example file export from LO, the labels inside the diagram are rasterized (the diagram in the center is an embedded bitmap, not vector). The remaining text is originally formatted as 'Times embedded' (referring to an embedded SVG font, a feature not supported by Inkscape for rendering). Did you try to assign a different font to the text objects - one that is installed on your system - before exporting to EMF?
[1] Last time I had a look, I was under the impression that LO got the scale/units "off" in SVG export by a factor of 100, but I could be wrong: the best solution to me at that time seemed to add width/height attributes to the top-level <svg> node based on the 'viewBox' attribute (to actually set a drawing scale): e.g. in your file 'page9_LOimpress.svg'to
Alternatively, one might try to delete the viewBox attribute itself before opening the file in Inkscape and rescaling the drawing content there manually to force the conversion from 1/100 of millimeters (as base unit) to millimeters (i.e. to fit inside a landscape A4 page).
I don't have LO installed yet to do further tests (currently in the process of migrating to a newer version of Mac OS X), so I can't further test the open-source part of your file conversion Odyssey. Don't own MS Office / Powerpoint either.
° Scalemathog wrote:Export a slide from a ppt from LibreOffice Impress to SVG (file page9_LOImpress.svg).
Open it in Inkscape. It has a custom page size that is gigantic. Change the page size to A4 landscape. Select everything and shrink it down to fit on the page.
IIRC LO scales the drawing by means of the 'viewBox' attribute [1]. You might have better results if you adjust/set the page size based on the 'viewBox' attribute in the SVG file (manually, by opening the file in a plain-text editor) before processing it for yet another conversion into other vector formats. At least such an exercise could give another hint where the scale of the text gets not adjusted properly.
° Text/fontmathog wrote:Export to emf from Inkscape (file page9.emf).
Open page9.emf in Powerpoint. The fonts are HUGE.
Open page9.em in Inkscape. The fonts are still HUGE.
In your example file export from LO, the labels inside the diagram are rasterized (the diagram in the center is an embedded bitmap, not vector). The remaining text is originally formatted as 'Times embedded' (referring to an embedded SVG font, a feature not supported by Inkscape for rendering). Did you try to assign a different font to the text objects - one that is installed on your system - before exporting to EMF?
[1] Last time I had a look, I was under the impression that LO got the scale/units "off" in SVG export by a factor of 100, but I could be wrong: the best solution to me at that time seemed to add width/height attributes to the top-level <svg> node based on the 'viewBox' attribute (to actually set a drawing scale): e.g. in your file 'page9_LOimpress.svg'
Code: Select all
viewBox="0 0 25400 19050"
Code: Select all
width="254mm" height="190.5mm" viewBox="0 0 25400 19050"
Alternatively, one might try to delete the viewBox attribute itself before opening the file in Inkscape and rescaling the drawing content there manually to force the conversion from 1/100 of millimeters (as base unit) to millimeters (i.e. to fit inside a landscape A4 page).
I don't have LO installed yet to do further tests (currently in the process of migrating to a newer version of Mac OS X), so I can't further test the open-source part of your file conversion Odyssey. Don't own MS Office / Powerpoint either.
Re: Mysterious huge text after resizing SVG from LOImpress
Could you test the attached SVG file (export to EMF and verify the text size in PPT or Inkscape)?
The attached file is based on your "page9.svg (SVG saved by Inkscape after resized to A4 page)", with these kinds of modifications:
The attached file is based on your "page9.svg (SVG saved by Inkscape after resized to A4 page)", with these kinds of modifications:
- The content was split into two (new) layers (text overlay, diagram (bitmap))
- The group for each text block was ungrouped (repeatedly), until there are only (invisible) rectangles and text objects left.
All text objects from the LO-generated SVG file are inside scaled (nested) groups, and - AFAICT - do not have an explicit font size style attribute in the SVG source (the size of the text objects seems to be set by scaling the parent groups.) - The font family attribute for the individual text objects was changed to existing fonts installed on the system:
'Times embedded' -> 'Times New Roman'
'Arial embedded' -> 'Arial' etc.
- Attachments
-
- page9-text-objects-ungrouped.svg
- (115.3 KiB) Downloaded 183 times
Re: Mysterious huge text after resizing SVG from LOImpress
~suv wrote:Could you test the attached SVG file (export to EMF and verify the text size in PPT or Inkscape)?
Tried this on my home system, so no powerpoint. Inkscape could not open the EMF it created (attached, with a fake .zip extension, so it would upload). Trying to open that resulted in a pop up:
Failed to load the requested file (long path)page9-text-ojects-ungrouped.emf
Was able to open it in OpenOffice 3.0 sdraw and ancient (circa 2002) versions of coreldraw and illustrator. In all cases the graphics had been lost but what was left was arranged similarly to the original. In CorelDraw the size of the font on the top line was 10.484 points and the 2nd line was 6.99 points. The svg opened in inkscape had 53.80 and 35.88 px for the same fonts, respectively.
- Attachments
-
- page9-text-objects-ungrouped_emf.zip
- emf generated, with .zip to sneak it into the upload
- (102.05 KiB) Downloaded 146 times
Re: Mysterious huge text after resizing SVG from LOImpress
~suv wrote:Alternatively, one might try to delete the viewBox attribute itself before opening the file in Inkscape and rescaling the drawing content there manually to force the conversion from 1/100 of millimeters (as base unit) to millimeters (i.e. to fit inside a landscape A4 page).
Tried this. The resulting SVG could be saved and reopened, however, the EMF it produced could not be reopened in Inkscape (same message as previous post). When opened in CorelDraw it had the huge fonts issue. The two attached files are the SVG after first deleting viewbox, opening in inkscape, and saving. Again, added .zip to smuggle the emf upload through.
Note, deleting the bitmap layer did not make the saved emf nontoxic for inkscape.
- Attachments
-
- page9_LOimpress_noviewbox_emf.zip
- Reopen SVG (no viewbox), save as EMF. Here smuggled with a false .zip extension
- (101.86 KiB) Downloaded 147 times
-
- page9_LOimpress_noviewbox.svg
- delete viewbox, open in Inkscape, resize to A4 landscape, save as svg
- (113.48 KiB) Downloaded 174 times
Re: Mysterious huge text after resizing SVG from LOImpress
Some discussion of the same issue on the LO side:
https://www.libreoffice.org/bugzilla/sh ... i?id=43060
One suggestion in that thread was to add explicit height/width
<svg version="1.1" viewBox="0 0 21000 29700"
to
<svg version="1.1" width="210mm" height="297mm" viewBox="0 0 21000 29700"
Mine was 25400 19050, so tried:
width="254mm" height="190mm" viewBox="0 0 25400 19050"
After that, when opened in Inkscape the drawing displayed at page size. However, when saved as EMF it still could not be reopened in Inkscape, and all of the programs which could open it (XP "preview", corel draw, Illustrator) had huge letters. In CorelDraw one of the letters (big H in Hemoglobin) had size 495.4 points, the paren in the next line down was 275.3 points.
https://www.libreoffice.org/bugzilla/sh ... i?id=43060
One suggestion in that thread was to add explicit height/width
<svg version="1.1" viewBox="0 0 21000 29700"
to
<svg version="1.1" width="210mm" height="297mm" viewBox="0 0 21000 29700"
Mine was 25400 19050, so tried:
width="254mm" height="190mm" viewBox="0 0 25400 19050"
After that, when opened in Inkscape the drawing displayed at page size. However, when saved as EMF it still could not be reopened in Inkscape, and all of the programs which could open it (XP "preview", corel draw, Illustrator) had huge letters. In CorelDraw one of the letters (big H in Hemoglobin) had size 495.4 points, the paren in the next line down was 275.3 points.
- Attachments
-
- page9_LOimpress_plus_w_h.svg
- added explicit width and height
- (104.65 KiB) Downloaded 180 times
Re: Mysterious huge text after resizing SVG from LOImpress
~suv wrote: The remaining text is originally formatted as 'Times embedded' (referring to an embedded SVG font, a feature not supported by Inkscape for rendering). Did you try to assign a different font to the text objects - one that is installed on your system - before exporting to EMF?
Just did that. It didn't make any difference. I just found that while inkscape cannot open the EMF it produces, it can preview it (strange), and in the preview the huge letters are shown.
In this example the Times embedded was changed to Times New Roman, and the Arial embedded to Arial. (Done with the GUI, not by editing the XML) On reopening the SVG that's how they show up in Inkscape, but the .svg still has "times embedded" and "arial embedded", even after a few rounds of vacuum defs/save.
- Attachments
-
- page9_LOimpress_plus_w_changefonts_emf.zip
- with changed fonts saved as EMF. fake .zip extension to allow upload
- (102.04 KiB) Downloaded 146 times
-
- page9_LOimpress_plus_w_changefonts.svg
- with changed fonts
- (113.97 KiB) Downloaded 254 times
Re: Mysterious huge text after resizing SVG from LOImpress
Apparently it isn't all SVGs created by Impress that have this problem. The attached simple.ppt was made entirely within LOImpress, then saved as an SVG. Even though it has a large viewbox and an embedded font, it opens just fine in Inkscape, without needing any surgery on the SVG file first. Once opened, it can be saved as an EMF, and that EMF file also opens just fine in Inkscape, as well as back in LO Impress.
The problem file started out as a PowerPoint file. That may or may not be relevant though, it could have something to do with the elements present, rather than the program that originally created them.
The problem file started out as a PowerPoint file. That may or may not be relevant though, it could have something to do with the elements present, rather than the program that originally created them.
- Attachments
-
- simple_emf.zip
- Inkscape export to emf (emf, not really .zip). No font size problems.
- (8.85 KiB) Downloaded 146 times
-
- simple.svg
- export to svg from LOImpress from simple.ppt.
- (14.01 KiB) Downloaded 288 times
-
- simple_ppt.zip
- One slide, made entirely in LOImpress (ppt, not really .zip)
- (70.5 KiB) Downloaded 176 times
Re: Mysterious huge text after resizing SVG from LOImpress
Oops, forget what I just said above. It fit the page, but the page size was huge. Change page size to A4, resize contents to fit, save as SVG and EMF, and the fonts are huge in the EMF. See the attached two files, after adjusting the size to A4 landscape, and then after saving as EMF. Luckily this simple example can be reopened in Inkscape after being saved as EMF.
After resizing to fit A4 the font size is 22.87 px, which is about right (18 * 1.25 = 22.5). Save to EMF, open again, and it is 634.9px. In the original SVG saved from LOImpress, the first time it was opened in Inkscape, before resizing, the font size was 635 px. So it seems that the font size is not being adjusted in the EMF save, but it is in the SVG save. Perhaps the former is skipping a transform step that the SVG honors?
Again, selecting the text, changing the font from Arial embedded to Arial does not "take" fully, as the "Arial embedded" is still in the SVG, even though it isn't shown as the fault being used by Inkscape.
After resizing to fit A4 the font size is 22.87 px, which is about right (18 * 1.25 = 22.5). Save to EMF, open again, and it is 634.9px. In the original SVG saved from LOImpress, the first time it was opened in Inkscape, before resizing, the font size was 635 px. So it seems that the font size is not being adjusted in the EMF save, but it is in the SVG save. Perhaps the former is skipping a transform step that the SVG honors?
Again, selecting the text, changing the font from Arial embedded to Arial does not "take" fully, as the "Arial embedded" is still in the SVG, even though it isn't shown as the fault being used by Inkscape.
- Attachments
-
- simple_a4_emf.zip
- after adjustment to A4, then save as emf (emf, not really .zip)
- (7.84 KiB) Downloaded 147 times
-
- simple_a4.svg
- After page size adjusted to A4 and saved as svg from inkscape
- (19.56 KiB) Downloaded 165 times