On Wed, Sep 02, 2020 at 07:45:44AM +0200, Cor Blom wrote:
> Op 01-09-2020 om 22:21 schreef Enrico Forestieri:
> > We already have an elegant solution. We rely on Qt to do the right thing
> > with QFontDatabase::addApplicationFont(), but on linux it does not work
> > right, contrarily to Windows (and I think MacOS) where it works well.
> > In this case it should suffice to directly add the lyx font directory
> > to the fontconfig paths. The fonts ditributed with lyx are a superset
> > of the texlive ones and could also replace them. However, this is not
> > necessary because we can find our fonts by requesting the style "LyX",
> > provided that fontconfig can find them.
> 
> I think I know why it does not work. The lyx fonts are installed in
> /usr/share/lyx/fonts and it looks to me this is kind of hardcoded, because
> "lyx -dbg font" only gives OK for me when the fonts are in that directory.
> 
> Fontconfig, however, does not look into that directory. So "fc-match -v
> "esint10: style=lyx" | grep file:" only give me the correct result when the
> lyx fonts are in /usr/share/fonts.
> 
> When I add /usr/share/lyx/fonts to the directories where fontconfig looks,
> then it all works as it should. I can solve this by adding a fontconfig
> configuration file to the package.
> 
> Does this sound right to you?

Yes, this is consistent with your observations and other reports. It means
that QFontDatabase::addApplicationFont() does not work on linux or, at
least, that it does not work with certain versions of fontconfig.

The fontconfig configuration file can be as simple as the attached one.
You will also have to run fc-cache on that directory after adding the
file, unless you reboot, of course.

-- 
Enrico
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<dir>/usr/share/lyx/fonts</dir>
</fontconfig>
-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel

Reply via email to