Skip to content

Corrupted font rendering in P3D/OPENGL #199

@wit221

Description

@wit221

I have posted about the issue in the forum but did not receive any response.
Here are some previews of the issue received from different people:

http://imgur.com/a/3PQP8
http://imgur.com/a/eL6eM
http://imgur.com/3lrVQ1l
https://imgur.com/a/8iVjy
http://imgur.com/5NN6rNm

The way I implement text rendering is the following:

fontLarge = createFont("Caviar_Dreams_Bold.ttf",(int)8*displayWidth/100, true);
textFont(fontLarge);

where 8*displayWidth/100 is the maximum font size in the application.
I then use textSize() to resize that font depending on the size it should have and use both the three arguments and the 5 arguments text() method.

The issue appears on some devices, on some not. The general trend I observed is that the issue appears on high pixel density devices but not on lower ones. It is only a general observation, since the font problem does not appear on, for instance, the s6 edge, which has the same density and resolution as the N6P, which does have the issue. The bug seems to be independent of the android version and locale.

I have tried switching from P3D to OPENGL, to no avail. I have tried, isntead of using createFont(), to create fonts in the Processing IDE and then importing them to the assets folder and using loadFont(), to no avail. I have tried to change the font numerous times, to no avail.

The only differences I see every time I implement a change is that a different set of letters is not displayed properly. As a matter of fact, when I changed the font and decreased the size considerably when I create the font, only signs (such as "!", ",",".") appear.

In some devices, the bug appears in a different way: instead of fully showing some letters and not showing others at all, letters overlap:

http://imgur.com/2aZIyE6

The longer the application runs, the more corrupted the font is:

http://imgur.com/Y8iBGKL

This suggests textSize() might be the culprit, since it is the only method I call besides text() that deals with font rendering.

At a given time, if a glyph is bugged, it is bugged in the same way on the entire screen. For instance, if "p" is displayed as an overlay of "&" and "r", then all "p"s on the screen will be displayed as an overlay of "&" and "r".

Is it an error in my implementation or a bug?

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions