PDA

View Full Version : Qt 5.5.1 font issue



Rajesh.Rathod
12th April 2016, 11:31
Dear All,
I just stated using qt 5.5.1 and earlier I was using qt 4.7.3.

The Arial bold font text set on push buttons looks different on qt 5.5.1 compare to qt 4.7.3, what could be the reason.

Thanks,

d_stranz
12th April 2016, 17:01
TrueType vs. non-TrueType, aliased vs. non-aliased, kerned vs. non-kerned? Could be any number of reasons.

Rajesh.Rathod
25th April 2016, 13:29
I have attached two images two show text differences.
Specially 'I' looks different.

I still can't find the solution.

d_stranz
25th April 2016, 20:41
Looks like the "I" is coming from a serif font in the second image. How are you setting the text on these buttons?

What happens if you run the same exe on a different PC?

scgrant327
26th April 2016, 14:55
From working in the Graphics Industry for years....and then as a Software Engineer... and as someone who pays attention to detail...

Those are NOT the same font at all. The 'S', 'I', 'R', 'Y'.. basically all the letters are different. It's not just the 'I'.

d_stranz
26th April 2016, 18:17
I couldn't make the images any larger than what is shown in the post, so the only one I could tell that is obviously different is the 'I'. I'll take your word for it that the others are too.

So I know that Qt does its best to match an available font with the one that is requested in code, so that could be what is happening here - the requested font is unavailable, so what is shown is the closest match.

Rajesh.Rathod
27th April 2016, 05:52
This is to update you all that the code is same for both the screen shot and only difference is the Qt version.
So after reading all the above post I m feeling that there might be possibility that Qt 5.5.1 doesn't have the requested font and it is setting it to closest match as replied in above post by d_stranz.

Thanks

d_stranz
27th April 2016, 16:21
You can test this: use QFont::exactMatch() to test if what is being returned is a match in one case or the other (or maybe not in either one!).

What is your code actually requesting when you try to create the font?