Bug 153158 - fontconfig alias not respected on SVG import
Summary: fontconfig alias not respected on SVG import
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Draw (show other bugs)
Version:
(earliest affected)
7.6.0.0 alpha0+
Hardware: All Linux (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: bibisected, bisected, filter:svg
Depends on:
Blocks: SVG-Import Font-Substitution
  Show dependency treegraph
 
Reported: 2023-01-23 11:18 UTC by Juang Dse
Modified: 2024-04-25 12:38 UTC (History)
6 users (show)

See Also:
Crash report or crash signature:


Attachments
svg file (1.91 KB, image/svg+xml)
2023-01-23 11:18 UTC, Juang Dse
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Juang Dse 2023-01-23 11:18:00 UTC
Created attachment 184844 [details]
svg file

In my fontconfig configuration the 'Linux Biolinum' font is aliased to 'Libertinus Sans', and programs like emacs and inkscape recognize this when importing the attached svg file. Draw, however, does not.

Version: 7.6.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: d04c197b436094844abfa5fb7c12e095165d2bca
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: en-US (en_US.UTF-8); UI: en-US
Calc: CL threaded
Comment 1 Buovjaga 2023-03-24 14:38:05 UTC
(In reply to Juang Dse from comment #0)
> Created attachment 184844 [details]
> svg file
> 
> In my fontconfig configuration the 'Linux Biolinum' font is aliased to
> 'Libertinus Sans', and programs like emacs and inkscape recognize this when
> importing the attached svg file. Draw, however, does not.

Can you give the steps to do the aliasing?

Set to NEEDINFO.
Change back to UNCONFIRMED after you have provided the information.
Comment 2 Juang Dse 2023-03-24 14:55:03 UTC
My ~/.config/fontconfig/fonts.conf file contains

-------
...
   <alias binding="same">
        <family>Linux Biolinum</family>
        <accept>
            <family>Libertinus Sans</family>
        </accept>
    </alias>
...
-------
Comment 3 Stéphane Guillou (stragu) 2023-04-25 10:16:42 UTC
I had to make sure the Linux Biolinum font was not installed on my system to reproduce.

On Ubuntu 20.04, I used the following in ~/.config/fontconfig/fonts.conf:

<?xml version='1.0'?>
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
<fontconfig>
	<alias binding="same">
	<family>Linux Biolinum</family>
	<accept>
    		<family>Andale Mono</family>
	</accept>
	</alias>
</fontconfig>

After a log out and back in, the font is substituted properly in Inkscape, but falls back to Liberation Sans in:

Version: 7.6.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 5cd9de202765e243e41416802f3e4486b8a96f16
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: threaded

This started in 6.1. Bibisected with linux-64-7.1 repository to first bad commit 2c183ed370c1e381ffaa14cb1507df84716333da which points to core commit:

commit 3ca7be09834a26fbd1c371deabd7a58111092676
author	Armin Le Grand <Armin.Le.Grand@cib.de>	Thu May 10 17:49:19 2018 +0200
committer	Armin Le Grand <Armin.Le.Grand@cib.de>	Fri May 18 20:11:35 2018 +0200
Replace SVGFilter using SVGIO
Reviewed-on: https://gerrit.libreoffice.org/54096

Armin, any chance you could have a look?
Comment 4 Julien Nabet 2023-04-29 11:53:54 UTC
(In reply to Stéphane Guillou (stragu) from comment #3)
> I had to make sure the Linux Biolinum font was not installed on my system to
> reproduce.
> 
> On Ubuntu 20.04, I used the following in ~/.config/fontconfig/fonts.conf:
> 
> <?xml version='1.0'?>
> <!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
> <fontconfig>
> 	<alias binding="same">
> 	<family>Linux Biolinum</family>
> 	<accept>
>     		<family>Andale Mono</family>
> 	</accept>
> 	</alias>
> </fontconfig>
> 
> After a log out and back in, the font is substituted properly in Inkscape,
> but falls back to Liberation Sans in:
> 
I did all this (+fc-cache -fv to force font cache recreation from scratch) but Inkscape still shows Linux Biolinum whereas I would expect it displays "Andale Mono". Did I miss something?
Comment 5 Julien Nabet 2023-04-29 11:56:04 UTC
Also the weird thing is I don't see anymore Linux Biolinum in LO.
Comment 6 Stéphane Guillou (stragu) 2024-04-25 02:10:22 UTC
(In reply to Julien Nabet from comment #4)
> I did all this (+fc-cache -fv to force font cache recreation from scratch)
> but Inkscape still shows Linux Biolinum whereas I would expect it displays
> "Andale Mono". Did I miss something?
If the font is unavailable, its name is still shown in the Text and Font tab, but crossed out with a red line. Can you see that? (Using Inkscape 1.3.1)

(In reply to Julien Nabet from comment #5)
> Also the weird thing is I don't see anymore Linux Biolinum in LO.
The test requires not having Linux Biolinum installed, so that would expected.

@Xisco, maybe you have an idea?
Comment 7 Julien Nabet 2024-04-25 08:05:21 UTC
(In reply to Stéphane Guillou (stragu) from comment #6)
> ...
> If the font is unavailable, its name is still shown in the Text and Font
> tab, but crossed out with a red line. Can you see that? (Using Inkscape
> 1.3.1)
> ...
I use Debian testing package Inkscape 1.2.2 and I see the name but it's not crossed out with red line.
Comment 8 Buovjaga 2024-04-25 08:52:20 UTC
(In reply to Julien Nabet from comment #7)
> (In reply to Stéphane Guillou (stragu) from comment #6)
> > ...
> > If the font is unavailable, its name is still shown in the Text and Font
> > tab, but crossed out with a red line. Can you see that? (Using Inkscape
> > 1.3.1)
> > ...
> I use Debian testing package Inkscape 1.2.2 and I see the name but it's not
> crossed out with red line.

Appimages are available for 1.3.x: https://inkscape.org/release/all/gnulinux/appimage/
Comment 9 Julien Nabet 2024-04-25 12:38:14 UTC
(In reply to Buovjaga from comment #8)
> (In reply to Julien Nabet from comment #7)
> Appimages are available for 1.3.x:
> https://inkscape.org/release/all/gnulinux/appimage/

Thank you for the idea. It's the first time Appimages, works well! :-)

(In reply to Julien Nabet from comment #7)
> > ...
> > If the font is unavailable, its name is still shown in the Text and Font
> > tab, but crossed out with a red line. Can you see that? (Using Inkscape
> > 1.3.1)
> > ...
> I use Debian testing package Inkscape 1.2.2 and I see the name but it's not
> crossed out with red line.
with 1.3.2 Inkscape AppImage, i confirm I see it with crossed out red line.