From 4de382f4a222e3f589e9fd554610f920c1957d10 Mon Sep 17 00:00:00 2001 From: Alexander Volkov Date: Thu, 2 Oct 2014 17:57:42 +0400 Subject: [PATCH] Make font hinting and antialiasing size dependent when using FontConfig Add the pixel size of the font to the search pattern to get size dependent font settings. This patch allows to take into account KDE settings for font sizes which should be excluded from antialiasing. Change-Id: I8bd8b7b3d585009d0a39db631cd02b7970537f5c Reviewed-by: Allan Sandfeld Jensen --- .../fontdatabases/fontconfig/qfontconfigdatabase.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase.cpp b/src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase.cpp index 1aac0791cd..2b9883eb36 100644 --- a/src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase.cpp +++ b/src/platformsupport/fontdatabases/fontconfig/qfontconfigdatabase.cpp @@ -845,6 +845,9 @@ void QFontconfigDatabase::setupFontEngine(QFontEngineFT *engine, const QFontDef FcPatternAdd(pattern,FC_INDEX,value,true); } + if (fontDef.pixelSize > 0.1) + FcPatternAddDouble(pattern, FC_PIXEL_SIZE, fontDef.pixelSize); + FcResult result; FcConfigSubstitute(0, pattern, FcMatchPattern);