Reputation: 1844
I am developing a text editor application based on QTextEdit/QGraphicsTextItem and noticed that the results of QTextEdit on Windows are different to the ones on Mac.
Specifically, when testing with a multi line text snippet in the "Text Edit" sample of Qt 4.8.5:
I've found a couple of related StackOverflow questions but didn't find a suitable answer in them. Thus I tried to dig deeper and figured out the following:
When referring to "line height" I compared the ascent height (i.e. height of "T") against the height between them (between two text lines).
Here is a screenshot showing the problem. The red lines are the base lines of the Mac text lines.:
It seems that the line height causes the text layout to be different on Mac and Windows. Is there any way in Qt to enforce an identical text layout on Mac and Windows (Microsoft Word manages to do so)? Or does anybody have other suggestions about this?
Upvotes: 1
Views: 483
Reputation: 3294
If I'm not mistaken, Qt 4.8 in Mac uses system rendering engine & Windows and other platform uses Harfbuzz. Qt 5.X uses Qt Harfbuzz for all platforms. Two different rendering engine not likely to have same rendering out put. Try with Qt 5.2 if you can.
Upvotes: 1