本文主要介绍ImGui应用中的一些界面优化方法,如果是第一次使用ImGui推荐从上一篇文章开始:使用C++界面框架ImGUI开发一个简单程序,最终的界面效果如下: 下载IconFontCppHeaders里的IconsFontAwesome6.h文件引入到项目,然后下载fa-solid-900.ttf放到项目根目录,把系统字体目录下的msyh.ttc也移到根目录。项目文件如下: 参考IconFontCppHeaders的示例,字体加载的代码如下: float baseFontSize = 30.0f; ImFont* font = io.Fonts->AddFontFromFileTTF ( "msyh.ttc", baseFontSize, nullptr, io.Fonts->GetGlyphRangesChineseFull() ); IM_ASSERT(font != nullptr); // FontAwesome字体需要缩小2.0f/3.0f才能正确对齐 float iconFontSize = baseFontSize * 2.0f / 3.0f; static...
Is this you? As a journalist, you can create a free Muck Rack account to customize your profile, list your contact preferences, and upload a portfolio of your best work.
Claim your profile
Articles by Void HideTabBar
Actions
Is this you?
As a journalist, you can create a free Muck Rack account to customize your profile, list your contact preferences, and upload a portfolio of your best work.Get in touch with Void
Contact Void, search articles and posts on X, monitor coverage, and track replies from one place.
Learn more about Muck Rack