Skip to content

Request for feedback: dynamic fonts & texture updates (v1.92) #8465

Open

Description

@ocornut

2025/06/25: RELEASED 1.92.0. PLEASE STOP POSTING HERE. OPEN A NEW ISSUE INSTEAD!

See docs/BACKENDS.md for instruction to add support for ImGuiBackendFlags_RendererHasTextures in your custom backend.

2025/06/11: merged to master, branch now deleted.
2025/06/06: pushed enough changes that I am hopeful this could be merged this month. Feedback welcome.
2025/03/19: pushed a "big" change reverting the renaming ImTextureID to ImTextureUserID from the March 5 version. This is simpler for end-user, both in terms of breaking changes and in term of understanding the design. The structure previously called ImTextureID in the March 5 version is now called ImTextureRef.
2025/03/05: Pushed an experimental features/dynamic_fonts branch.


I am looking for feedback / early adopters to try this as we will inevitably find bugs or use cases that are not well supported.
The API are not 100% stabilized but it is expected they stay relatively close.

As of today, I only recommend experienced users to try this. Things should be simplified and clarified over the upcoming month.

WHEN YOU SUBMIT FEEDBACK PLEASE TRY TO INCLUDE RELEVANT CONTEXT. Things may look simple in the surface but there are lots of parameters under the hood.

Warning: Your first impression may be very dry: the examples application are using the default bitmap fonts and are still not DPI aware. (but it is now trivial to scale the font dynamically).
You may tinker with changing FontSize or FontScale in Style Editor. It's going to make more sense in an established application. If you are using multiple fonts, large fonts, icon fonts, non-English languages, this will likely make things easier.

TL;DR; Add a font once, use it as any size.

2025-01-27.font.resize.mp4

If you want to help testing this:

  • Read this :)
  • Branch your project and update to this features/dynamic_fonts branch of imgui.
  • Make changes (in required/desirable) in your branch.
  • If you find any issue you can report/discuss and return to your main branch. Your feedback will help improve the code but also comments/docs/examples.
  • If you start using this, please try to update and feedback regularly as we work on finalizing this.

I am interested in different situations:

  • Updating to latest code and using an old standard backend. Do you see any issue/breakage?
  • Updating to latest code and using the latest standard backend.
  • Updating to latest code and using a custom backend. Do you see any issue/breakage? How's your experience figuring out how to update to support ImGuiBackendFlags_RendererHasTextures ?
  • Users for AddCustomRectRegular() / AddCustomRectFontGlyph() api: I am creating a dedicated topic Request for feedback: custom rect / custom glyphs / custom loaders with dynamic_fonts branch. #8466 for feedback on those.

The API we are replacing to interface with renderer backends has been here since January 2015 (!), so is more 10 years old. I want to ensure that the new API will also last long.

THE PLAN

My hope is that I can finish and merge this to master in 1~2 months but it will depends on amount of feedback/bugs, and the remaining work on more "General Scaling".

  1. I am pushing a public branch today. It is temporarily based over docking. If you need to maintain changes on your side (custom engine etc.) you can use #ifdef IMGUI_HAS_TEXTURES.
  2. Now gathering a first wave of feedback and issues from early enthusiasts.
    I am creating two topics:
  3. The commit history will be reworked/sculpted, rebased and force-pushed for a little while, as I am treating this as short-term feature branch. So you will likely need to checkout when you update (regular merging will be harder). At some point when I am convinced enough that the commits are a good, I will stop sculpting history and start only adding to it.
  4. When this is deemed mature enough, it will be rebased on master and pushed as 1.92. We will open new topics if the current topics have had too many posts and many already solved issues.
  5. My expectation is that before 1.92 I will have also finished and added more features related to "general scaling" (current code only has "font scaling").

USEFUL REFERENCES COMMITS/DIFF

Public API

  • Browse for main changes inside imgui.h in the diff between before and after
  • Added about ~300 lines added to imgui.h, including comments and obsolete stuff.

