Details
-
Bug
-
Resolution: Done
-
P1: Critical
-
4.8.0
-
None
-
Windows Vista SP2 , Windows 7, compile Qt with DirectWrite enabled
-
f54c5d9133d7aa7636988db36fa6cc51d26434b6
Description
In the Qt affine demo in funtion 'XFormView::drawTextType(QPainter *painter)' set
f.setHintingPreference(QFont::PreferNoHinting)'
replace
painter->fillPath(path, Qt::black);
with
painter->setFont(f);
painter->drawText(0.0 , 0.0, m_text);
Start the demo, switch to text type, scale the text down and rotate the text.
At some rotating degrees and scaling factors the glyhs are clipped, at some rotating degrees nothing is drawn.
It seemed to be that the function 'QFontEngineDirectWrite::imageForGlyph' in 'QFontEngineDirectWrite.cpp' didn't work properly if
the transformation matrix 'xform' is rotated. The glyphs in the returned image are shifted out of bounds.
At some font sizes or if the font is italic the right of the glyphs is clipped even if the painter is not rotated.