-
-
Notifications
You must be signed in to change notification settings - Fork 28
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
C2D_Text's width seems truncated when using C2D_AlignCenter #47
Comments
Help us to help you. It's much easier if we can build something simple to replicate the issue than to build an entire project and find the relevant part. The more work we have to put into replicating your issue the longer it's going to take for someone to find time to look.
This sounds like possibly a rounding issue somewhere. Would be easier with a simple testcase to look at. |
Fair, sorry. I have essentially zero coding knowledge, just whatever I've picked up bothering people with GitHub issues. I had a look and modified one of the 3ds-examples to repro this issue: vaguerant/3ds-examples@e260673 I'm printing the ABXYLR glyphs twice, once at an x position of |
Bug Report
What's the issue you encountered?
When using
C2D_AlignCenter
, characters at the edges of an individualC2D_DrawText
can become clipped horizontally. In the below screenshot, it is most noticeable on the(B)
buttons in the center button diamond, but it is also affecting the/L/
and(A)
characters to a lesser extent. Notably, the(B)
in the top row is also being aligned withC2D_AlignCenter
but not showing the issue.Each button glyph is a codepoint from the system font,
(A)
is\uE000
and(B)
is\uE001
./L/
and\R\
are\uE07B
and\uE07C
, respectively. I have not made any changes to devkitPro tooling, I am using the official devkitpro/devkitarm20240202
tag in Docker.How can the issue be reproduced?
Building my repo at vaguerant/red-viper is probably a decent start. If you want to replicate just the problematic portion, it can be found here and in the preceding variables: https://github.com/vaguerant/red-viper/blob/5ba407fbe4ab4706d8b8ab26f6c9c2ab5cbef7a3/source/3ds/gui_hard.c#L507-L510
Environment?
20240202
Additional context?
C2D_Text width
? e.g. A single, centered glyph with an odd number of pixels in its width would need to be placed an off-integer pixel to be truly centered. If Citro2D is centering the glyph and anti-aliasing, that would mean the width of the glyph itself is two pixels less than the aliased version which is "half" in one pixel at either side. Again, just speculating, I have no idea how Citro2D renders text or does anything at all.C2D_DrawText
calls by 0.5, presumably forcing them back onto a pixel boundary.The text was updated successfully, but these errors were encountered: