[Konsole-devel] Review Request 126921: Fix programming ligature support by allowing to use variable-width fonts
Stefan Seemayer
stefan at seemayer.de
Fri Jan 29 08:03:41 UTC 2016
> On Jan. 29, 2016, 2:08 a.m., Kurt Hindenburg wrote:
> > I'm not sure this is a good idea. Using variable-width fonts will cause a lot of other issues w/ displaying text, colors, selecting text, etc.
> >
> > Can the issue you're having be fixed another way?
I agree that variable-width fonts in general will not display well in Konsole. However, the current method for detecting monospaced fonts using QFontInfo::fixedPitch will label monospaced fonts with programming ligature support as being variable-width (because they necessarily have to contain glyphs that span two or more characters to display ligatures), thus refusing to set them even though they were designed to be used in a monospaced environment. Since fonts detected as being variable-width are still hidden from users in the font selector when editing their profile, I don't think that this patch should cause issues. Non-monospace fonts can only be selected by editing the Konsole profile using a text editor.
For users that had manually selected a variable width font prior to d59ad5c, their Konsole window will now freeze up with garbled graphics because the TerminalDisplay::setVTFont method run on startup will return without a font being set, leaving Konsole in an undefined state. In my opinion, continuing with a warning message telling the user that using a variable-width font might give rendering problems is preferable to Konsole not being usable at all.
I've been using Konsole in conjunction with the PragmataPro ligature-containing font for more than 6 months and never had any issues until updating to a newer version with the d59ad5c patch applied. A ligature font may seem like unnecessary frills but since I spend most of my day staring into terminals I've become attached to them :) In addition, Konsole is currently the only terminal emulator under linux known to support programming ligatures (see e.g. https://github.com/tonsky/FiraCode#terminals-support) so it's even a feature that can set Konsole apart from other terminal editors.
To summarize:
* Users that never touched the profile files with a text editor will not be affected by this patch
* Users that edited the profile file to choose a monospace font will not be affected by this patch
* Users that edited the profile file to choose a monospace+ligature font currently have Konsole freezing on start, and this patch fixes their issues
* Users that edited the profile file to choose a variable-width font currently have Konsole freezing on start, and this patch will make Konsole start although there will be some rendering problems
Another solution for this problem would be to patch fixed-width font detection of QFontInfo to detect ligature fonts as still being monospaced, although I wouldn't know how to do this (yet) and the change would have even further-reaching consequences.
- Stefan
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/126921/#review91737
-----------------------------------------------------------
On Jan. 28, 2016, 2:53 p.m., Stefan Seemayer wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/126921/
> -----------------------------------------------------------
>
> (Updated Jan. 28, 2016, 2:53 p.m.)
>
>
> Review request for Konsole.
>
>
> Repository: konsole
>
>
> Description
> -------
>
> For users of monospace fonts with programming ligature support such as
> Hasklig, FiraCode or PragmataPro, commit d59ad5cd8ad7cdaab2ba5df59a786d475a535db5
> makes Konsole freeze on startup if they had set a variable-width font
> in their default profile because no font is being set on startup.
>
> Instead of refusing to set the variable-width font necessary for
> ligatures to work, emit a warning message and continue setting the font.
> This will restore support for ligature fonts.
>
>
> Diffs
> -----
>
> src/TerminalDisplay.cpp 536aea6
>
> Diff: https://git.reviewboard.kde.org/r/126921/diff/
>
>
> Testing
> -------
>
> Commit causing the problems was identified using git-bisect on ArchLinux x86-64 rolling. Patch applies and compiles on git-HEAD at da573a8a90e7721bd1929a929b694db9292ad36d .
>
>
> Thanks,
>
> Stefan Seemayer
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/konsole-devel/attachments/20160129/32a1021d/attachment.html>
More information about the konsole-devel
mailing list