aiekick / ImGuiFontStudio

Embedded Font Helper Gui Tool for programming
Apache License 2.0
384 stars 33 forks source link

Wrong font size #6

Open selimanac opened 4 years ago

selimanac commented 4 years ago

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 commented 4 years ago

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 ?

selimanac commented 4 years ago

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 :)