Discussion:
Monspace font as squares
Antoine Hoarau
2018-10-30 08:39:19 UTC
Permalink
Hello !
I've been having the strangest bug with KDev5 (all version up to 5.3 beta1)
: The monospace font (the default one) is only showing squares (see
attached file).
This seems similar to
https://mail.kde.org/pipermail/kdevelop/2018-August/019690.html.
So idea what happened on my ubuntu 16.04. I tried regenerating the cache
with sudo fc-cache -r -v -f, copying /etc/fonts/ from a working computer,
copying /usr/share/font* from a working computer, regenerating, rebooting.
Nothing.

In the end I can change the font and I can see the code, build the build
windows is staying at Monospace font even If I change the editor + KConsole
to something else.

I see this Monospace font was an issue at some point :
https://cgit.kde.org/kdevplatform.git/commit/?id=12f5de1c9706b7b5b49528b57acfe4a350110839

Thanks for your help !

Antoine that really wants to use clang-tidy
Sven Brauch
2018-11-02 17:42:23 UTC
Permalink
Hi,
Post by Antoine Hoarau
: The monospace font (the default one) is only showing squares (see
attached file).
What happens if you select "Bitstream vera sans mono" instead?

Weird issue. Are you using the AppImage?

Best,
Sven
Antoine Hoarau
2018-11-02 18:46:17 UTC
Permalink
I'm using AppImage yes.
More info about the bug : using kdevelop 4.7 (the one on apt on Ubuntu 16),
the monospace is fine.
In the Appimage Kdev5, if I change the font to anything else it works fine,
except the build windows that seems stick with monospace.
Is there any way to change the build windows font ?
Thanks again,

