-
-
Notifications
You must be signed in to change notification settings - Fork 10.4k
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
imgui_freetype: Can not use CBDT/CBLC font #8190
Comments
Maybe @pthom would know? |
Hi, Looking at https://learn.microsoft.com/en-us/typography/opentype/spec/cbdt , we see:
So, this font is actually a combination of PNG files. It likely scales poorly. Using PlutoSVG or LunaSVG will not help in loading png data.
I Don't know, but PNG is not a vector format, so it is unlikely. I don't even understand why it ended up being accepted as a viable font format. As an alternative, I would recommend using a colored SVG font, such as NotoColorEmoji-Regular.ttf See sammycage/lunasvg#150 where an issue when loading this font was solved in ImGui. You will need to define IMGUI_ENABLE_FREETYPE_PLUTOSVG , as mentioned in https://github.com/ocornut/imgui/blob/master/misc/freetype/README.md |
And as far as your specific font is concerned, you would need to enable PNG support in freetype. I'm not sure it will be enough, though. I failed displaying glyphs from this particular font on my side, even with png support in freetype. |
How to directly load png maps to characters |
AddCustomRectFontGlyph is a good way? |
Yes. But notice this issue, you need to mark the glyph as colored: |
Version/Branch of Dear ImGui:
Version 1.XX, Branch: XXX (master/docking/etc.)
Back-ends:
imgui_impl_dx11_cpp + imgui_impl_dx11.cpp
Compiler, OS:
win10
Full config/build information:
Details:
I used the FREETYPE_LUNASVG flag to load TwitterColorEmoji-SVGinOT.ttf and noto-untouchedsvg.ttf, but I still cannot load AppleColorEmoji.ttf.
Can CBDT/CBLC color font format be supported? Or is there a way to convert CBDT/CBLC to SVG format?
Screenshots/Video:
No response
Minimal, Complete and Verifiable Example code:
No response
The text was updated successfully, but these errors were encountered: