Fallback to fixed width fonts

Summary:
Before this commit when Konsole was trying to render a character that
didn't exist in the font selected by user, it'd fall back to default font provided
by font config without any hints that it needs monospace fonts which usually
would be a sans font.

Now Konsole hints system that it needs a monospace font.

BUG: 393620

Reviewers: hindenburg

Reviewed By: hindenburg

Subscribers: #konsole, hindenburg, mglb, ahmadsamir

Tags: #konsole

Differential Revision: https://phabricator.kde.org/D12614
wilder-portage
Kurt Hindenburg 8 years ago
parent ca36b88619
commit 259b98011f
  1. 5
      src/TerminalDisplay.cpp

@ -233,6 +233,11 @@ void TerminalDisplay::fontChange(const QFont&)
void TerminalDisplay::setVTFont(const QFont& f)
{
QFont newFont(f);
// In case the provided font doesn't have some specific characters it should
// fall back to a Monospace fonts.
newFont.setStyleHint(QFont::TypeWriter);
QFontMetrics fontMetrics(newFont);
// This check seems extreme and semi-random

Loading…
Cancel
Save