Bug 127005 - SVG export from Draw doesn't include correctly the font family
Summary: SVG export from Draw doesn't include correctly the font family
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Draw (show other bugs)
(earliest affected) release
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Not Assigned
Keywords: filter:svg
Depends on:
Blocks: SVG-Save
  Show dependency treegraph
Reported: 2019-08-18 11:18 UTC by Giancarlo
Modified: 2020-04-27 18:17 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:

test file (40.11 KB, image/svg+xml)
2019-08-19 16:31 UTC, Giancarlo
test file odg format (9.55 KB, application/vnd.oasis.opendocument.graphics)
2019-09-18 06:51 UTC, Giancarlo
test file svg export (75.21 KB, image/svg+xml)
2019-09-18 06:52 UTC, Giancarlo
test file expected rendering (52.44 KB, image/jpeg)
2019-09-18 06:55 UTC, Giancarlo
Svg generated from LO 6.3.1 Win (73.82 KB, image/svg+xml)
2019-09-18 14:46 UTC, Julien Nabet

Note You need to log in before you can comment on or make changes to this bug.
Description Giancarlo 2019-08-18 11:18:21 UTC
I need to show an SVG file in a HTML page 
I chose 
1942 report
font for my text;
when I exported to the SVG format I noticed that the font is substituted by another one.
Embracing the font name with ticks seems to solve the problem
font-family="1942 report" <--- wrong rendering
font-family="'1942 report'" <--- right rendering

Steps to Reproduce:
1. Write a text with 1942 Report font (I image that all family fonts with more then a word in it's name show the same behaviour) 
2. export to SVG
3. load the SVG in a browser

Actual Results:
the text font is sobstituted

Expected Results:
The text should be rendered with the rigth font

Reproducible: Always

User Profile Reset: No

Additional Info:
Comment 1 Julien Nabet 2019-08-18 15:04:39 UTC
What option do you use to export in svg?
Indeed, I don't see svg format in "Save as" or "export"
Comment 2 Julien Nabet 2019-08-18 15:05:56 UTC
Forget my previous comment, I must use Draw instead of Writer.
Comment 3 Julien Nabet 2019-08-18 15:10:31 UTC
On pc Debian x86-64 with LO Debian package, I don't reproduce this.

I created a brand new odg file, insert a Text box and typed "test" in it with font "Liberation Sans embedded"

svg file shows:
<font-face font-family="Liberation Sans embedded" units-per-em="2048" font-weight="normal" font-style="normal" ascent="1852" descent="423"/>
font-family="Liberation Sans, sans-serif" font-size="635px"

Do you reproduce this with a brand new file and another font included in LO containing some spaces?
Comment 4 Giancarlo 2019-08-19 07:56:50 UTC
The problem seems to be present only with that font. Unfortunately I don't have other font with numbers in the name. 
I'll try to download and use another font that have numbers in its first part name.
Comment 5 Julien Nabet 2019-08-19 08:07:48 UTC
On Win10 with LO 6.2.5 + font retrieved from https://www.dafont.com/fr/1942-report.font, I don't reproduce this.

font-family="1942 report embedded"
font-family="1942 report, monospace"
Comment 6 Julien Nabet 2019-08-19 08:25:26 UTC
I uninstalled LO 6.2.5 and installed, I still don't reproduce this :-(

Would it be possible you attach the original file so I try to convert it?
Comment 7 Giancarlo 2019-08-19 14:18:37 UTC
giancarlo orru
4:16 PM (0 minutes ago)
to bugzilla-daemon

I put two text using 2 differente fonts that have font family that starts with numbers.
The problem is shown for both text box in chrome.
At this point the bug seems to be in the svg parser: both chrome and edge (in windows and surely chrome in ubuntu) show the same problem.
Changing the svg code by hand in this way solve the problem
<tspan xmlns="http://www.w3.org/2000/svg" class="TextParagraph" font-family="'1942 report', monospace" font-size="1693px" font-weight="400"><tspan class="TextPosition" x="1950" y="3401"><tspan fill="rgb(0,0,0)" stroke="none">Prova 1942</tspan></tspan></tspan>

How can I attach the example file?
Comment 8 Julien Nabet 2019-08-19 14:22:39 UTC
To attach a file, just click on https://bugs.documentfoundation.org/attachment.cgi?bugid=127005&action=enter
Comment 9 Giancarlo 2019-08-19 16:31:04 UTC
Created attachment 153511 [details]
test file
Comment 10 Julien Nabet 2019-09-17 19:35:16 UTC
You attached result file since it's the svg. We need the original file, with odg  extension.
The goal is to export it at SVG and try to reproduce this.
Comment 11 Giancarlo 2019-09-18 06:51:36 UTC
Created attachment 154241 [details]
test file odg format
Comment 12 Giancarlo 2019-09-18 06:52:22 UTC
Created attachment 154242 [details]
test file svg export
Comment 13 Giancarlo 2019-09-18 06:55:02 UTC
Created attachment 154244 [details]
test file expected rendering
Comment 14 Julien Nabet 2019-09-18 14:46:00 UTC
Created attachment 154263 [details]
Svg generated from LO 6.3.1 Win

On Win10 with LO 6.3.1, I generated the svg.
If I open it on IE, font 1942 appears but it's not the case if I use Firefox.
Comment 15 Deandre Jordan 2019-12-20 05:24:04 UTC Comment hidden (spam)
Comment 16 Buovjaga 2020-04-27 18:17:58 UTC
(In reply to Julien Nabet from comment #14)
> Created attachment 154263 [details]
> Svg generated from LO 6.3.1 Win
> On Win10 with LO 6.3.1, I generated the svg.
> If I open it on IE, font 1942 appears but it's not the case if I use Firefox.

Ok, so the font data is saved, but unfortunately this technology is abandoned and obsolete. Firefox will likely never implement it, see the yellow note box here: https://developer.mozilla.org/en-US/docs/Web/SVG/Tutorial/SVG_fonts