-
Notifications
You must be signed in to change notification settings - Fork 270
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Glyph Boundary Pixel Errors #123
Comments
In |
A padding.left of 1 solves the issue. It seems a padding at the left and right is required. I will do some more tests later today. |
It works now fine on all devices. Closing this ticket. |
Just FYI, I'm seeing this too on Os X. struct {
int left;
int top;
int right;
int bottom;
} padding = { 0, 0, 1, 1 }; I get this result, where not all of the glyphs have the font overflown, but only some: Now, after hours of debugging and finding this bug report (thx for pointing out to the padding!) Seems that with left padding, some of the font glyphs get positioned too close and the data spills to incorrect glyphs. Running Mac Os X 10.11.6, non-retina display. The demos do not show this artifact for some reason, but I didn't want to go through the troubles of changing the demos from orthographic projection or add zooming controls to maybe see if the artifact is happening when zooming in enough. Here's a comparison showing the actual quads being renderered: With modified {1, 1, 1, 1} padding: |
You suggest we have to modify the padding then ? Can you make a PR (and points to this issue in the comment) ? |
@rougier Well. I will still test this with my retina mac also and see if it works, then I can take a look at creating a pull request. Could this be an issue on Os X only, the Truetype library doing something different than in Windows ? No idea. Stragne thing is I don't see this happening in the provided demos, might be though that the cases are such that this doesn't show up ? I went through the glyph dimensions, positions and shader code to make sure all of those were same in my personal code and in the demos, and still in my own project I could see the offset, although I think the demos were using orthographic projection, that could explain it too, haven't tested orthographic yet on my own project. |
In any case, it would be better to open a new issue because this one is closed. People will ba able to test on different architectures. |
@inDigiNeous I had the same issue on a Raspberry Pi. So this is not related to the retina display. I guess it is related to rounding issues and interpolation. Fractional floats are used for the glyph positions and with interpolation on (which I am using) unwanted pixels might be included while rendering the textures. I would assume it is also related to the size of the atlas. In my case I am using a 512x512 bitmap. |
@cbratschi Okay. I noticed that a padding of 1,1,1,1 wont help in all cases, that would still at some edge case show a tiny strip of lines overflowing, when zooming this can become visible. So maybe with 2,2,2,2 padding this might be fixed. Maybe this should be adjustable by the user when calling ? |
@inDigiNeous how large is your atlas texture? 512x512? |
@cbratschi 2048x2048, testing with pretty big fonts so that scaling looks good. |
With default padding? If not, can you try to increase? |
this is cloning from GitHub and compiling as is -- will take a look! |
On macOS X with a retina display I am seeing thin vertical lines at the boundary of glyphs. On a Raspberry Pi the hairlines are also visible if the text is zoomed. Changing from GL_LINEAR to GL_NEAREST did not improve the situation. Is there a simple way to add a thin border between glyphs in the atlas?
At the top you can see the atlas texture and the rendered text in blue below.
The text was updated successfully, but these errors were encountered: