Closed tingspain closed 1 month ago
Hello,
ImFontConfig.Name is a debug only string which was not filled. It is now
struct ImFontConfig
{
void* FontData; // // TTF/OTF data
...
// [Internal]
char Name[40]; // Name (strictly to ease debugging)
...
};
ImFontGlyph uses advanced C-style memory layout techniques: Colored and Visible use 1 bit each, and CodePoint uses 30 bits. They cannot be published as standard fields.
struct ImFontGlyph
{
unsigned int Colored : 1; // : 1 means "use one bit"
unsigned int Visible : 1;
unsigned int Codepoint : 30; // : 30 => use the 30 remaining bits to use 32 bits in total up until here
float AdvanceX;
float X0, Y0, X1, Y1;
float U0, V0, U1, V1;
// ==> I added the following getters for them, when using Python.
#ifdef IMGUI_BUNDLE_PYTHON_API
// [ADAPT_IMGUI_BUNDLE]
bool isColored() const { return Colored != 0; }
bool isVisible() const { return Visible != 0; }
unsigned int getCodepoint() const { return Codepoint; }
// [/ADAPT_IMGUI_BUNDLE]
#endif // IMGUI_BUNDLE_PYTHON_API
};
You may build from source to get the new features, or downloads wheels from here
@pthom Thank you very much. Really thanks for your time and for your fast reply.
I will check it tomorrow.
Closing, as this is now solved.
Hello,
I think that there is a minor issue with the method ImGui.GetIO().Fonts.Font[].get_debug_name(), as it returns an empty string for the font name.
Additionally, I'm uncertain whether this is a bug or an intended difference, but the glyphs[] property within ImGui.GetIO().Fonts.Font[] seems to lack the codepoint attribute. In my experience with the C# version of ImGui, glyphs[] typically includes the codepoint attribute. Could you clarify if this discrepancy is expected in this context?
Development Environment
DEMO VIEW