Comment 11 for bug 999925

Revision history for this message
joachimeibl (joachim-eibl) wrote : Re: [Bug 999925] [NEW] KDiff3 font rendering of changed text broken

Hi,

I (developer of KDiff3) now also had a look into this bug.

On Ubuntu 12.04 I can reproduce it too.

When making a screenshot and zooming in, it appears that same characters are
rendered differently every time.

Qt provides an integer based QFontMetrics and a QFontMetricsF class that
returns double values. For normal widgets previously QFontMetrics was
sufficient because the width of a character was an integer value in pixels
only. This seems to have changed because QFontMetricsF::width() returns values
that are no ints.

For the moment I can only say that I am working on a solution.

And with a little test I was able to find two fonts that still have an integer
width.
Ubuntu Mono, Regular, Size 12
Ubuntu Mono, Regular, Size 9

Benoît Thébaudeau also pointed out Monospace Regular, Size 10, which comes
very close (8.0156 instead of 8.000) and should suffice mostly.

Yet if anyone can tell where this problem comes from, I'd like to know.
Disabling antialiasing globally didn't help. (See /etc/fonts/conf.d/10-
antialias.conf)

One more possible idea would be to build Qt yourself and disable fontconfig (
configure option "-no-fontconfig".)

Regards,
Joachim