-
-
Notifications
You must be signed in to change notification settings - Fork 10.7k
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
FreeType and about Fonts #3611
Comments
Hello,
I don't think that's correct, So if you leave
You are referring to a wip/experimental branch commits those are not supported as this point, I don't think shadows rebuilt have been tested with FreeType yet, we were focused with designing the back-end side protocol. We'll look at this part eventually.
I don't know what this line is referring to (best to copy the code line) but I assume you mean the
Yes-ish, when we support dynamic rebuild I think we'll prefer to keep font data in memory so that shouldn't be a real issue. Will look at all those in details later, thanks for the feedback! |
Closing as this is all handled by WIP work on Specifically for (3) I have added a (4) is not necessary anymore. |
With FreeType you can use only same flags on every font.
I think better to delete "extra_flags" from here https://github.com/ocornut/imgui/blob/master/misc/freetype/imgui_freetype.cpp#L651-L673
and here https://github.com/ocornut/imgui/blob/master/misc/freetype/imgui_freetype.cpp#L323
And change:
if (!font_face.InitFont(ft_library, cfg, extra_flags))
to
if (!font_face.InitFont(ft_library, cfg, cfg.RasterizerFlags))
here https://github.com/ocornut/imgui/blob/master/misc/freetype/imgui_freetype.cpp#L362
FreeType and IsDirty().
FreeType fonts conflicts with IsDirty() here (imgui with shadows):
https://github.com/ocornut/imgui/blob/features/shadows/imgui_draw.cpp#L2635
https://github.com/ocornut/imgui/blob/features/shadows/imgui_draw.cpp#L2656
Removing these functions from the checks helps.
Error in fonts.
I think better to delete error here https://github.com/ocornut/imgui/blob/master/imgui_draw.cpp#L1903
Because its better to go the way of installing a different font if the first one is not found.
It would be good to add one more variable to ImFontConfig struct.
char FontPath[256];
////
memcpy(font_cfg.FontPath, filename+ '\x0', strlen(filename) + 1);
This struct has all the data needed to rebuild the font except FontPath.
Somthings to ImFontConfig.
This can be used for font rebuilding (because rebuilded FontData saves repeatedly and after a certain number of rebuild program eats 1.5 GB of RAM, originally it was 40 MB)
I hope I was able to help a little with something.
https://i.imgur.com/qdBhvqQ.mp4
The text was updated successfully, but these errors were encountered: