From c6c0c3be08007217a9dccc5e33aecc3cd9f4c042 Mon Sep 17 00:00:00 2001 From: ocornut Date: Sun, 27 Jul 2025 20:15:21 +0900 Subject: [PATCH] Docs: amend 1.92.0 logs on the fact that font->CalcTextSizeA() used to be thread-safe. --- docs/CHANGELOG.txt | 4 ++++ imgui.cpp | 2 ++ 2 files changed, 6 insertions(+) diff --git a/docs/CHANGELOG.txt b/docs/CHANGELOG.txt index 38d1dc985..8d4dc5cf7 100644 --- a/docs/CHANGELOG.txt +++ b/docs/CHANGELOG.txt @@ -190,6 +190,10 @@ Breaking changes: - You can use `Metrics/Debugger->Fonts->Font->Input Glyphs Overlap Detection Tool` to see list of glyphs available in multiple font sources. This can facilitate understanding which font input is providing which glyph. +- Fonts: **IMPORTANT** on Thread Safety: + - A few functions such as font->CalcTextSizeA() were by sheer luck (== accidentally) + thread-safe even thou we had never provided that guarantee before. They are + definitively not thread-safe anymore as new glyphs may be loaded. - Textures: - All API functions taking a 'ImTextureID' parameter are now taking a 'ImTextureRef': diff --git a/imgui.cpp b/imgui.cpp index 918105f26..87e6cbd79 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -432,6 +432,8 @@ IMPLEMENTING SUPPORT for ImGuiBackendFlags_RendererHasTextures: cfg2.MergeMode = true; io.Fonts->AddFontFromFileTTF("FontAwesome4.ttf", 0.0f, &cfg2); - You can use `Metrics/Debugger->Fonts->Font->Input Glyphs Overlap Detection Tool` to see list of glyphs available in multiple font sources. This can facilitate unde + - Fonts: **IMPORTANT** on Thread Safety: + - A few functions such as font->CalcTextSizeA() were, by sheer luck (== accidentally) thread-safe even thou we had never provided that guarantee. They are definitively not thread-safe anymore as new glyphs may be loaded. - Fonts: ImFont::FontSize was removed and does not make sense anymore. ImFont::LegacySize is the size passed to AddFont(). - Fonts: Removed support for PushFont(NULL) which was a shortcut for "default font". - Fonts: Renamed/moved 'io.FontGlobalScale' to 'style.FontScaleMain'.