aiekick / ImGuiFontStudio

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

Not a valid font file ttf error (using Windows release binary) #17

Closed moebiussurfing closed 2 years ago

moebiussurfing commented 2 years ago

Describe the bug Opening the generated ttf is giving an error. .h file look fine. That happened using one only font or/and merging/picking from many fonts.

Screenshots fonts

Desktop (please complete the following information): Windows 10

Additional context Thats the binary that I used: https://github.com/aiekick/ImGuiFontStudio/releases/download/b0.5/ImGuiFontStudio_Msvc_Win32.exe

Should I compile a new version from the repo by myself?

Thanks!

moebiussurfing commented 2 years ago

I compiled the current master branch binary, but still getting the same error ... (Also when only using one font.) Any idea?

aiekick commented 2 years ago

Hello, i know there is some problems with some fonts chek this past issue : #14 the goal of this tool was first for programming and especially for imgui. there is better tool for general use, like fontforge. Not sure why its broken, the generation of font is partial, by ex, i not support composites glyphs and some others features. this is why there is no release for the moment. if you can open it with stb or freetype in ImguiFontStudio, so you will be able to open it with imgui for your app. and this the why this tool was created. btw you have the code, so you can try to found the bug, because i have no time to work on it for many months.

moebiussurfing commented 2 years ago

Ok. thanks.

I tried to open the "broken" ttf and the .h into my ImGui project codes and it worked. I don't need FontForge at all, or to open the font anywhere else, I just want to make my ImGui buttons.

tempsnip

Now I need to learn a bit to layout fine into the buttons, centered etc..

aiekick commented 2 years ago

i think its better to use two font instead of one merged. because when you merge glyphs, you have source fonts who have differents scale, base line and other things, than can produce different placement of glyphs in the same font. thais is why in ImGuiFontStudio there is a pane for preview the final font for a text. image because with it you can move glyphs for match your text

if you merged two font who are using the same params, its ok but if not can be an issue.

for your issue, you need to check the font scale at start