Skip to content
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

Text Bottom Padding Bug #7555

Closed
Iacaka opened this issue May 4, 2024 · 1 comment
Closed

Text Bottom Padding Bug #7555

Iacaka opened this issue May 4, 2024 · 1 comment

Comments

@Iacaka
Copy link

Iacaka commented May 4, 2024

Version/Branch of Dear ImGui:

Version 1.94, Branch: docking

Back-ends:

imgui_impl_vulk.cpp + imgui_impl_glfw.cpp + custom vulk backend

Compiler, OS:

Windows 10

Full config/build information:

No response

Details:

Hello! Sorry if I'm missing something and this is completely obvious, but i can't seem to figure out the problem;

I am trying to make a button, using custom font and all, and i want to center it, but the bottom is always bigger than the top.

I have set the frame padding and the text align so the bug is more visable:
ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(0, 0));
ImGui::PushStyleVar(ImGuiStyleVar_ButtonTextAlign, ImVec2(0.f, 0.f));

The problem is only there when i try to change the font to other ones, but there is no problem on the default one.

The fonts I am showing are: ST-SimpleSquare and Helvetica.
(i upscaled the def font in the photos so it is more visible)

!- maybe it is for the letters that have down hangers/cops like: j - y - q - g - p,
but still i must ask how to center it.

Screenshots/Video:

image
image
image

@Iacaka
Copy link
Author

Iacaka commented May 6, 2024

Nailed it! It is from letter with down hangers and cops.

image

@Iacaka Iacaka closed this as completed May 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants