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

Merged fonts not working #7

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

Merged fonts not working #7

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

Comments

@selimanac
Copy link

I did merge two different font files. Fonts from second file(tasks.ttf) is not working from generated as header+cpp. Files are attached below.

Screen Shot 2020-05-11 at 22 08 12

Header + CPP files: Archive.zip

 ImGui::MenuItem(ICON_FileMenu_ROOT); // Not showing
 ImGui::MenuItem(ICON_FileMenu_OPEN);

Screen Shot 2020-05-11 at 22 10 58

@aiekick
Copy link
Owner

aiekick commented May 11, 2020

Hello,

ok thanks, i will test.

can you give your font file for a test case ?
if you cant, can you open the merged font file in the soft and show the result.
if you not see the glyph, display the glyph panel and select it in the current font pane, for see the result.
maybe its merged but maybe theses glyph are very very small.
i had the case with my tests.

what are the resolution of the two fonts you use ?
maybe one is very small compared to other ?

the best case is to have two font with exactly same ascent/descent and baseline for the moment.

for the moment the quick thing you can do is to use the old way :

  • merge manually the glyphs you want from one font file to another font file via by ex fontforge.
    (like that you can adjust glyph size, pos and others things
  • use this merged file for generate in ImGuiFOntStudio the cpp/headers files.

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

can you give your font file for a test case ?

Fonts and .ifs file is attached below.
fontstudio.zip

what are the resolution of the two fonts you use ?
maybe one is very small compared to other ?

They should be same because I draw some of them . If they are not then I made a mistake when drawing.

the best case is to have two font with exactly same ascent/descent and baseline for the moment.

Sorry, I have no idea about that. I use icomoon.io to prepare icons/fonts

merge manually the glyphs you want from one font file to another font file via by ex fontforge.
(like that you can adjust glyph size, pos and others things
use this merged file for generate in ImGuiFOntStudio the cpp/headers files.

I will, thank you.

@aiekick
Copy link
Owner

aiekick commented May 12, 2020

i have maybe another explain.

there is two type of font glyphs.
the simple glyph and the compound glyph.
Compund glyph is composed of many other glyph available in font.

ImGuiFontStudio can export for the moment only simple Glyph.
so if your glyph is a compund he is empty in the merged font

Edit : i have tested and indeed its a bug. many glyphs seems not exported. and they are all simple glyphs. i will check that tonight :)

aiekick added a commit that referenced this issue May 12, 2020
… bad font format.

not in all case (not seen with my fonts), but can
so just added an option for disable it in generator settings,
 if the user ensure than he not want glyph rescale
just a little help, the time to analyse what is wrong. can take some time
@aiekick
Copy link
Owner

aiekick commented May 12, 2020

the glyph re write can produce some time a bad format of font file.
i not seen that with my fonts, but he is with your font.

i found its due to maybe one glyph who produce bad rewrite and a corrupted file
with other or less selection some time it work some time not.
will be difficult to found why, but its interesting.

by the way for the moment i have added a option for disable the glyph rescale, if the user want.
Glyph rescale is needed if font ascent/descent are different. in your case its same.
but the glyph resize in fact is according the bounding box of each glyph.

btw with this option (in generator pane in settings), each glyphs are just moved from one font to the merged font result. no rewrite, no corruption, but no rescale/translation, so some glyph can be badly positionned regarding other.

if you need to adjust some glyphs, you can modify if with fontforge (edit the glyph you want), and finish the job in ImGuiFontStudio :)

see :
WWrnxciblJ
To note :
The quick button i use is only available in debug mode, no impact on the normal way.
The result will be same

@aiekick
Copy link
Owner

aiekick commented May 13, 2020

had some issue on last fix for macos/linux. but its fixed now. so you can pull

aiekick added a commit that referenced this issue May 15, 2020
Can be important for check if Font Format is bad or not.
regarding lat issue #7 on merged font generation.
very difficult to see here is the error
@selimanac
Copy link
Author

Sorry for late response. This works great, thank you :)

@aiekick
Copy link
Owner

aiekick commented May 15, 2020

it seems your two fonts have issue. in fontforge when you go in menu : element / validation (for french menu)

he found many errors on many glyphs ,and seem to be the glyphs we not see after merge.
like the Root glyph

So the question is : how can we avoid issue with bad glyph format :)

@selimanac
Copy link
Author

selimanac commented May 15, 2020

how can we avoid issue we bad glyph format :)

Yeah, it is my bad :) Sorry about that. I don't know much about glyph. I have Fontforge installed but looks too complex to me. So I did use the icomoon.io for generating fonts from my svg files. I draw those svg's at Illustrator by using Material Icons guideline. But it is highly possible that I did some mistakes when drawing. Also it is possible that icomoon.io is failling at some point and cause this problem.

I will definitely check out the Fontforge properly.

Thank you.

@aiekick
Copy link
Owner

aiekick commented May 15, 2020

np, its interesting, all the softwares can avoid the issue and generate good font.
so i need to do same. just to found the exact issue in my generation and found a solution :)

and its in my plan to have the possibilite to draw glyph and merge svg, so at a moment i need to be robust for this generation :)
thanks np :)

@aiekick
Copy link
Owner

aiekick commented May 16, 2020

i found, the cmap table who is responsible of glyph mapping, is badly generated.
so maybe on some font like yours cause some border effect on some glyphs.
i seen crash of stb_truetype with my generated font..

@selimanac
Copy link
Author

it seems your two fonts have issue. in fontforge when you go in menu : element / validation (for french menu)

he found many errors on many glyphs ,and seem to be the glyphs we not see after merge.
like the Root glyph

This was really helpful, thank you. I clean all errors by using Fontforge.

@aiekick
Copy link
Owner

aiekick commented May 18, 2020

so, after glyph correction in font forge, the merge in ImGuiFontStudio was ok ? this is that ?

@selimanac
Copy link
Author

so, after glyph correction in font forge, the merge in ImGuiFontStudio was ok ? this is that ?

Yes it is. It is ok in ImGuiFontStudio. Problems was about my faults(drawing directions and wrong compound paths may cause fail).

@aiekick
Copy link
Owner

aiekick commented May 19, 2020

ok good to hear. i will try to detect and correct bad path so.
thanks

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