Details
-
Bug
-
Resolution: Done
-
P1: Critical
-
4.5.3, 4.6.0
-
None
-
6ef5b4485b9fe5a9d25d2d9b5e67f110fb728a8b
Description
To reproduce the bug, install the attached font and run the following program:
#include <QtGui> int main(int argc, char **argv) { QApplication app(argc, argv); QFile file(QLatin1String("testutf8.txt")); if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) return 1; QTextDocument doc; QByteArray content = file.readAll(); file.close(); doc.setDefaultFont(QFont("Old Standard", 16)); doc.setPlainText(QString::fromUtf8(content.data(), content.size())); QTextEdit w; w.setDocument(&doc); w.show(); return app.exec(); }
If you open the text file in a non-Qt text editor using the same font, you'll see that there are some diacritics which are not rendered by the above Qt program. This is a regression from Qt 4.4.
Part of the problem is that QFontEngineWin::boundingBox(glyph_t, const QTransform &) returns 0 as the bounding box' lower x-coordinate instead of abc.abcfA. Therefore, when Qt asks Windows to render the diacritic glyph into an image (for the glyph cache), the glyph is rendered mostly outside the image.
Another problem is that the diacritics are placed incorrectly on the screen, sometimes two lines above the correct position. QFontEngine::getGlyphPositions() adds the glyph's offset to its base position, but if the offset it ignored, the position is much closer to correct.
Attachments
Issue Links
- resulted from
-
QTBUG-5796 Unicode OpenType font problems on WinXP
- Closed