1200 Commits

Author SHA1 Message Date
ocornut
613a6a964c Fonts: AddFontDefault() adds to GlyphOffset.y instead of overriding it. 2025-06-24 10:27:24 +02:00
ocornut
b580c11303 Merge branch 'master' into docking
# Conflicts:
#	backends/imgui_impl_dx12.cpp
#	backends/imgui_impl_glfw.cpp
#	backends/imgui_impl_sdl2.cpp
2025-06-20 15:19:36 +02:00
ocornut
2f9c518ca8 Textures: ImTextureData::GetPixels() returns void* for clarity. 2025-06-20 15:17:13 +02:00
ocornut
344d5ff4b7 Merge branch 'master' into docking 2025-06-17 20:15:12 +02:00
ocornut
fe048efeab DrawList, Fonts: fixed PushFont()/AddImage() not restoring correct atlas texture id when using multiple atlas (#8694)
This also needs 24f7328.
2025-06-17 12:06:14 +02:00
ocornut
24f7328e5f DrawList, Fonts: fixed ImFontAtlasTextureRepack() overwriting draw list shared data UV's etc. even when not bound. (#8694, #8465)
ImFontAtlasUpdateDrawListsSharedData() call from ImFontAtlasTextureRepack() would trigger this.
For simplicity we also track current atlas in ImDrawListSharedData, but we could probably use Font->ContainerAtlas.
2025-06-17 12:06:05 +02:00
ocornut
4cf85ee543 Merge branch 'master' into docking
# Conflicts:
#	backends/imgui_impl_osx.mm
#	backends/imgui_impl_wgpu.cpp
#	backends/imgui_impl_wgpu.h
2025-06-13 17:43:30 +02:00
ocornut
41f4acfb4f Fonts: add has_textures parameters to ImFontAtlasUpdateNewFrame(). 2025-06-12 11:44:11 +02:00
ocornut
7d70c0ff9f Merge branch 'master' into docking 2025-06-11 20:53:33 +02:00
ocornut
895bff6524 Removed unneeded check in RenderText() loop + disable static analyzer false-positive warnings. 2025-06-11 19:17:34 +02:00
ocornut
6af6cec23f Merge branch 'master_fonts' into docking
# Conflicts:
#	backends/imgui_impl_dx10.cpp
#	backends/imgui_impl_dx10.h
#	backends/imgui_impl_dx11.cpp
#	backends/imgui_impl_dx12.cpp
#	backends/imgui_impl_dx9.cpp
#	backends/imgui_impl_glfw.cpp
#	backends/imgui_impl_metal.h
#	backends/imgui_impl_metal.mm
#	backends/imgui_impl_opengl2.cpp
#	backends/imgui_impl_opengl2.h
#	backends/imgui_impl_opengl3.cpp
#	backends/imgui_impl_opengl3.h
#	backends/imgui_impl_sdl2.cpp
#	backends/imgui_impl_sdl3.cpp
#	backends/imgui_impl_sdlgpu3.cpp
#	backends/imgui_impl_sdlgpu3.h
#	backends/imgui_impl_vulkan.cpp
#	examples/example_glfw_opengl3/main.cpp
#	examples/example_sdl2_directx11/main.cpp
#	examples/example_sdl2_opengl2/main.cpp
#	examples/example_sdl2_opengl3/main.cpp
#	examples/example_sdl2_vulkan/main.cpp
#	examples/example_sdl3_opengl3/main.cpp
#	examples/example_sdl3_sdlgpu3/main.cpp
#	examples/example_sdl3_vulkan/main.cpp
#	examples/example_win32_directx10/main.cpp
#	examples/example_win32_directx11/main.cpp
#	examples/example_win32_directx12/main.cpp
#	examples/example_win32_directx9/main.cpp
#	imgui.cpp
#	imgui.h
#	imgui_demo.cpp
#	imgui_internal.h
2025-06-11 18:07:19 +02:00
ocornut
e1481a731d Fonts: fixed NewFrame() when atlas builder has been created but fonts not added. Fixed GetCustomRect() after atlas clear. 2025-06-11 16:25:18 +02:00
ocornut
2e67bd4de7 Fonts: rename to ImFontAtlasBuildLegacyPreloadAllGlyphRanges(). 2025-06-11 16:25:06 +02:00
ocornut
02f58b3207 Fonts: AddFont() functions now allow size_pixels==0.0f (only required when using certain functions)
Fonts: AddFont() funcitons allow size_pixels==0 for merged fonts.
2025-06-11 16:24:48 +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
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
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
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
fad5280d4c Fonts: fixed broken support for legacy backend due to a mismatch with initial pre-build baked id. 2025-06-11 15:57:44 +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
4dec946ae6 Fonts: don't pretend to half recover from OOM for now + debug log filename on load failure. 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
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
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