Skip to main content

Overview

Dear ImGui embeds default fonts for convenience, but you can load custom TTF/OTF fonts to match your application’s design and support various languages.
Since v1.92 (June 2025): Font system has been significantly improved with dynamic font sizing and automatic glyph loading.

Default Fonts

Dear ImGui embeds two default fonts:
  • ProggyClean.ttf - 13px pixel-perfect monospace font (doesn’t scale well)
  • ProggyForever.ttf - New scalable font mimicking ProggyClean
Define IMGUI_DISABLE_DEFAULT_FONT in imconfig.h to disable embedded fonts and save ~26 KB.

Loading Custom Fonts

Basic Font Loading

Since v1.92 (with updated backend):
Before v1.92 or without updated backend:

Setting Base Font Size

Loading Multiple Fonts

Dynamic Font Sizing (v1.92+)

Font Configuration

Advanced Options

Monospace Icons

Make icons monospace for better alignment:

Merging Fonts

Combine multiple fonts into one for seamless multi-language or icon support. Since v1.92 (with updated backend):
Before v1.92:

Excluding Overlapping Ranges (v1.92+)

Prevent conflicts when merging fonts:

Icon Fonts

Use icon fonts like FontAwesome for scalable icons in your UI.

Setup with IconFontCppHeaders

Since v1.92:

Using Icons

Multilingual Text Support

Loading Non-Latin Fonts

Since v1.92: Glyph ranges are unnecessary!
Before v1.92:

UTF-8 Encoding

All Dear ImGui strings must be UTF-8 encoded. Verify encoding:
Use u8 prefix:
Compiler settings:
  • Visual Studio: Add /utf-8 flag or #pragma execution_character_set("utf-8")
  • Ensure source files are saved as UTF-8
C++20 note:

Example Japanese UI

FreeType Rasterizer

For better quality at small sizes, use FreeType instead of stb_truetype:

FreeType Options

Colored Glyphs/Emoji

Loading from Memory

Embedding Fonts in Source Code

DPI Handling

Scaling Fonts

In Docking Branch

Debugging Fonts

Metrics Window

UTF-8 Encoding Viewer

Check Glyph Coverage

In Metrics window:
  1. Expand “Fonts” section
  2. Select your font
  3. View loaded glyphs and coverage

Common Font Resources

Monospace Fonts

Icon Fonts

Multilingual Fonts

Best Practices

The misc/fonts/ folder contains example fonts for reference. See FONTS.md for credits and licenses.

See Also