Backends:
(line count including comments)

Third Party Extensions

Activity

  1. ocornut commented on Mar 5, 2025

    @ocornut
    OwnerAuthor

    GENERAL OVERVIEW OF THE CHANGES

    As outlined in the '10 years of Dear ImGui' article there are many changes coming related to the font system and text shaping.

    For the font system, I have decided to split the work in 2 distinct steps:

    • Step 1: dynamic font atlas & backend support for texture updates.
      • Fonts may be used at any size.
      • Backends can create, update, destroy textures.
      • Getting the low-level support working. As little user facing change as possible.
    • Step 2: rework and cleanup all high-level fonts api and general scaling system.
      • General scaling system (e.g. scaling style sizes).
      • Maybe revamp font loading API. Surface more features.

    The code I am publishing today is mostly step 1.

    What is part of what I am publishing (step 1)

    • Generally reworked the low-level font atlas system toward being more dynamic. Provided the backend support ImGuiBackendFlags_RendererHasTextures:
      • Fonts may be added and removed at any time.
      • One font may be used at any size.
      • Glyphs are added, and rasterized and packed on demand.
      • Atlas may be repacked, compacted etc.
      • A bunch of under the hood machinery ensure this is mostly transparent and efficient. Great care has been put at reducing the cost on lower-level text functions, but a general overall 1-2% slowdown may be expected.
    • Intentionally trying to keep user-facing changes to a strict minimum!
      • As such, many features are not exposed or surfaced in high-level API yet. (e.g. while it is now easy to use a font at any size, we don't yet provide a standard mechanism for general scaling of everything.) e.g. I very shyly added a minimum set of ImFontFlags values required for feature we need know, but it is intentionally buried in ImFontConfig struct until font loading API are redesigned better.
    • Added API for backends to support arbitrary texture creation and destruction and partial texture updates.
      • The backend API for this has not changed since v1.30 (February 2015!). We are changing it for the first time in ten years!
      • Hopefully the new API should last for a long time!
      • The old system required the Renderer Backend to build and upload texture during the backend NewFrame() call. The atlas texture identifier was locked past this point and used in draw commands.
      • The new system provides a list of textures for the backend to process at the end of the frame when it does its rendering. Low-level texture identifiers are not generally known until end of the the frame.
      • Textures blocks that have never been used may be written with new texels. Textures blocks that have been used will never be rewritten, which simplify needs for synchronization in rendering backends.
      • When the texture is out of capacity, a new texture is created. Previous glyphs are packed into it. Size variations that are not being used may be garbage collected. The texture may be larger or the same size, depending on which font size may be unused and were evicted. The previous texture may be freed by the backend after in-flight renderings are done.
      • During a frame where a new texture is created, some UI elements will use the old texture and some will use the new texture. This should be completely transparent to the user.
      • If you need fixed/known memory usage, you may decide to setup atlas texture to a fixed size by writing equal values to the atlas->TexMinWidth/TexMaxWidth, TexMinHeight/TexMaxHeight.
    • Internals have been rewritten, making it easier to later experiment with font backends others than stb_truetype or Freetype, and different ways to render fonts. Custom font loaders may be used.
    • Effective benefits, today:
      • Users of icons, Asian and non-English languages do not need to pre-build all glyphs ahead of time. Saving on loading time, memory, and also reducing issues with missing glyphs.
      • Specifying glyph ranges is not needed anymore.
      • **PushFontSize() may be used anytime. Adding/removing fonts is easier (but will be more easier later). **
      • It is easier to dynamically adjust variety font setting and change the font rendering backend at runtime while seeing result immediately.(Hard to see now as I didn't push many tools yet)
      • Packing custom rectangles is more convenient as pixels may be written to immediately.
      • Any update to fonts previously required backend specific calls to re-upload the texture, and said calls were not portable across backend. It is now possible to scale fonts etc. in a way that doesn't require you to make backend specific calls.
      • It is possible to plug a custom loader/backend to any font source.
      • General refactor should facilitate further experiments and improvements.

    What is not part of this update yet (step 2, will come next)

    Your first impression may be very dry: The examples are using the default bitmap fonts and are still not DPI aware.

    • Adding a more general scaling system that apply to e.g. style sizes.
    • Refactoring high-level fonts API: loading api, loading flags, sharing font sources and data between fonts, fonts fallbacks etc.
    • Reevaluating many other fonts features.
    • This is one of the backbone for better DPI and multi-DPI support, but still need to make all examples DPI aware.
    • Examples are still using the default pixelated font, "ProggyClean", also informally referred to as the Marmite/Vegemite of UI fonts: much loved and much hated.
    • Font sizes and many other aspects of layout are still pixel aligned. (Incorrect widget layout rounding #1858, Fractional font width cannot be aligned with itself #791) This might become optional, primarily to allow smoother zooming. Without the rounding it's possible to get incredibly smooth zooming. Note that Freetype's great Font Hinting feature by nature does align character widths to pixel, but we are aiming to design a system when animated/slow zooming could temporarily disable hinting.
    • CustomRects are already better as you can write your pixels immediately after registering a rectangle. But the whole system is still in flux as better multi-dpi support will likely need us to further redesign those API. Custom font glyphs are better handled by registering a custom ImFontLoader.
    • When the system is widely adopted, this should enable imgui code to easily bake custom symbols, shapes, icons and many other things on the fly. Because I am eager to be able to take advantage of this fully, my expectation is that we will accelerate phasing out support for old backends (normally we phase things out in 2 years, I may make this shorter).

    Generally speaking, the design puzzle here has been to push toward improvements while providing a reasonable path for old code to function without major issues. I have iterated on this for countless hours to find what I hope is the best solution, but it's expected that people will run into issues.

  2. ocornut commented on Mar 5, 2025

    @ocornut
    OwnerAuthor

    KNOWN ISSUES

    • General Scaling system is not yet solved/pushed. This only provides FONT SCALING. I am working on this, and the final solution may alter some details about font scaling.
    • I haven't yet exposed many fonts features in examples and demo.
      • I have NOT YET exposed the general satisfying "scale all the UI" widget in public code, because I want this to be tied to general scaling rather than font scaling.
      • But if you are curious you may toy with style.FontSize from inside Style Editor. Or bind io.FontGlobalScale to an interactive item and immediately see this in action: ImGui::DragFloat("io.FontGlobalScale", &ImGui::GetIO().FontGlobalScale, 0.05f, 0.5f, 5.0f);
    • Examples are still not technically DPI aware yet (but it's much easier now). As I am still working on providing a transparent solution for general scaling, how much responsibility may be left to user is this undecided and being explored.
    • Using style.ScaleAllSizes() now applies to font to.
    • Important: use of legacy io.FontGlobalScale, ImGuiConfigFlags_DpiEnableScaleFonts and SetWindowFontScale() should now all appear to work nicely. But be warned they can lead to confusion and feedback loop when using e.g. GetFontSize() as a base to request another size. This will be clarified and improved as I finish work on general scaling.
    • Using multiple atlas simultaneously in the same context has not been tested yet.
    • Sharing a same atlas between two contexts is possible, with the following constraints:
      • Contexts sharing a same atlas must not be doing work in parallel.
      • Contexts sharing a same atlas must be using the same rendering backend.
    • No attempt to merge UpdateRects[] provided to backends yet. Should be easy.
    • ImFont::AddRemapChar() doesn't work and may be obsoleted as I'm not sure anyone is using this.
    • Binding generators for C and other languages (dear_bindings, cimgui) may need to come up with a way to automatically turn ImTextureUserID into ImTextureID.
    • Backends (HELP WANTED)
      • Backends: WGPU: Missing support (PR welcome!)
      • Backends: DX12, Vulkan: due to some legacy constructs, we are currently needlessly requiring for texture uploads to complete during rendering, which is not optimal. It may be hard to notice as texture uploads are rare. However, we can and should improve the backends to remove those blocking waits.
      • Backends: SDLGPU: seems to glitch on OSX (bad sync?)
  3. ocornut commented on Mar 5, 2025

    @ocornut
    OwnerAuthor

    Q: ImTextureID vs ImTextureRef ?

    // ImTextureID = backend specific, low-level identifier for a texture uploaded in GPU/graphics system.
    // [Compile-time configurable type]
    // Overview:
    // - When a Rendered Backend creates a texture, it store its native identifier into a ImTextureID value.
    //   (e.g. Used by DX11 backend to a `ID3D11ShaderResourceView*`; Used by OpenGL backends to store `GLuint';
    //         Used by SDLGPU backend to store a `SDL_GPUTextureSamplerBinding*`, etc.).
    // - User may submit their own textures to e.g. ImGui::Image() function by passing the same type.
    // - During the rendering loop, the Renderer Backend retrieve the ImTextureID, which stored inside
    //   ImTextureRef, which is stored inside ImDrawCmd.
    // Configuring the type:
    // - To use something other than a 64-bit value: add '#define ImTextureID MyTextureType*' in your imconfig.h file.
    // - This can be whatever to you want it to be! read the FAQ entry about textures for details.
    // - You may decide to store a higher-level structure containing texture, sampler, shader etc. with various
    //   constructors if you like. You will need to implement ==/!= operators.
    // History:
    // - In v1.91.4 (2024/10/08): the default type for ImTextureID was changed from 'void*' to 'ImU64'. This allowed backends requirig 64-bit worth of data to build on 32-bit architectures. Use intermediary intptr_t cast and read FAQ if you have casting warnings.
    // - In v1.92.0 (2025/XX/XX): added ImTextureRef which carry either a ImTextureID either a pointer to internal texture atlas. All user facing functions taking ImTextureID changed to ImTextureRef
    #ifndef ImTextureID
    typedef ImU64 ImTextureID;      // Default: store up to 64-bits (any pointer or integer). A majority of backends are ok with that.
    #endif
    
    // Define this if you need 0 to be a valid ImTextureID for your backend.
    #ifndef ImTextureID_Invalid
    #define ImTextureID_Invalid     ((ImTextureID)0)
    #endif
    
    // ImTextureRef = higher-level identifier for a texture.
    // The identifier is valid even before the texture has been uploaded to the GPU/graphics system.
    // This is what gets passed to functions such as ImGui::Image(), ImDrawList::AddImage().
    // This is what gets stored in draw commands (ImDrawCmd) to identify a texture during rendering.
    // - When a texture is created by user code (e.g. custom images), we directly stores the low-level ImTextureID.
    // - When a texture is created by the backend, we stores a ImTextureData* which becomes an indirection
    //   to extract the ImTextureID value during rendering, after texture upload has happened.
    // - There is no constructor to create a ImTextureID from a ImTextureData* as we don't expect this
    //   to be useful to the end-user, and it would be erroneously called by many legacy code.
    // - If you want to bind the current atlas when using custom rectangle, you can use io.Fonts->TexRef.
    // - Binding generators for languages such as C (which don't have constructors), should provide a helper:
    //      inline ImTextureRef ImTextureRefFromID(ImTextureID tex_id) { ImTextureRef tex_ref = { ._TexData = NULL, .TexID = tex_id }; return tex_ref; }
    // In 1.92 we changed most drawing functions using ImTextureID to use ImTextureRef.
    // We intentionally do not provide an implicit ImTextureRef -> ImTextureID cast operator because it is technically lossy to convert ImTextureRef to ImTextureID before rendering.
    struct ImTextureRef
    {
        ImTextureRef()                          { _TexData = NULL; _TexID = ImTextureID_Invalid; }
        ImTextureRef(ImTextureID tex_id)        { _TexData = NULL; _TexID = tex_id; }
    
        inline ImTextureID  GetTexID() const;   // == (_TexData ? _TexData->TexID : _TexID) // Implemented below in the file.
    
        // Members (either are set, never both!)
        ImTextureData*      _TexData;           //      A texture, generally owned by a ImFontAtlas. Will convert to ImTextureID during render loop, after texture has been uploaded.
        ImTextureID         _TexID;             // _OR_ Low-level backend texture identifier, if already uploaded or created by user/app. Generally provided to e.g. ImGui::Image() calls.
    };

    CHANGELOG

    Moved to https://github.com/ocornut/imgui/releases/tag/v1.92.0

  4. GamingMinds-DanielC commented on Mar 5, 2025

    @GamingMinds-DanielC
    Contributor

    Sounds great so far, but this one point worries me a little bit:

    When the texture is out of capacity, a new texture is created and all previous glyphs packed into here. The texture may be larger or the same size, depending on which font size may be unused. The previous texture may be freed by the backend after in-flight renderings are done.

    This sounds like glyphs (with "glyph" being glyph X of font Y at size Z) are always carried over, never discarded if unused. With zooming there will quickly be many different size variations, combined with scrolling through large texts (especially with Kanji since there are tons of them) this can spiral out of control fast and exceed maximum texture sizes.

    I think it is necessary that glyphs that have not been submitted to any text function for at least N frames will be skipped when packing the new texture. But I'm pretty sure it is just the way you worded it and your actual implementation already takes care of this.

  5. ocornut commented on Mar 5, 2025

    @ocornut
    OwnerAuthor

    It is the way I have worded it indeed, I will amend the description paragraph.
    When there is no room anymore, size variations that are not used may be evicted during repacking.

  6. ocornut commented on Mar 6, 2025

    @ocornut
    OwnerAuthor

    As well as various small fixes/addition, I have temporarily added a scale widget + direction in the demo to make experimenting less dry.
    Image

  7. bratpilz commented on Mar 7, 2025

    @bratpilz

    This is really great! It lets me delete a lot of the code I had written to deal with creating and using fonts of different sizes, and it's much faster and more flexible on top of that.

    So far I've noticed only two issues (for which I can also create separate GitHub issues if you prefer):

    1. I create normal/bold/italic/bold+italic versions of all the fonts I use. This makes it so that I can quickly do e.g. PushFont(active_fonts.bold); [...] PopFont(); to have a heading text be bold. Right now this resets the font size back to what I initially specified when creating the font though.
    PushFont(active_fonts.regular, 16.0f);
    [...] // Later, in a nested function call:
    PushFont(active_fonts.bold);
    Text("This text gets shown with size 14.0f, which I created the font with originally.");
    PopFont();
    [...]
    PopFont();
    

    I saw that this is because of a temporary backwards compatibility measure in PushFont:
    font_size = font->Sources[0].SizePixels; // g.FontSize;
    If I change this line to font_size = g.FontSize;, the bold text is also shown at the new size (i.e. 16.0f in the example above).

    1. I have multiple OS windows, each with its own ImGuiContext, and I'm sharing the font atlas between all of these contexts. When I close one of the windows, I destroy its context and also call ImGui_ImplOpenGL3_Shutdown. This then deletes all the textures that are still in use in the other OS windows' contexts, which leads to the following assertion:
    ImTextureUserID ImDrawCmd::GetTexUserID() const: Assertion `tex_id != ((ImTextureUserID)0) && "ImDrawCmd is referring to ImTextureData that wasn't uploaded to graphics system. Backend must call ImTextureData::SetTexUserID()!"' failed.
    

    with the following stack:

    [...]
    #5  0x0000000001854a00 in ImDrawCmd::GetTexUserID (this=0x784a810) at imgui.h:3829
    #6  0x00000000018fb67e in ImGui_ImplOpenGL3_RenderDrawData (draw_data=0x7b56bd0) at imgui_impl_opengl3.cpp:656
    [...]
    

    If I comment out the call to ImGui_ImplOpenGL3_Shutdown, the problem disappears, but then I'm leaking resources on the GPU.

  8. ocornut commented on Mar 7, 2025

    @ocornut
    OwnerAuthor

    Thank you @bratpilz for your feedback.

    (1) I haven't figured out the right design for this yet. To be forward-facing, it seems evident that PushFont(xxx) by default should preserve current font size, but this creates a problem with legacy code which defacto often used this to change font for the purpose of changing size.
    We can distinguish font_size ==0 from font_size < 0 to allow for two different behavior, but again the tricky part is to decide on the default one. I'll work on this.

    (2) I think we could solve this by adding a reference count inside ImFontAtlas and having backend check this. I'll work on this too.

  9. ocornut commented on Mar 7, 2025

    @ocornut
    OwnerAuthor

    I have pushed 3eefa4e which should solve the problem with sharing an atlas between context. For simplicity I had to take a shortcut of assuming that when multiple contexts are created, they all have their backend initialized/bound to the context.

  10. pinned this issue on Mar 7, 2025
  11. changed the title [-]Request for feedback: dynamic fonts & texture update protocol.[/-] [+]Request for feedback: dynamic fonts & texture updates (v1.92)[/+] on Mar 7, 2025
  12. ZingBallyhoo commented on Mar 7, 2025

    @ZingBallyhoo

    Question r.e supporting in custom backends, would it be possible for the pixel data to be kept alive until the backend agrees the texture is destroyed? Currently the data is freed as soon as the texture enters the ImTextureStatus_WantDestroy state, but its possible that the data could still be in use asynchronously (obviously relies on the whole "Textures blocks that have been used will never be rewritten" guarantee). Also fine if not! Just requires buffering

  13. 98 remaining items

  14. inflex commented on Jun 13, 2025

    @inflex

    With the new dynamic font system, is it more efficient to still maintain a limited set of font sizes in use ( ie, 10, 14, 20, 32, 45... ) or will it be no different to infinitely variable sizes?

    ie, I draw part names to fit the width of parts on my boards, previously I used fixed sizes selected using a quantizing algorithm, but now I can just do ImGui::PushFontSize(part_width *constant_scaler); however I do wonder if it's most definitely going to be detrimental to performance compared to a fixed set?

    Image

  15. rodrigorc commented on Jun 13, 2025

    @rodrigorc
    Contributor

    however I do wonder if it's most definitely going to be detrimental to performance compared to a fixed set?

    It looks like this is a use case for ImFontFlags_LockBakedSizes?

  16. inflex commented on Jun 13, 2025

    @inflex

    It looks like this is a use case for ImFontFlags_LockBakedSizes?

    I'll look in to that; for now I've started quantizing though I do wonder if I'm actually going to end up now with consuming more VRAM than the old prebaked situation ( 4~5 fixed font sizes ). Guess that's for me to experiment with and set size bracketing up too.

    Next thing I'll be on the look out for is rotated text.

  17. rodrigorc commented on Jun 13, 2025

    @rodrigorc
    Contributor

    Next thing I'll be on the look out for is rotated text.

    What I do for a somewhat similar situation is to render the text myself, by accessing the atlas texture and adding the glyphs as quads to the WindowDrawList. That is why I asked above for the GetFontBaked(density). Then you can do the scale and rotation at will.

  18. ocornut commented on Jun 13, 2025

    @ocornut
    OwnerAuthor

    The error happens in ImGui::TextLink() when it reads g.FontBaked, that happens to be NULL.

    Should be fixed now, thanks!

    With the new dynamic font system, is it more efficient to still maintain a limited set of font sizes in use ( ie, 10, 14, 20, 32, 45... ) or will it be no different to infinitely variable sizes?
    ie, I draw part names to fit the width of parts on my boards, previously I used fixed sizes selected using a quantizing algorithm, but now I can just do ImGui::PushFontSize(part_width *constant_scaler); however I do wonder if it's most definitely going to be detrimental to performance compared to a fixed set?

    This is worth opening a new topic for, but.

    • (1) performance will be stable when your view is stable either way.
    • (2) using infinite variable sizes is definitively going to be more costly, but how much does it matter considering (1).
    • (3) we don't have good policy/heuristic in place for growing the font atlas. if you keep requesting new size, there is a chance that you stay with a small-ish atlas where same sizes gets ditched and redrawn again often. which is not ideal, but again, might not matter too much depending on the frequency of your scale. I believe improving that heuristic to know when to grow the texture may be the a key improvement to make, I'm open to any suggestions. This is likely going to be an heuristic that's also based on user directives.
    • (4) if you have smooth animated zooming but fixed steps when zooming stops, hypothetically it would be good if you have a system to provide a hint about how likely that size is for reuse. And then intermediate steps could be evicted from cache earlier than fixed steps. Technically if you call GetFontBaked(font, 24.0f) every frame it'll prevent that size from being evicted, so you could already use that if you find it beneficial.
  19. ocornut commented on Jun 25, 2025

    @ocornut
    OwnerAuthor

    I have fixed a bug and pushed some of the last breaking changes before tagging this as a release.

    (1) obsoleted single parameter PushFont(ImFont*) in favor of explicit PushFont(ImFont*, font_size_base_unscaled) (ca72eb0)

    Recap:

    • PushFont(font, 0.0f) // Change font and keep current size
    • PushFont(NULL, 20.0f) // Keep font and change current size
    • PushFont(font, 20.0f) // Change font and set size to 20.0f
    • PushFont(font, style.FontSizeBase * 2.0f) // Change font and set size to be twice bigger than current size.
    • PushFont(font, font->LegacySize) // Change font and set size to size passed to AddFontXXX() function. Same as pre-1.92 behavior, for fixed size fonts.

    Kept inline redirection function that does PushFont(font, font->LegacySize).
    IF YOU USED THIS BRANCH OR NEW FEATURES IN THE PAST FEW WEEKS, THE DIFFERENCE IS: If you call single the obsolete parameter version it now does PushFont(font, font->LegacySize) instead of PushFont(font, 0.0f).
    Interestingly since size is now optional in the AddFontXXX calls, if you specify a size of 0.0f, font->LegacySize will be 0.0f.

    (2) removed PushFontSize(), PopFontSize() (97e0d59)
    You can use PushFont(NULL, new_size) instead.

    The reasoning behind this is that due to external scaling factor we need to distinguish base/unscaled sizes from scaled sizes (after global factors style.FontScaleMain style.FontScaleDpi are applied).
    The size parameter passed to PushFont() ends up in style.FontSizeBase. Therefore in theory PushFontSize() should be called PushFontSizeBase() or PushFontBaseSize() or PushFontSizeUnscaled() (TDB).

    (3) removed ImFontFlags_DefaultToLegacySize (89b5a2c)
    It is not necessary. Better design to enforce two parameter version of PushFont() and legacy call to use font->LegacySize.

  20. Repository owner locked and limited conversation to collaborators on Jun 25, 2025
  21. ocornut commented on Jun 25, 2025

    @ocornut
    OwnerAuthor

    Locking this topic as 1.92 is being released.

    IN ORDER TO HELP US IMPROVE THE TRANSITION PROCESS, INCL. DOCUMENTATION AND COMMENTS, PLEASE REPORT ANY DOUBT, CONFUSION, QUESTIONS BY OPENING A NEW ISSUE.

  22. ocornut commented on Jun 27, 2025

    @ocornut
    OwnerAuthor

    See docs/BACKENDS.md for instructions to add support for ImGuiBackendFlags_RendererHasTextures in your custom backend.

  23. unpinned this issue on Aug 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      ⌂ 换网址