Commit Graph
100 Commits
Author SHA1 Message Date
ocornut 8269924c33 Backends: GLFW: added ImGui_ImplGlfw_GetContentScaleForMonitor(), ImGui_ImplGlfw_GetContentScaleForWindow() helpers.
# Conflicts:
#	backends/imgui_impl_glfw.cpp
2025-06-11 16:13:49 +02:00
ocornut 9da3e6696a Backends: SDL2: added ImGui_ImplSDL2_GetDpiScaleForDisplay(), ImGui_ImplSDL2_GetContentScaleForWindow() helpers. 2025-06-11 16:12:41 +02:00
ocornut d72e66cdee Examples: remove comments/references about baking and GetGlyphRangesJapanese(). 2025-06-11 16:11:03 +02:00
ocornut 2d2b1cee6b Fonts: internals: renamed g.FontSizeBeforeScaling to g.FontSizeBase for consistency.
# Conflicts:
#	imgui_internal.h
2025-06-11 16:10:45 +02:00
ocornut 3c27c643a9 Fonts: internals: renamed g.FontScale to g.FontBakedScale for clarity. Comments. 2025-06-11 16:10:18 +02:00
ocornut d85e22d205 Added style.FontScaleDpi which is the field overwritten by ImGuiConfigFlags_DpiEnableScaleFonts.
# Conflicts:
#	imgui.cpp
#	imgui.h
#	imgui_demo.cpp
2025-06-11 16:09:56 +02:00
ocornut 8766efcba6 (Breaking) Renamed io.FontGlobalScale to style.FontScaleMain.
# Conflicts:
#	imgui.cpp
2025-06-11 16:07:21 +02:00
ocornut 80c08f2286 (Breaking) Fonts: obsoleting SetWindowFontScale().
+ Comments

# Conflicts:
#	imgui.cpp
2025-06-11 16:07:05 +02:00
ocornut 59a11363a5 Fonts: ground work for allowing SizePixels to be optional. 2025-06-11 16:06:24 +02:00
ocornut 402db2ef32 Fonts: fixed passing negative sizes to stb_truetype loader. 2025-06-11 16:06:24 +02:00
ocornut 1e118ab891 Fonts: added ImGuiStyle::FontSizeBase. Ensuring PushFontSize() works before main loop and across NewFrame().
# Conflicts:
#	imgui.cpp
2025-06-11 16:06:21 +02:00
ocornut b029be6b6c Fonts: avoid calling GetFontBaked() during SetFontSize(). Also fixes loading extraneous baked on atlas that will be locked
e.g. PushFontSize() before NewFrame() on legacy backend.
2025-06-11 16:06:00 +02:00
ocornut 033cdc4133 Fonts: comments and slight packing of ImFontConfig fields. 2025-06-11 16:06:00 +02:00
ocornut 69547bd4bd Fonts: ImFont::DefaultSize -> ImFont::LegacySize. ImFontFlags_UseDefaultSize -> ImFontFlags_DefaultToLegacySize. 2025-06-11 16:06:00 +02:00
ocornut e3860aa6ac (Breaking) Fonts: removing obsolete ImFont::Scale. 2025-06-11 16:05:54 +02:00
ocornut 25f9c318e3 Fonts: added "Input Glyphs Overlap Detection Tool". Added "Clear bakes", "Clear unused" buttons. Move code. 2025-06-11 16:05:54 +02:00
ocornut 5926c877a1 Fonts: detect if ImFontAtlasUpdateNewFrame() is not being called. 2025-06-11 16:05:54 +02:00
ocornut 9f8b4bdaf1 Fonts: fixed edge case calling RenderText() without priming with CalcTextSize(). 2025-06-11 16:05:49 +02:00
ocornut b2343d6247 Fonts: fallback to default default rasterizer density + pick one from existing viewports at the time of calling AddUpdateViewport().
# Conflicts:
#	imgui.cpp
2025-06-11 16:05:33 +02:00
ocornut 83aad81279 Fonts: comments + made IMGUI_DEBUG_LOG_FONT() work without an ImGui context. 2025-06-11 16:02:10 +02:00
ocornut f3780c7354 Fonts: adding GetFontBaked() in public API. 2025-06-11 16:02:10 +02:00
ocornut 92ff153763 Fonts: added notes/comments and dummy type about renaming ImFontBuilderIO::GetBuilderForFreeType() to ImFontLoader::GetFontLoader(). 2025-06-11 16:02:10 +02:00
ocornut 3d848a886a Fonts: fixed support for IMGUI_STB_NAMESPACE. 2025-06-11 16:02:10 +02:00
ocornut 822903e56d Fonts: fixed ImFontAtlas::RemoveFont() with multiple sources.
Thanks cyfewlp!
2025-06-11 16:02:10 +02:00
ocornut 5ee9845559 Fonts: automatically set current rasterizer density to viewport density. Effectively should fix most things on macOS.
# Conflicts:
#	imgui.cpp
#	imgui.h
2025-06-11 16:02:09 +02:00
ocornut ea756ede16 Fonts: reorder ImFontFlags according likelihood of being useful. 2025-06-11 15:59:20 +02:00
ocornut 1b51a88bba Fonts: moved compare operators to internal. Removed commented out ones aimed legacy backends: not needed anymore since we didn't rename ImTextureID. 2025-06-11 15:59:20 +02:00
ocornut 91ed6e67b4 Fonts: fixed support for multiple atlases.
Moved FontAtlasOwnedByContext to OwnerContext

