PDA

View Full Version : Font display weird



vhptt
3rd September 2012, 04:25
I have a problem with Font Family. I create my own true type font by using Font Creator (on Window).
I use QPainter::drawText() function to draw a text with the font but there are a different between openSUSE and Window; different between each pointSize.

with pointSize <= 48: displaying ok on Window and openSUSE
with pointSize > 48: displaying ok on Window but on openSUSE look weird. The circle distorted (this problem come with every character which have circle vector in my font)
I attached screenshot.

Could some one tell me about the problem and how can I fix that ?

vhptt
4th September 2012, 03:31
Nobody know problem ?????????????????????????????????

ChrisW67
4th September 2012, 05:15
We can see the problem. Clearly the outline information in the font is atypical in some way. How do you propose we debug the problem with your custom font and its interaction with the the specific build of the FreeType library used by Qt on your system?

What have you done to try to debug this?
Have you tried your custom font in any other applications, say Libre Office or a font viewer, to see if the problem is unique to your application?
Have you tried your custom font on any other Linux machine to see it the problem is unique to the libraries on your machine?
Have you run your font through any form of font validation tool (e.g. in fontforge)?

vhptt
4th September 2012, 08:48
I used a simple code to test display text, so I dont think it have bug.
Here is the code:

mDisplayFont.setFamily("VT2012ADSymbols");

void MainWindow::paintEvent(QPaintEvent *event)
{
QPainter painter(this);
int key = 66;

mDisplayFont.setPointSize(48);
painter.setFont(mDisplayFont);
painter.drawText(50, 200, QString(QChar(key)));

mDisplayFont.setPointSize(72);
painter.setFont(mDisplayFont);
painter.drawText(150, 200, QString(QChar(key)));

mDisplayFont.setPointSize(100);
painter.setFont(mDisplayFont);
painter.drawText(250, 200, QString(QChar(key)));

mDisplayFont.setPointSize(200);
painter.setFont(mDisplayFont);
painter.drawText(350, 200, QString(QChar(key)));
}

I tried my font in both libre office and microsoft word ---> no problem happen.
I run the same code with both Qt in Window and in openSUSE: result like post #1.

If font have bug ---> libre office and ms word must display wrong
If code have bug ---> result in window and SUSE must display the same wrong
That make me confused X__X