Summary: | The SemiCondensed Fixed font isn't handled correctly by Konsole | ||
---|---|---|---|
Product: | [Applications] konsole | Reporter: | David Howells <dhowells> |
Component: | font | Assignee: | Konsole Developer <konsole-devel> |
Status: | CONFIRMED --- | ||
Severity: | normal | CC: | a.samirh78, jirislaby, mglb, rdieter |
Priority: | NOR | Keywords: | regression |
Version: | 21.08.2 | ||
Target Milestone: | --- | ||
Platform: | RedHat Enterprise Linux | ||
OS: | Linux | ||
URL: | https://bugreports.qt.io/browse/QTBUG-80952 | ||
Latest Commit: | Version Fixed In: | ||
Attachments: | workaround patch |
Description
David Howells
2017-03-27 10:42:12 UTC
Now Konsole won't allow use of the SemiCondensed Fixed font at all. You can use the normal fixed font. You can also select the SemiCondensed variant, but it will ignore the setting and just use the normal one. It kind of worked up till relatively recently (Fedora 29 worked; 30 does not). Still happens on master. For me, selecting "semicondensed" makes Konsole use some variant with square characters, but it is also wrong. Few observations: * The font preview (the one with font name) in profile settings (not font selection window): - uses right variant just after selection - uses "regular" after Konsole restart - this applies to all variants, not only SC * The config stores "Font=Fixed [Misc],10,-1,5,57,0,0,0,0,0,SemiCondensed", which looks OK. So we have a problem with loading font from config + regression which makes SemiCondensed variant not available in TerminalDisplay. To anyone who wants to test it: If you dont see 'fixed' font, try enabling bitmap fonts: mkdir -p ~/.config/fontconfig/conf.d cat > ~/.config/fontconfig/conf.d/69-fixed-bitmaps.conf <<EOF <?xml version="1.0"?> <!DOCTYPE fontconfig SYSTEM "fonts.dtd"> <fontconfig> <!-- Enabled Fixed bitmap fonts --> <selectfont> <acceptfont> <pattern> <patelt name="family"> <string>Fixed</string> </patelt> </pattern> </acceptfont> </selectfont> </fontconfig> EOF Still happens. For me on openSUSE with 21.08.2. It's because QFont::fromString(const QString &descrip) doesn't OR the QFont::resolve_mask with QFont::StyleNameResolved the same as QFont::setStyleName(const QString &styleName) does. So this is an upstream (Qt) bug. Reproducer: ================ $ cat main.cpp #include <QApplication> #include <QDebug> #include <QLabel> #include <QDialog> static void setLabelFont(QLabel &label, const QFont &font) { qDebug() << __func__ << font << "style" << font.style() << "stylename" << font.styleName() << "resolve" << QString::number(font.resolve(), 16); label.setFont(font); label.setText(font.toString()); } int main(int argc, char *argv[]) { QApplication a(argc, argv); QDialog w; QLabel label1(&w), label2(&w); QFont font1; font1.fromString("Misc Fixed,10,-1,5,57,0,0,0,0,0,SemiCondensed"); auto font2 = font1; #if 1 font2.resolve(font2.resolve() | QFont::ResolveProperties::StyleNameResolved); #else font2.setStyleName("SemiCondensed"); #endif setLabelFont(label1, font1); setLabelFont(label2, font2); w.show(); label2.move(0, label1.size().height() + 5); w.resize(label1.size().width(), label2.pos().y() + label2.size().height()); return a.exec(); } ================ $ cat Makefile COMPONENTS=Qt5Core Qt5Gui Qt5Widgets CXXFLAGS=$(shell pkg-config --cflags $(COMPONENTS)) -Wall -Og -g LDLIBS=$(shell pkg-config --libs $(COMPONENTS)) -flto all: main ================ Both labels are with the same font, the latter sets the resolve_mask and is shown correctly. So this is already known: https://bugreports.qt.io/browse/QTBUG-80952 I am not sure it's the same issue as that upstream bug; the code in Konsole sets the styleName to an empty string https://invent.kde.org/utilities/konsole/-/blob/master/src/terminalDisplay/TerminalFonts.cpp#L91: // "Draw intense colors in bold font" feature needs to use different font weights. StyleName // property, when set, doesn't allow weight changes. Since all properties (weight, stretch, // italic, etc) are stored in QFont independently, in almost all cases styleName is not needed. Created attachment 143440 [details] workaround patch (In reply to Ahmad Samir from comment #6) > I am not sure it's the same issue as that upstream bug; the code in Konsole > sets the styleName to an empty string Confirmed. The qt fix doesn't help (obviously; but is a bug too). Commenting out the line (patch attached) indeed helps. Commenting out that line breaks the "draw intense colours in bold fonts" option, very tricky stuff :) A side point, it looks like semicondensed monospace fonts are a rare thing, even Noto fonts, which have more weight/styles than any other font family I've ever seen, doesn't have a semicondensed monospace font. (In reply to Ahmad Samir from comment #8) > Commenting out that line breaks the "draw intense colours in bold fonts" > option, very tricky stuff :) Sure, that's why the patch is marked as a workaround, not a fix :). (In reply to Ahmad Samir from comment #9) > A side point, it looks like semicondensed monospace fonts are a rare thing, > even Noto fonts, which have more weight/styles than any other font family > I've ever seen, doesn't have a semicondensed monospace font. Misc Fixed which I am using over a decade in xterm and which I wanted to teach konsole to use... One more thing: konsole picks /usr/share/fonts/misc/6x13-ISO8859-1.pcf.gz instead of /usr/share/fonts/misc/6x13.pcf.gz. I have to delete the former to have proper unicode support using the same font... I see misc fixed, but it has a maximum size of 8pt, so I've never really used it. (In reply to Jiri Slaby from comment #7) > Confirmed. The qt fix doesn't help (obviously; but is a bug too). Commenting > out the line (patch attached) indeed helps. I actually need both changes in both libqt and konsole. |