Text rendering problem - missing glyphs using Label

#1

I’m using a ListBox to show a rather long list of text and other values in a OpenGL driven window.
The text cells are custom Labels looking like this:

EventListTextFieldCell::EventListTextFieldCell(TableListBox& listBox) :
Label(""), _tableView(listBox)
{
    this->setColour(Label::backgroundColourId, Colours::transparentBlack);
    this->setColour(Label::outlineColourId, Colours::transparentBlack); 
    this->setMinimumHorizontalScale(1.0f);
}

I had customers complaining in the past that the rendered text would be missing letters but that everything would be fine when the text is double-clicked to edit it.
I could reproduce that but couldn’t find out why it behaved that way. I was in a hurry and just tried a different font and it looked like it worked then.

Just today I got another customer complaining about the same behavior. He sent me this screenshot:

Eventlist%20dialog%20bug%201

See the gaps?
The line near the bottom should read:
“Ohrenquallen gibt es seit fünfhundert Millionen Jahren, ohne, dass sie sich jemals besonders verändert haben”

When the text is double-clicked, it displays fine.
Can anyone tell me why it would behave that way?
Can this be related to the this->setMinimumHorizontalScale(1.0f) call?
I don’t want the text to be squeezed as I don’t like the look of it and it also slows down rendering massively if I remember correctly especially with lots of lines.

Any help would be appreciated!

0 Likes

#2

I have had the same problem.
In my case I figured out that I had to compile with the utf-8 compiler option inside Microsoft Visual Studio. After some time the error appeared again. Turns out my source file was Latin1 instead of UTF-8. Don’t know why, but it was the only cause for my problem! (Looked exactly the same)

0 Likes

#3

Thanks for the comment. I’m sure it’s not a charset issue as the text that is shown contains UTF-8 characters and this is currently a Mac-only app, so the VS option can’t be it.

Also, everything is drawn correctly when the text is double-clicked.
That’s what makes it so odd and I really don’t know what I could try.

0 Likes

#4

I had the same problem a few days ago and I wasn’t able to figure it out.

0 Likes