Bug 140138 - On export to SVG font substituted if OpenType features used
Summary: On export to SVG font substituted if OpenType features used
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Draw (show other bugs)
Version:
(earliest affected)
6.4.4.2 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: SVG-Save
  Show dependency treegraph
 
Reported: 2021-02-03 21:38 UTC by RGB
Modified: 2024-02-08 21:38 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
Sample SVG file (30.37 KB, image/svg+xml)
2021-02-03 21:38 UTC, RGB
Details
Original ODG file (it uses Libertinus Serif font) (10.40 KB, application/vnd.oasis.opendocument.graphics)
2021-02-03 21:40 UTC, RGB
Details
Exported SVG with no issue (deleted)
2022-02-07 12:16 UTC, Buovjaga
Details

Note You need to log in before you can comment on or make changes to this bug.
Description RGB 2021-02-03 21:38:20 UTC
Created attachment 169457 [details]
Sample SVG file

Suppose you create a drawing and associate some text to it. If you apply OpenType substitution tables to the text and export to SVG, the font is ignored and a substitution used, breaking the formatting. Notice that OpenType tags work within Draw, it's the export that fails.

Problem is present in 6.4 but also in 7.1

The attached SVG file was created with Draw. The first line in the left box was created using 

Libertinus Serif:smcp

as font. The third line was created selecting the word Superscript and applying 

Libertinus Serif:sups

as font to it. The right box was created with normal "character effects."

PDF export works as intended.
Comment 1 RGB 2021-02-03 21:40:03 UTC
Created attachment 169458 [details]
Original ODG file (it uses Libertinus Serif font)

The ODG file used to create the SVG export.
Comment 2 Buovjaga 2022-02-07 12:16:15 UTC
Created attachment 178115 [details]
Exported SVG with no issue

I get a different result and it seems fine. Already fine for me in the latest of 7.1 Linux bibisect repo.

Can you re-test it?

Arch Linux 64-bit
Version: 7.4.0.0.alpha0+ / LibreOffice Community
Build ID: 32c946c064cc2889bda2f46c1862e5100f0a257a
CPU threads: 8; OS: Linux 5.16; UI render: default; VCL: kf5 (cairo+xcb)
Locale: fi-FI (fi_FI.UTF-8); UI: en-US
Calc: threaded Jumbo
Built on 7 February 2022
Comment 3 Buovjaga 2022-02-07 12:20:10 UTC
The content of attachment 178115 [details] has been deleted for the following reason:

Mistake
Comment 4 Buovjaga 2022-02-07 12:21:16 UTC
Sorry, I did not have Libertinus installed. I reproduce that the left superscript is gone with the export.
Comment 5 QA Administrators 2024-02-08 03:13:04 UTC Comment hidden (obsolete)
Comment 6 RGB 2024-02-08 21:15:40 UTC
I can reproduce the problem with both: 

Version: 7.6.2.1 (X86_64) / LibreOffice Community
Build ID: 60(Build:1)
CPU threads: 8; OS: Linux 5.14; UI render: default; VCL: kf5 (cairo+xcb)
Locale: es-ES (es_ES.UTF-8); UI: es-ES
Calc: threaded

and

Version: 24.2.0.3 (X86_64) / LibreOffice Community
Build ID: da48488a73ddd66ea24cf16bbc4f7b9c08e9bea1
CPU threads: 8; OS: Linux 5.14; UI render: default; VCL: kf5 (cairo+xcb)
Locale: es-ES (es_ES.UTF-8); UI: es-ES
Calc: threaded
Comment 7 RGB 2024-02-08 21:38:32 UTC
Additional notes: the resulting SVG fails on any application OTHER than LibreOffice. For example, opening it on Inkscape or using it on a LaTeX document fails to use the right font when OpenType features are used. BUT, inserting the resulting SVG on a LibreOffice document seems to "work."

I opened the resulting SVG on a text editor and on line 36 I found this:

  <font-face font-family="Libertinus Serif:smcp embedded" units-per-em="2048" font-weight="normal" font-style="normal" ascent="1826" descent="503"/>

and then similar instructions on lines 52, 103, etc.

I know absolutely nothing about how SVG defines fonts, but using the "extended font name" there seems wrong. Maybe this problem is related with Bug 118417?