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

Wrong font size #6

Open
selimanac opened this issue May 11, 2020 · 2 comments
Open

Wrong font size #6

selimanac opened this issue May 11, 2020 · 2 comments
Labels
bug Something isn't working Merge mode

Comments

@selimanac
Copy link

selimanac commented May 11, 2020

First of all this is a great tool, I love it, thank you very much.

I have a stupid problem about the font sizes. But I 'm not sure why this is happening or what is wrong. I'll be glad if you can point me to the right direction.

Here is my font icon result. As you can see only (blue area) more than half of them is active. Looks like their size is wrong. This also cause a problem MainMenuBar's size(height) and those icons are not at the center of it.
2020-05-11 14-14-50 2020-05-11 14_16_54

My settings:

Screen Shot 2020-05-11 at 14 21 49

I guess merging fonts cause this problem. When I disable merging, it works

 // ImGui::GetIO().Fonts->AddFontDefault();
    static const ImWchar icons_ranges[] = {ICON_MIN_FileMenu, ICON_MAX_FileMenu, 0};
    ImFontConfig icons_config;
    // icons_config.MergeMode = true;
    icons_config.PixelSnapH = true;
    ImGui::GetIO().Fonts->AddFontFromMemoryCompressedBase85TTF(FONT_ICON_BUFFER_NAME_FileMenu, 22.0f, &icons_config, icons_ranges);

Screen Shot 2020-05-11 at 15 11 51

Is there a way to fix this? Any suggestions?

Thank you

@aiekick
Copy link
Owner

aiekick commented May 11, 2020

Hello,

thanks for your feedback.

yes merged font is a problem because many fonts use différent font scale.
so for a good merge we need to resize each glyph of a font to a specific font scale.
for the moment i use the font scale of the current selected font. its better to choose the font with the big size.

btw for each fonts the ascent/descent and baseline are different so can cause issue with position of glyph according to other on the final font display.

i have imrpoved a bit the merge, by finally found the way to write my glyphs,
but its always a work in progress.

you have test the last version ? or an oldest ?

@aiekick aiekick added the bug Something isn't working label May 11, 2020
@selimanac
Copy link
Author

btw for each fonts the ascent/descent and baseline are different so can cause issue with position of glyph according to other on the final font display.

Good to know this. So I guess it is better to separate icons and fonts.

you have test the last version ? or an oldest ?

I just pull the latest. I'm going to rebuild and try it today.

Thank you :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Merge mode
Projects
None yet
Development

No branches or pull requests

2 participants