# Conflicts:
#	imgui.cpp
#	imgui_internal.h
2025-06-11 15:58:29 +02:00
ocornut 65e6039979 Fonts: remove unnecessary ImDrawListSharedData::FontAtlas which is actually getting in the way of using multiple atlases. 2025-06-11 15:57:44 +02:00
ocornut 46fa9e8efb Fonts: Debug display status. Fixed truncated raw texture id. Fixed FormatTextureIDForDebugDisplay(). Comments. 2025-06-11 15:57:35 +02:00
ocornut f6735c223c Fonts: remove ImFontHooks in favor of a AddRemapChar() implementation. 2025-06-11 15:57:35 +02:00
ocornut 89e880dfd1 Fonts: adding ImFontHooks for codepoint remapping. 2025-06-11 15:57:35 +02:00
ocornut 8523cbdf58 Fonts: rework ImFontLoader::FontBakedLoadGlyph() interface 2025-06-11 15:57:35 +02:00
ocornut b32ef3c05d Fonts: make RasterizerDensity a dynamic field. (temporarily exposed as SetFontRasterizerDensity()).
# Conflicts:
#	imgui.cpp
#	imgui.h
2025-06-11 15:57:35 +02:00
ocornut 5310f5fba3 Fonts: rework toward reducing reliance on ImFontConfig::DstFont since we ought to separate them. 2025-06-11 15:57:23 +02:00
ocornut 2b0d49a905 Fonts: make ImFont::Sources a vector.
Later it should become a ImSpan<>
2025-06-11 15:57:23 +02:00
ocornut e7efe94fd2 Fonts: shallow rework of ImFontAtlasBakedAddFontGlyph() to facilitate upcoming change. 2025-06-11 15:57:23 +02:00
ocornut 890fff92fd Fonts: rename many internal functions for consistency. No other changes. 2025-06-11 15:57:23 +02:00
ocornut c4fa9bb61f Fonts: add ImFontGlyph::SourceIdx. Extract code out of DebugNodeFont() into DebugNodeFontGlyphesForSrcMask().
(src_mask unused in this commit)
2025-06-11 15:57:23 +02:00
ocornut bcd1a94b89 Fonts: Extract ImFontAtlasBuildGetFontBaked() out of ImFont::GetFontBaked() mostly for consistency with upcoming changes + tweak locals in AddFont(). 2025-06-11 15:57:23 +02:00
ocornut 7840e453b5 Fonts: ImFontAtlasBuildInit() is always called with atlas->Builder == NULL. 2025-06-11 15:57:23 +02:00
ocornut eb650c468a Fonts: fixed unused variable warning. 2025-06-11 15:57:00 +02:00
ocornut c43b138a69 Fonts: no need to load current baked on SkipItems window? + removed unused field.
Avoid baked staying active after GC. Might cause issues.