Antoine
Post by Sven Brauch
Hi,
Post by Antoine Hoarau
: The monospace font (the default one) is only showing squares (see
attached file).
What happens if you select "Bitstream vera sans mono" instead?
Weird issue. Are you using the AppImage?
Best,
Sven
--
Antoine Hoarau
Robotics Engineer
Friedrich W. H. Kossebau
2018-11-02 19:23:13 UTC
Permalink
Post by Antoine Hoarau
I'm using AppImage yes.
In the Appimage Kdev5, if I change the font to anything else it works fine,
except the build windows that seems stick with monospace.
Is there any way to change the build windows font ?
No, the font in the build windows is currently hardcoded to use the system's
fixed font (QFontDatabase::systemFont(QFontDatabase::FixedFont), which is
queried from the platform thene integration plugin.
Which might be something based on QGenericUnixTheme, which sets a QFont
initialized with the family "monospace" (& setStyleHint(QFont::TypeWriter);).

See https://code.woboq.org/qt5/qtbase/src/platformsupport/themes/genericunix/
qgenericunixthemes.cpp.html

Not sure if that theme is really in use, but it might be. Also unsure how the
resolution then happens, if that string is passed 1:1 to fontconfig.

Can you tell what the result of "fc-match monospace" is on the normal
commandline and what in the embedded shell/konsole of KDevelop?

Cheers
Friedrich
René J.V. Bertin
2018-11-02 20:05:51 UTC
Permalink
Post by Antoine Hoarau
Is there any way to change the build windows font ?
No, the font in the build windows is currently hardcoded to use the system's
fixed font (QFontDatabase::systemFont(QFontDatabase::FixedFont), which is
queried from the platform thene integration plugin.
Exactly, so the "fixed" font configured in the General section in ~/.config/kdeglobals will be used provided you have the plasma-integration plugin installed and/or set QT_QPA_PLATFORMTHEME=kde or else KDE_SESSION_VERSION=5 AND KDE_FULL_SESSION=true . In those cases application appearance is defined largely in ~/.config/kdeglobals which is read either by the plasma-integration plugin or by Qt's lightweight emulation in QGenericUnixTheme.

It looks though that you're running Ubuntu's default desktop which IIRC is Gnome-based. In that case Qt's QGenericUnixTheme will probably try to emulate a Gnome application (if none of the env. variables above are set) and get the default fonts from some other configuration file. The widget theme in use in your screenshot seems to be Fusion, and if so that supports the idea that you may not be reading settings from kdeglobals at all.

The easiest to tinker with this is by running `kcmshell5 fonts` (kcmshell5 is provided by the kf5 version of the kde-cli-tools package; the fonts KCM by the KF5 plasma-desktop package).
You can also run `qtdiag`; it shows which themes are available and which is in use; idem for the fonts. In my case:

Theme:
Platforms requested : kde,generic
available : kde,gtk2,gtk3
Styles requested : qtcurve,breeze,oxygen,fusion,windows
available : Breeze,cleanlooks,gtk2,cde,motif,plastique,Oxygen,QtCurve,Windows,Fusion
Icon theme : Ciment, hicolor from /home/bertin/.local/share/icons,/usr/share/icons,/usr/local/share/icons,/opt/local/share/icons,/home/bertin/.icons
System font : "Segoe UI" 10

Fonts:
General font : "Segoe UI" 10
Fixed font : "Ubuntu Mono" 10
Title font : "Lucida Sans" 10
Smallest font: "Novarese Bk BT [bitstream]" 8



R
Friedrich W. H. Kossebau
2018-11-02 20:19:46 UTC
Permalink
Post by Friedrich W. H. Kossebau
Post by Antoine Hoarau
I'm using AppImage yes.
In the Appimage Kdev5, if I change the font to anything else it works fine,
except the build windows that seems stick with monospace.
Is there any way to change the build windows font ?
No, the font in the build windows is currently hardcoded to use the system's
fixed font (QFontDatabase::systemFont(QFontDatabase::FixedFont), which is
queried from the platform thene integration plugin.
Which might be something based on QGenericUnixTheme, which sets a QFont
initialized with the family "monospace" (&
setStyleHint(QFont::TypeWriter);).
See
https://code.woboq.org/qt5/qtbase/src/platformsupport/themes/genericunix/
qgenericunixthemes.cpp.html
Not sure if that theme is really in use, but it might be. Also unsure how
the resolution then happens, if that string is passed 1:1 to fontconfig.
Can you tell what the result of "fc-match monospace" is on the normal
commandline and what in the embedded shell/konsole of KDevelop?
Another possible reason found meanwhile is that possibly the libfontconfig
(2.8 as from centos 6) as used for the appimage and linked by the qt qpa
plugin used in the appimage is not able to read some newer format of the font
config files as supported by fontconfig >= 2.11 (as used on ubuntu 16.04).

A possible solution might be not to use the stock libfontconfig from centos 6
for the appimage build, but also provide sources from a recent version of
libfonrconfig which also supports reading the old config format, so both old
and the new non-backward compatible font config file formats are supported.
Cmp. e.g. https://github.com/OpenShot/openshot-qt/issues/1775

Superficially researched by reading other bug reports on a quick web search,
just dumping here to sync with what was said on irc.

Cheers
Friedrich
René J.V. Bertin
2018-11-02 20:57:16 UTC
Permalink
Post by Friedrich W. H. Kossebau
A possible solution might be not to use the stock libfontconfig from centos 6
for the appimage build, but also provide sources from a recent version of
Does that use a static libfontconfig build? If not, can't you just NOT include libfontconfig in the appimage so that the system version is used?

R
Sven Brauch
2018-11-02 23:08:38 UTC
Permalink
Post by René J.V. Bertin
Post by Friedrich W. H. Kossebau
A possible solution might be not to use the stock libfontconfig from centos
6 for the appimage build, but also provide sources from a recent version
of
Does that use a static libfontconfig build? If not, can't you just NOT
include libfontconfig in the appimage so that the system version is used?
Yeah, I'm wondering about that too, we should try that out.

Best,
Sven
Kevin Funk
2018-11-15 11:16:43 UTC
Permalink
Post by Friedrich W. H. Kossebau
Post by Friedrich W. H. Kossebau
Post by Antoine Hoarau
I'm using AppImage yes.
In the Appimage Kdev5, if I change the font to anything else it works fine,
except the build windows that seems stick with monospace.
Is there any way to change the build windows font ?
No, the font in the build windows is currently hardcoded to use the
system's fixed font (QFontDatabase::systemFont(QFontDatabase::FixedFont),
which is queried from the platform thene integration plugin.
Which might be something based on QGenericUnixTheme, which sets a QFont
initialized with the family "monospace" (&
setStyleHint(QFont::TypeWriter);).
See
https://code.woboq.org/qt5/qtbase/src/platformsupport/themes/genericunix/
qgenericunixthemes.cpp.html
Not sure if that theme is really in use, but it might be. Also unsure how
the resolution then happens, if that string is passed 1:1 to fontconfig.
Can you tell what the result of "fc-match monospace" is on the normal
commandline and what in the embedded shell/konsole of KDevelop?
Another possible reason found meanwhile is that possibly the libfontconfig
(2.8 as from centos 6) as used for the appimage and linked by the qt qpa
plugin used in the appimage is not able to read some newer format of the
font config files as supported by fontconfig >= 2.11 (as used on ubuntu
16.04).
That's a good explanation I think.

@Antoine, could you try the following:

./KDevelop-5.3.0-x86_64.AppImage --appimage-extract
cd squashfs-root
rm rm usr/lib/libfontconfig.so.1
./AppRun

I've already filed a patch [1], but if you can confirm that works for you
that'd be great.

Regards,
Kevin


[1] https://phabricator.kde.org/D16893
Post by Friedrich W. H. Kossebau
A possible solution might be not to use the stock libfontconfig from centos
6 for the appimage build, but also provide sources from a recent version of
libfonrconfig which also supports reading the old config format, so both
old and the new non-backward compatible font config file formats are
supported. Cmp. e.g. https://github.com/OpenShot/openshot-qt/issues/1775
Superficially researched by reading other bug reports on a quick web search,
just dumping here to sync with what was said on irc.
Cheers
Friedrich
--
Kevin Funk | ***@kde.org | http://kfunk.org
Antoine Hoarau
2018-11-15 12:02:46 UTC
Permalink
It works ! Thanks you !
Antoine
Post by Friedrich W. H. Kossebau
Am Freitag, 2. November 2018, 20:23:13 CET schrieb Friedrich W. H.
Post by Friedrich W. H. Kossebau
Post by Antoine Hoarau
I'm using AppImage yes.
In the Appimage Kdev5, if I change the font to anything else it works fine,
except the build windows that seems stick with monospace.
Is there any way to change the build windows font ?
No, the font in the build windows is currently hardcoded to use the
system's fixed font
(QFontDatabase::systemFont(QFontDatabase::FixedFont),
Post by Friedrich W. H. Kossebau
which is queried from the platform thene integration plugin.
Which might be something based on QGenericUnixTheme, which sets a QFont
initialized with the family "monospace" (&
setStyleHint(QFont::TypeWriter);).
See
https://code.woboq.org/qt5/qtbase/src/platformsupport/themes/genericunix/
Post by Friedrich W. H. Kossebau
qgenericunixthemes.cpp.html
Not sure if that theme is really in use, but it might be. Also unsure
how
Post by Friedrich W. H. Kossebau
the resolution then happens, if that string is passed 1:1 to
fontconfig.
Post by Friedrich W. H. Kossebau
Can you tell what the result of "fc-match monospace" is on the normal
commandline and what in the embedded shell/konsole of KDevelop?
Another possible reason found meanwhile is that possibly the
libfontconfig
(2.8 as from centos 6) as used for the appimage and linked by the qt qpa
plugin used in the appimage is not able to read some newer format of the
font config files as supported by fontconfig >= 2.11 (as used on ubuntu
16.04).
That's a good explanation I think.
./KDevelop-5.3.0-x86_64.AppImage --appimage-extract
cd squashfs-root
rm rm usr/lib/libfontconfig.so.1
./AppRun
I've already filed a patch [1], but if you can confirm that works for you
that'd be great.
Regards,
Kevin
[1] https://phabricator.kde.org/D16893
A possible solution might be not to use the stock libfontconfig from
centos
6 for the appimage build, but also provide sources from a recent version
of
libfonrconfig which also supports reading the old config format, so both
old and the new non-backward compatible font config file formats are
supported. Cmp. e.g. https://github.com/OpenShot/openshot-qt/issues/1775
Superficially researched by reading other bug reports on a quick web
search,
just dumping here to sync with what was said on irc.
Cheers
Friedrich
--
--
Antoine Hoarau
Robotics Engineer
Kevin Funk
2018-11-15 12:49:10 UTC
Permalink
Post by Antoine Hoarau
It works ! Thanks you !
Antoine
Thanks for the quick feedback.

The patch is in, and will be part of KDevelop 5.3.1 (to be released).

Regards,
Kevin
Post by Antoine Hoarau
Post by Friedrich W. H. Kossebau
Am Freitag, 2. November 2018, 20:23:13 CET schrieb Friedrich W. H.
Post by Friedrich W. H. Kossebau
Post by Antoine Hoarau
I'm using AppImage yes.
In the Appimage Kdev5, if I change the font to anything else it
works
fine,
except the build windows that seems stick with monospace.
Is there any way to change the build windows font ?
No, the font in the build windows is currently hardcoded to use the
system's fixed font
(QFontDatabase::systemFont(QFontDatabase::FixedFont),
Post by Friedrich W. H. Kossebau
which is queried from the platform thene integration plugin.
Which might be something based on QGenericUnixTheme, which sets a QFont
initialized with the family "monospace" (&
setStyleHint(QFont::TypeWriter);).
See
https://code.woboq.org/qt5/qtbase/src/platformsupport/themes/genericunix/
Post by Friedrich W. H. Kossebau
qgenericunixthemes.cpp.html
Not sure if that theme is really in use, but it might be. Also unsure
how
Post by Friedrich W. H. Kossebau
the resolution then happens, if that string is passed 1:1 to
fontconfig.
Post by Friedrich W. H. Kossebau
Can you tell what the result of "fc-match monospace" is on the normal
commandline and what in the embedded shell/konsole of KDevelop?
Another possible reason found meanwhile is that possibly the
libfontconfig
(2.8 as from centos 6) as used for the appimage and linked by the qt qpa
plugin used in the appimage is not able to read some newer format of the
font config files as supported by fontconfig >= 2.11 (as used on ubuntu
16.04).
That's a good explanation I think.
./KDevelop-5.3.0-x86_64.AppImage --appimage-extract
cd squashfs-root
rm rm usr/lib/libfontconfig.so.1
./AppRun
I've already filed a patch [1], but if you can confirm that works for you
that'd be great.
Regards,
Kevin
[1] https://phabricator.kde.org/D16893
A possible solution might be not to use the stock libfontconfig from
centos
6 for the appimage build, but also provide sources from a recent version
of
libfonrconfig which also supports reading the old config format, so both
old and the new non-backward compatible font config file formats are
supported. Cmp. e.g. https://github.com/OpenShot/openshot-qt/issues/1775
Superficially researched by reading other bug reports on a quick web
search,
just dumping here to sync with what was said on irc.
Cheers
Friedrich
--
--
Kevin Funk | ***@kde.org | http://kfunk.org
Antoine Hoarau
2018-11-06 09:26:20 UTC
Permalink
Post by Friedrich W. H. Kossebau
Post by Antoine Hoarau
I'm using AppImage yes.
In the Appimage Kdev5, if I change the font to anything else it works
fine,
Post by Antoine Hoarau
except the build windows that seems stick with monospace.
Is there any way to change the build windows font ?
No, the font in the build windows is currently hardcoded to use the system's
fixed font (QFontDatabase::systemFont(QFontDatabase::FixedFont), which is
queried from the platform thene integration plugin.
Which might be something based on QGenericUnixTheme, which sets a QFont
initialized with the family "monospace" (&
setStyleHint(QFont::TypeWriter);).
See
https://code.woboq.org/qt5/qtbase/src/platformsupport/themes/genericunix/
qgenericunixthemes.cpp.html
Not sure if that theme is really in use, but it might be. Also unsure how the
resolution then happens, if that string is passed 1:1 to fontconfig.
Can you tell what the result of "fc-match monospace" is on the normal
commandline and what in the embedded shell/konsole of KDevelop?
It outputs : DejaVuSansMono.ttf: "DejaVu Sans Mono" "Book" on both consoles
(kdev and normal).
Post by Friedrich W. H. Kossebau
Cheers
Friedrich
--
Antoine Hoarau
Robotics Engineer
Antoine Hoarau
2018-11-15 09:29:02 UTC
Permalink
Same thing happening with the latest 5.3 release. Any ideas I can try ?
Thanks !
Post by Antoine Hoarau
Post by Friedrich W. H. Kossebau
Post by Antoine Hoarau
I'm using AppImage yes.
In the Appimage Kdev5, if I change the font to anything else it works
fine,
Post by Antoine Hoarau
except the build windows that seems stick with monospace.
Is there any way to change the build windows font ?
No, the font in the build windows is currently hardcoded to use the system's
fixed font (QFontDatabase::systemFont(QFontDatabase::FixedFont), which is
queried from the platform thene integration plugin.
Which might be something based on QGenericUnixTheme, which sets a QFont
initialized with the family "monospace" (&
setStyleHint(QFont::TypeWriter);).
See
https://code.woboq.org/qt5/qtbase/src/platformsupport/themes/genericunix/
qgenericunixthemes.cpp.html
Not sure if that theme is really in use, but it might be. Also unsure how the
resolution then happens, if that string is passed 1:1 to fontconfig.
Can you tell what the result of "fc-match monospace" is on the normal
commandline and what in the embedded shell/konsole of KDevelop?
It outputs : DejaVuSansMono.ttf: "DejaVu Sans Mono" "Book" on both
consoles (kdev and normal).
Post by Friedrich W. H. Kossebau
Cheers
Friedrich
--
Antoine Hoarau
Robotics Engineer
--
Antoine Hoarau
Robotics Engineer
Loading...