aiekick / ImGuiFontStudio

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

Bug: font studio generates broken fonts #14

Closed Vine1 closed 3 years ago

Vine1 commented 3 years ago

Hi! You created an awersome tool. Thank you! But it doesn't work for me. I get an error after generating a font: image As far as I understand, it tries to load just generated font, but it can't because the font is broken. Also, I tried to manually open generated font using OS font viewer and font studio, both give an error.

How I have compiled it:

Then I just created a new project, opened just downloaded FontAwersome font, selected all glyphs, and pressed generate. I didn't change any settings. Font studio opened header file (ok), png (ok), but the font generated by the studio was broken, so, I got this error message. Also, I tried different fonts.

OS: Linux 5.10 Compiler: GCC (10.2) CMake: latest (3.19)

Screenshot: image

I hope for your help! Thanks in advance!

aiekick commented 3 years ago

So its not an awesome tool, if you cant make it working :(

i reproduce the same issue than you. freetype was NOk, but stb was OK

if you select STB rasterizer he is working ?

i know, than the font writer have issues with freetype (this is why there is no release for the moment, many bugs on generation) im curently write my own, for quit sfntly

for your issue i will analyse and maybe adress a quick fix if i found it :)

aiekick commented 3 years ago

i just commited a fix. its working on my side. can you confirm ?

Vine1 commented 3 years ago

@aiekick I checked the STB rasterizer in the previous commit, it doesn't work too. Also, I checked the latest commit, but there is another problem. I can't generate a font. It gives me an error "Could not open font file", but the font file had been opened earlier. Screenshot: image Also, I tried to do it several times with other font files under root, still doesn't work. With STB too.

aiekick commented 3 years ago

yes i seen this issue with a bad message. jsut corrected too.

now its working ?

Vine1 commented 3 years ago

Oh, I just forgot to select glyphs =) Now fonts generate correctly with both modes. Almost. Generated font can be correctly opened in font studio and from ImGui, but the Linux default font viewer still can't read the font. The original font reads normal. Original font: image Font generated by font studio with all selected glyphs(but works in ImGui and font studio): image This is not a big problem, the main thing is that imgui normally opens the font.

aiekick commented 3 years ago

ok, until i not regenerate all font object; this kind of things can happen. my goal is not to do a general font tool. for that there is better alternative like fontforge. my tool is mores specific for programmer and especially embedded font. and truetype is a old format many tool sue different rules for say if a ttf is ok or not. some time freetype not want to open font, but other tool are ok.. so not sure if we can have a good way in all cases :) i will check this tool. but maybe another table is wrong, i just generated the base tables..

i jsut tried with fontawesome.ttf (in sample_fonts) dir and it work also in linux font viewer i have on my ubuntu.. weird..

aiekick commented 3 years ago

to be sure, what is the name of your foot viewer ? for found it and do some tests with him