# Conflicts:
#	imgui.cpp
2025-06-11 15:56:59 +02:00
ocornut cdfa537adf Fonts: packing of shared basic/line/cursor data uses more public API. 2025-06-11 15:56:39 +02:00
ocornut ed2bb2cff0 Fonts: encode additional data in ImFontAtlasRectId to detect invalid id + added Rects debug browser. 2025-06-11 15:56:39 +02:00
ocornut 0436fba13c Fonts: fixed compaction gc-ing baked fonts used in the current frame + rename. 2025-06-11 15:56:39 +02:00
ocornut e8035b94e5 Fonts: misc tidying up. 2025-06-11 15:56:38 +02:00
ocornut d789263e08 Fonts: internal rendering uses higher level functions. 2025-06-11 15:56:38 +02:00
ocornut 12599da53d Fonts: do not mark whole ImTextureData struct as IMGUI_API to fix warning when used in ImVector<> (8559) 2025-06-11 15:56:38 +02:00
ocornut fb5c537080 Fonts: changing loader/backend or loader flags may be done without losing custom rects. Sharing more code. 2025-06-11 15:56:38 +02:00
ocornut 526a5d0f8a Fonts: tidying up. 2025-06-11 15:56:24 +02:00
ocornut 1ea9ff3677 Fonts: add optional out parameter to AddCustomRect() 2025-06-11 15:56:24 +02:00
ocornut 074bf39e40 Fonts: GC Compact All exposed in Metrics->Memory Allocations includes compacting texture data. 2025-06-11 15:56:24 +02:00
ocornut 23dc46c4f8 Fonts: added RemoveCustomRect().
+ internally add ImFontAtlasPackReuseRectEntry()
2025-06-11 15:56:24 +02:00
ocornut e9cf3de58f Fonts: moved ImFontAtlasRectId back to public API. 2025-06-11 15:56:24 +02:00
ocornut 69d28f867c Fonts: added ImFontAtlasRectId_Invalid == -1 2025-06-11 15:56:24 +02:00
ocornut db30e1b5b6 (Breaking) Fonts: rework GetCustomRect() api. Reintroduce ImFontAtlasRect. 2025-06-11 15:55:51 +02:00
ocornut f40274702d (Breaking) Fonts: renamed AddCustomRectRegular() -> AddCustomRect(). 2025-06-11 15:55:51 +02:00
ocornut 253dff7656 Fonts: Comments. 2025-06-11 15:55:38 +02:00
ocornut 9324961cd2 Fonts: fixed calling AddFontXXX not invalidating texture for legacy backends. 2025-06-11 15:55:28 +02:00
ocornut 44498825cd (Breaking) Fonts: PushFont() default to preserve current font size. 2025-06-11 15:54:53 +02:00
ocornut 168b97c291 Fonts: removed size rounding in AddFont() which breaks relative sizing of merged fonts (8502)
# Conflicts:
#	imgui.cpp
2025-06-11 15:54:52 +02:00
ocornut 2de15dc64b Fonts: fixed legacy backend path preloading all sources sizes erroneously + failing to use ellipsis. 2025-06-11 15:54:26 +02:00
ocornut 5460903f96 Fonts: awkwardly alias old TexID name to TexRef using an union (may backtrack and just keep old name) 2025-06-11 15:54:26 +02:00
ocornut cb4c03756a Fonts: detect if backend assign to texture on creation but doesn't update Status. 2025-06-11 15:54:26 +02:00
ocornut a548cd9934 Fonts: avoid both ImTextureRef fields being set simultaneously. 2025-06-11 15:54:12 +02:00
ocornut 0fff7ceda4 Fonts: comments, tweaks, minor amends.
Comments, tweaks
2025-06-11 15:53:42 +02:00
ocornut 8bd1fc4f04 Textures: Added ImTextureRef::GetTexID() mostly for consistency.
Without it the logic may seem more confusing to grok for end-user.
2025-06-11 15:53:42 +02:00
ocornut cc65015e4e Fonts: fixed crashing password fields.
# Conflicts:
#	imgui_internal.h
2025-06-11 15:53:41 +02:00
ocornut 41517bca0c (Breaking) Fonts: renamed CalcCustomRectUV() to GetCustomRectUV() for simplicity. 2025-06-11 15:52:21 +02:00
ocornut 4048494aa1 Fonts: rename ImFontAtlasBuildClearTexture() to ImFontAtlasBuildClear(). 2025-06-11 15:52:21 +02:00
ocornut f816b861fc (Breaking) Fonts: rename GetCustomRectByIndex() to GetCustomRect(). Made return struct const. 2025-06-11 15:52:12 +02:00
ocornut 85d0507580 Fonts: narrowed invalid value for ImFontAtlasRectId to -1 a we will change implementation. 2025-06-11 15:52:12 +02:00
ocornut b12c42e75d Fonts: change uses of ImFontAtlasRect to ImTextureRect for simplicity. 2025-06-11 15:52:12 +02:00
ocornut e76cfe5aad Fonts: fixed implicit init when calling AddCustomRectRegular(). LoaderShutdown match BuildDestroy. 2025-06-11 15:52:12 +02:00
ocornut 52a6863771 Textures: ImTextureData pixels are not immediately destroyed on setting ImTextureStatus_WantDestroy. 2025-06-11 15:52:12 +02:00
ocornut 735d31e54a Demo: Exposed some basic UI in demo for sanity. 2025-06-11 15:52:04 +02:00
ocornut 41a0e991f0 Fonts: Added UI to edit FreeType loader flags. Added ImFontAtlasBuildReloadAll() / ImFontAtlasBuildReloadFont() 2025-06-11 15:51:56 +02:00
ocornut 40f988ce2a Fonts: in ShowFontAtlas() preserve open-state for latest texture. Improve debug display. 2025-06-11 15:51:56 +02:00
ocornut c98e3c0eff Fonts: ImFontConfig::GlyphExcludeRanges is owner and copied. 2025-06-11 15:51:56 +02:00
ocornut da51485e17 Fonts: Obsolete GetGlyphRangesXXX() functions. Update font documentation. 2025-06-11 15:51:56 +02:00
ocornut 93410c47e1 Fonts: Fixed various small warnings / build issues. 2025-06-11 15:51:56 +02:00
ocornut dec8d3863a Fonts: Added a ImFontFlags_NoLoadError flag to let user code try file paths. (3611) 2025-06-11 15:51:56 +02:00
ocornut 131f5c57ab Textures: Detect when using a texture that's about to be destroyed. 2025-06-11 15:51:56 +02:00
ocornut 0b71339122 Demo: Add a "Fonts" section for visibility. 2025-06-11 15:51:33 +02:00
ocornut 161e222322 Fonts: GetFontBaked() default to searching for closest size font. 2025-06-11 15:51:30 +02:00
ocornut ef6beaeff6 Fonts: removed LockSingleSrcConfigIdx which isn't needed anymore since we don't load glyphs in ImFontAtlasBuildAddFont(). 2025-06-11 15:47:49 +02:00
ocornut d8a612f73b Fonts: Fallback glyph is now lazily loaded on demand (yay!). Moving ImFontBaked:: functions outside of class. 2025-06-11 15:47:49 +02:00
ocornut 78a17038c2 imgui_freetype: no need to store metrics locally. 2025-06-11 15:47:49 +02:00
ocornut 18c8a93cca Fonts: Rework ImFontLoader signatures.
InitBaked may return false to signify this size is not supported.
2025-06-11 15:47:49 +02:00
ocornut c06a7585a3 Fonts: A font source can specify its own loader/backend. 2025-06-11 15:47:41 +02:00
ocornut 1cfc0de31d Fonts: Core allocates per-baked-per-src backend buffers, to allow having custom backend per font source. Backend BakedInit/Destroy/AddGlyph process a single source. 2025-06-11 15:47:41 +02:00
ocornut d59f10d7f5 Fonts: reinstated ImFontAtlasBuildSetupFontCreateEllipsisFromDot() compatible with baked system, lazily baked. 2025-06-11 15:47:41 +02:00
ocornut 76b252f80a Fonts: Added ImFontAtlasBakedSetFontGlyphBitmap(). 2025-06-11 15:47:41 +02:00
ocornut 92993e68c8 Fonts: Baked system, fix subsequent sources overriding shared font metrics. 2025-06-11 15:47:41 +02:00
ocornut dc1320df64 Fonts: ImFontFlags: ImFontFlags_NoLoadGlyphs + add ImFontFlags_LockBakedSizes 2025-06-11 15:47:41 +02:00
ocornut 8a8d8a7b38 Fonts: Exposed CompactCache(). Hide ClearCache(). 2025-06-11 15:47:35 +02:00
ocornut eb79e3ab3d Fonts: Restore a functional AddCustomRectFontGlyph(). 2025-06-11 15:47:35 +02:00
ocornut 815553c4b4 Fonts: ImFontConfig: added GlyphExcludeRanges[]. 2025-06-11 15:47:35 +02:00
ocornut 96786a183b Fonts: Create a fallback glyph if none is available (fix crash on fonts with no fallback) 2025-06-11 15:47:34 +02:00