Fonts and Text
Dear ImGui provides a powerful and flexible font system supporting TTF/OTF fonts, icon fonts, Unicode, and dynamic font sizing.New in 1.92 (June 2025): Fonts now support dynamic sizing! You can change font size at runtime without pre-loading multiple sizes. Glyph ranges are also automatic with updated backends.
Quick Start
Using Default Font
Setting Base Font Size
Loading Custom Fonts
Basic Font Loading
Since 1.92 (with updated backend):Loading Multiple Fonts
Using Fonts
Changing Active Font
Dynamic Font Sizing (1.92+)
Font Configuration
Advanced Font Options
Merging Fonts
Combine multiple fonts into one:Unicode Support
Using Unicode Text
Since 1.92: You don’t need to specify glyph ranges anymore with updated backends! Glyphs are loaded on-demand automatically.
Loading Fonts with Specific Ranges (Pre-1.92)
Icon Fonts
Use icon fonts like FontAwesome for visual icons:Setup
Using Icons
Common Icon Font Libraries
- Font Awesome - Popular icon set
- Material Design Icons
- IconFontCppHeaders - C++ headers for icon fonts
Loading Fonts from Memory
From Memory Buffer
Embedded Compressed Font
Font Atlas
Atlas Configuration
Atlas Flags
Text Rendering
Measuring Text Size
Colored Text
Wrapped Text
DPI Scaling
Global DPI Scale (1.92+)
Per-Platform Scaling
Troubleshooting
Debug Tools
Complete Example
Reference
- FONTS.md documentation
- ImFontAtlas API (line 3600+)
- Icon Font Headers
- Font atlas visualization in Metrics/Debugger window