display of $int...$ under QT5
Enrico Forestieri
forenr at lyx.org
Wed Sep 2 12:39:12 UTC 2020
On Wed, Sep 02, 2020 at 12:16:19PM +0200, Cor Blom wrote:
> Op 02-09-2020 om 11:45 schreef Enrico Forestieri:
> > On Wed, Sep 02, 2020 at 10:33:03AM +0200, Enrico Forestieri wrote:
> [...]
> > >
> > > This is to be expected, because the fonts should be seen only by lyx. This
> > > is how QFontDatabase::addApplicationFont() should work. It is the fact that
> > > you don't see some glyphs that indicates the failure.
> > >
> > > However, it would be interesting if you could report the result of the
> > > attached patch. This is a patch for lyx 2.3, the corresponding patch for
> > > the development version 2.4 can be found as an attachment to another email
> > > in this thread. It should show which font file lyx uses for math fonts.
> > > You will have to configure lyx using LIBS=-lfontconfig, i.e.,
> > >
> > > configure [your usual options here] LIBS=-lfontconfig
> > >
> > > After building lyx, create a new document and then a math inset.
> > > You should then see all used font files printed in the terminal.
> > >
> > > If you do not add /usr/share/lyx/fonts to the fontconfig directories
> > > (make sure that "fc-match -v 'esint10: style=lyx' | grep file:" does
> > > not return the "correct" result) and no fonts in /usr/share/lyx/fonts
> > > are spotted, we can be sure that QFontDatabase::addApplicationFont()
> > > does not work.
> >
> > I just checked it, and it works on debian. They package separately the
> > fonts in the package fonts-lyx. With this package installed, I get
> >
> > $ fc-match -v "esint10: style=regular" | grep file:
> > file: "/usr/share/fonts/truetype/lyx/esint10.ttf"(w)
> >
> > while, uninstalling it, I get
> >
> > $ fc-match -v "esint10: style=regular" | grep file:
> > file: "/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf"(w)
> >
> > However, applying the above patch, without the fonts-lyx package I get
> >
> > Filename: /usr/local/src/lyx/lyx-stable/lib/fonts/eufm10.ttf (family eufm10, style LyX)
> > Filename: /usr/local/src/lyx/lyx-stable/lib/fonts/cmsy10.ttf (family cmsy10, style LyX)
> > Filename: /usr/local/src/lyx/lyx-stable/lib/fonts/cmmi10.ttf (family cmmi10, style LyX)
> > Filename: /usr/local/src/lyx/lyx-stable/lib/fonts/cmr10.ttf (family cmr10, style LyX)
> > Filename: /usr/local/src/lyx/lyx-stable/lib/fonts/cmex10.ttf (family cmex10, style LyX)
> > Filename: /usr/local/src/lyx/lyx-stable/lib/fonts/msam10.ttf (family msam10, style LyX)
> > Filename: /usr/local/src/lyx/lyx-stable/lib/fonts/msbm10.ttf (family msbm10, style LyX)
> > Filename: /usr/local/src/lyx/lyx-stable/lib/fonts/wasy10.ttf (family wasy10, style LyX)
> > Filename: /usr/local/src/lyx/lyx-stable/lib/fonts/stmary10.ttf (family stmary10, style LyX)
> > Filename: /usr/local/src/lyx/lyx-stable/lib/fonts/esint10.ttf (family esint10, style LyX)
> >
> > where /usr/local/src/lyx/lyx-stable is the lyx source dir.
> > Hence, QFontDatabase::addApplicationFont() works!
> >
> > Reinstalling the fonts-lyx package I get
> >
> > Filename: /usr/share/fonts/truetype/lyx/eufm10.ttf (family eufm10, style LyX)
> > Filename: /usr/share/fonts/truetype/lyx/cmsy10.ttf (family cmsy10, style LyX)
> > Filename: /usr/share/fonts/truetype/lyx/cmmi10.ttf (family cmmi10, style LyX)
> > Filename: /usr/share/fonts/truetype/lyx/cmr10.ttf (family cmr10, style LyX)
> > Filename: /usr/share/fonts/truetype/lyx/cmex10.ttf (family cmex10, style LyX)
> > Filename: /usr/share/fonts/truetype/lyx/msam10.ttf (family msam10, style LyX)
> > Filename: /usr/share/fonts/truetype/lyx/msbm10.ttf (family msbm10, style LyX)
> > Filename: /usr/share/fonts/truetype/lyx/wasy10.ttf (family wasy10, style LyX)
> > Filename: /usr/share/fonts/truetype/lyx/stmary10.ttf (family stmary10, style LyX)
> > Filename: /usr/share/fonts/truetype/lyx/esint10.ttf (family esint10, style LyX)
> >
> > Meaning that the fonts of the fonts-lyx package take precedence.
> > However, all in all, it seems to work well on debian.
> > I don't know what the problem may be on other distros.
> >
>
> I get a compile error with your patch. I can give you the log, if you want,
> but I do not have much time left to look further into this for now. Later
> this week maybe ...
Ok
> I have tried moving the fonts to /usr/share/fonts, but then "lyx -dbg font"
> gives as result FAILED for the math fonts.
Yes, this is also the case with the lyx debian package, but it simply
means that the fonts are not there. They can still be found through
fontconfig, if they are properly installed elsewhere.
> And it did not solve the issue.
This is really strange. Are they spotted by fc-match?
> If this patch will be part of 2.4, is it then not an idea to change the
> default installation path of the lyx fonts to the default font directory?
> Important distros as fedora and debian are already doing this and it would
> my preference also.
Note that this is only a debug patch, it will not be part of lyx.
As regards where to put the fonts, you have the choice of leaving
them where they are installed by lyx (and, at least on debian, lyx
is able to find and use them), or package them separately and
register them with fontconfig. In this case, they can also be used
by other packages.
I really have no idea why it does not work for you.
--
Enrico
More information about the lyx-devel
mailing list