Fix bug #7187: Font painting problems with emulated scaling.

When creating the QFontMetrics object, we should specify a QPaintDevice. 0 is a paint device which is screen-compatible or pixmap-compatible. This makes sure that the correct DPI is used in font metrics calculations.

see also:
http://bugreports.qt.nokia.com/browse/QTBUG-16331.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@37030 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Vincent van Ravesteijn 2010-12-29 05:35:03 +00:00
parent b5c25fe3b2
commit 1f5c77ec65

View File

@ -50,13 +50,13 @@ inline QChar const ucs4_to_qchar(char_type const ucs4)
GuiFontMetrics::GuiFontMetrics(QFont const & font) GuiFontMetrics::GuiFontMetrics(QFont const & font)
: metrics_(font), smallcaps_metrics_(font), smallcaps_shape_(false) : metrics_(font, 0), smallcaps_metrics_(font), smallcaps_shape_(false)
{ {
} }
GuiFontMetrics::GuiFontMetrics(QFont const & font, QFont const & smallcaps_font) GuiFontMetrics::GuiFontMetrics(QFont const & font, QFont const & smallcaps_font)
: metrics_(font), smallcaps_metrics_(smallcaps_font), smallcaps_shape_(true) : metrics_(font, 0), smallcaps_metrics_(smallcaps_font), smallcaps_shape_(true)
{ {
} }