[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    Re: [konsole/frameworks] src: Issue a warning when not matching a font exactly
From:       Christoph Feck <christoph () maxiom ! de>
Date:       2014-07-21 14:36:04
Message-ID: 201407211636.04795.christoph () maxiom ! de
[Download RAW message or body]

On Monday 21 July 2014 15:55:59 Casian Andrei wrote:
> Git commit e6fa0276a55cb915adb2e1c0e43879d8b8c14d65 by Casian
> Andrei. Committed on 21/07/2014 at 13:50.
> Pushed by casianandrei into branch 'frameworks'.
> 
> Issue a warning when not matching a font exactly
> 
> When setting a font for the terminal, if it is not found properly
> by the system, Qt attempts to use another font which is not an
> exact match. It happens that the other font is not fixed-pitch, so
> konsole ends up using an unsupported variable-pitch font for the
> terminal.

As long as you set a proper style hint for fixed pitch fonts, this 
should work with Qt 5.3.1.

See http://doc-snapshot.qt-project.org/qt5-dev/qfont.html#StyleHint-enum

> Place a warning when an exact match for the desired font has not
> been found.
> 
> M  +4    -0    src/TerminalDisplay.cpp
> 
> 
http://commits.kde.org/konsole/e6fa0276a55cb915adb2e1c0e43879d8b8c1
> 4d65
> 
> diff --git a/src/TerminalDisplay.cpp b/src/TerminalDisplay.cpp
> index eb9c9f0..4d5bd8a 100644
> --- a/src/TerminalDisplay.cpp
> +++ b/src/TerminalDisplay.cpp
> @@ -209,6 +209,10 @@ void TerminalDisplay::setVTFont(const QFont&
> f)
> 
>      QFontMetrics metrics(font);
> 
> +    if (!QFontInfo(font).exactMatch()) {
> +        kWarning() << "The font for use in the terminal has not
> been matched exactly. Perhaps it has not been found properly."; + 
>   }
> +
>      if (!QFontInfo(font).fixedPitch()) {
>          kWarning() << "Using an unsupported variable-width font in
> the terminal.  This may produce display errors."; }
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic