DrawList: added ImDrawListFlags_NoTextPixelSnap to disable snapping of AddText() coordinates for a given scope. (#3437, #9417, #2291)

This may evolve into a per-call ImDrawFlags option as well.
+ clip_rect.Max.y early out may be applied before truncation.
diff --git a/docs/CHANGELOG.txt b/docs/CHANGELOG.txt
index 1c55358..932ebe1 100644
--- a/docs/CHANGELOG.txt
+++ b/docs/CHANGELOG.txt
@@ -50,15 +50,17 @@
   - Clicking on a window's empty-space to move/focus a window checks
     for lack of queued focus request. (#9382)
 - InputText:
-  - Added style.InputTextCursorSize to configure cursor/caret thickness. (#7031, #9409)
-    This is automatically scaled by style.ScaleAllSizes().
+  - Added `style.InputTextCursorSize` to configure cursor/caret thickness. (#7031, #9409)
+    This is automatically scaled by `style.ScaleAllSizes()`.
 - Fonts:
   - Added `IMGUI_DISABLE_DEFAULT_FONT_BITMAP`/`IMGUI_DISABLE_DEFAULT_FONT_VECTOR` to
     disable embedding either fonts separately. (#9407)
-  - Tweak CalcTextSize() awkward width rounding/ceiling code to reduce floating-point
+  - Tweak `CalcTextSize()` awkward width rounding/ceiling code to reduce floating-point
     imprecisions altering the result by 1 even at relatively small width. (#791)
 - DrawList:
-  - Minor optimization to AddLine(), AddLineH(), AddLineV() functions. (#4091)
+  - Minor optimization to `AddLine()`, `AddLineH()`, `AddLineV()` functions. (#4091)
+  - Added `ImDrawListFlags_NoTextPixelSnap` to disable snapping of AddText()
+    coordinates for a given scope. (#3437, #9417, #2291)
 - Demo:
   - Extract 'Widgets->Tree Nodes->Selectable Nodes' out of the 'Advanced'
     demo for clarity (manual reimplementation of basic selection).
diff --git a/imgui.h b/imgui.h
index 2aa8cb0..0502370 100644
--- a/imgui.h
+++ b/imgui.h
@@ -3279,6 +3279,7 @@
     ImDrawListFlags_AntiAliasedLinesUseTex  = 1 << 1,  // Enable anti-aliased lines/borders using textures when possible. Require backend to render with bilinear filtering (NOT point/nearest filtering).
     ImDrawListFlags_AntiAliasedFill         = 1 << 2,  // Enable anti-aliased edge around filled shapes (rounded rectangles, circles).
     ImDrawListFlags_AllowVtxOffset          = 1 << 3,  // Can emit 'VtxOffset > 0' to allow large meshes. Set when 'ImGuiBackendFlags_RendererHasVtxOffset' is enabled.
+    ImDrawListFlags_NoTextPixelSnap         = 1 << 4,  // [Internal] Disable automatically snapping AddText() calls to pixel boundaries.
 };
 
 // Draw command list
diff --git a/imgui_draw.cpp b/imgui_draw.cpp
index b112f47..a78a35a 100644
--- a/imgui_draw.cpp
+++ b/imgui_draw.cpp
@@ -5764,8 +5764,13 @@
     if (glyph->Colored)
         col |= ~IM_COL32_A_MASK;
     float scale = (size >= 0.0f) ? (size / baked->Size) : 1.0f;
-    float x = IM_TRUNC(pos.x);
-    float y = IM_TRUNC(pos.y);
+    float x = pos.x;
+    float y = pos.y;
+    if ((draw_list->Flags & ImDrawListFlags_NoTextPixelSnap) == 0)
+    {
+        x = IM_TRUNC(x);
+        y = IM_TRUNC(y);
+    }
 
     float x1 = x + glyph->X0 * scale;
     float x2 = x + glyph->X1 * scale;
@@ -5797,12 +5802,17 @@
 // DO NOT CALL DIRECTLY THIS WILL CHANGE WILDLY IN 2026. Use ImDrawList::AddText().
 void ImFont::RenderText(ImDrawList* draw_list, float size, const ImVec2& pos, ImU32 col, const ImVec4& clip_rect, const char* text_begin, const char* text_end, float wrap_width, ImDrawTextFlags flags)
 {
-    // Align to be pixel perfect
 begin:
-    float x = IM_TRUNC(pos.x);
-    float y = IM_TRUNC(pos.y);
+    // Align to be pixel perfect
+    float x = pos.x;
+    float y = pos.y;
     if (y > clip_rect.w)
         return;
+    if ((draw_list->Flags & ImDrawListFlags_NoTextPixelSnap) == 0)
+    {
+        x = IM_TRUNC(x);
+        y = IM_TRUNC(y);
+    }
 
     if (!text_end)
         text_end = text_begin + ImStrlen(text_begin); // ImGui:: functions generally already provides a valid text_end, so this is merely to handle direct calls.