summaryrefslogtreecommitdiffstats
path: root/src/gui/text/qfont.h
diff options
context:
space:
mode:
authorEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>2010-03-24 13:51:13 (GMT)
committerEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>2010-03-24 14:27:58 (GMT)
commit6d0002fe9bc91b9901e56050d247fbded09c9c76 (patch)
treee6b14b3d69512a7bb62ccf69ae3f656a227e82d2 /src/gui/text/qfont.h
parent4a4458d1cf5ec7885c6f63f739b7ee80c70ad211 (diff)
downloadQt-6d0002fe9bc91b9901e56050d247fbded09c9c76.zip
Qt-6d0002fe9bc91b9901e56050d247fbded09c9c76.tar.gz
Qt-6d0002fe9bc91b9901e56050d247fbded09c9c76.tar.bz2
Add QFont::ForceIntegerMetrics style strategy flag
WebKit uses integers internally to deal with positioning and sizing of text objects, but on Mac, Qt uses floating point values. This caused a discrepancy between the size used by WebKit to position text objects and the actual size of the objects when rendered by Qt. The problem was so bad that it has been holding back fixes for other bugs in the mac font engine since these would make the WebKit bug more visible. To work around the problem, we introduce a StyleStrategy flag in QFont which allows you to force the use of integers all over the line. This makes text rendering slightly different from native applications, but should fix several issues with WebKit on Mac. The WebKit-part of this patch will be submitted up-stream. Reviewed-by: Simon Hausmann Reviewed-by: Prasanth
Diffstat (limited to 'src/gui/text/qfont.h')
-rw-r--r--src/gui/text/qfont.h23
1 files changed, 12 insertions, 11 deletions
diff --git a/src/gui/text/qfont.h b/src/gui/text/qfont.h
index 5adf237..6f62424 100644
--- a/src/gui/text/qfont.h
+++ b/src/gui/text/qfont.h
@@ -76,17 +76,18 @@ public:
};
enum StyleStrategy {
- PreferDefault = 0x0001,
- PreferBitmap = 0x0002,
- PreferDevice = 0x0004,
- PreferOutline = 0x0008,
- ForceOutline = 0x0010,
- PreferMatch = 0x0020,
- PreferQuality = 0x0040,
- PreferAntialias = 0x0080,
- NoAntialias = 0x0100,
- OpenGLCompatible = 0x0200,
- NoFontMerging = 0x8000
+ PreferDefault = 0x0001,
+ PreferBitmap = 0x0002,
+ PreferDevice = 0x0004,
+ PreferOutline = 0x0008,
+ ForceOutline = 0x0010,
+ PreferMatch = 0x0020,
+ PreferQuality = 0x0040,
+ PreferAntialias = 0x0080,
+ NoAntialias = 0x0100,
+ OpenGLCompatible = 0x0200,
+ ForceIntegerMetrics = 0x0400,
+ NoFontMerging = 0x8000
};
enum Weight {