Comments (4)
You are experiencing a known quirk with ImGui: see this extract from the ImGui FAQ:
The reason DPI is not auto-magically solved in stock examples is that we don't yet have a satisfying solution for the "multi-dpi" problem (using the docking branch: when multiple viewport windows are over multiple monitors using different DPI scales). The current way to handle this on the application side is:
Create and maintain one font atlas per active DPI scale (e.g. by iterating platform_io.Monitors[] before NewFrame()).
Hook platform_io.OnChangedViewport() to detect when a Begin() call makes a Dear ImGui window change monitor (and therefore DPI).
In the hook: swap atlas, swap style with correctly sized one, and remap the current font from one atlas to the other (you may need to maintain a remapping table of your fonts at varying DPI scales).
HelloImGui tries hard to add many additional steps to handle DPI correctly on different platforms.
However, this is a very difficult a time consuming task, since different platforms, or different app settings handle DPI differently.
Moving a window between monitors having different DPIs is not handled at the moment, since this would require 1/ changing the font atlas whenever the windows switches to a different monitor, and 2/ adapt the window size to account for the DPI change (on windows).
However, under macOS we might be lucky, since the window physical size (in millimeter) will likely not change when moving from one Retina screen to a non retina screen.
Last week, I was confronted to this issue, which lead me to introduce some settings:
See dpi_aware.h
If you create a hello_imgui.ini
file where you place
[DpiAwareParams]
dpiWindowSizeFactor=1
fontRenderingScale=0.5
(or if you set those values inside runnerParams.dpiAwareParams
), you will disconnect HelloImGui automatic DPI detection.
In this case, fonts will be loaded at twice the size and scaled by 0.5 upon rendering, which will likely improve the situation. The fonts will use more texture memory (but it will be the same as when running directly on the retina screen, since in that case HelloImGui will apply fontRenderingScale=0.5
automatically).
Please keep me informed of the result
from hello_imgui.
Thanks. I can confirm that setting those programmatically does indeed make the app use crisp fonts on the retina screen (though the fonts therefore look notably crunchy/jagged on the non-retina screen -- a compromise I'm willing to deal with for now).
from hello_imgui.
Thanks,
I took a few minutes to build and look at the imgui branch of your hdrview project, it looks extremely nice!
from hello_imgui.
Thanks!
from hello_imgui.
Related Issues (20)
- Custom patched ImGui version HOT 3
- Google Closure compiler support is almost perfect except for this one line. HOT 22
- Offline usage: avoid re-downloading glfw and freetype HOT 2
- Custom drawing behind GUI not possible due to Impl_Frame_3D_ClearColor() HOT 2
- macOS bundle support HOT 2
- Can I change a borderless window size? HOT 3
- Metal backend + emscripten favicon and shell template HOT 22
- Ability to put user menu items between the App Menu and the View Menu HOT 1
- Sdl Dpi awareness on Windows / multiple monitors HOT 1
- New back-end default HOT 3
- adding generated files to assets directory? HOT 8
- freetype dependency in Windows HOT 4
- how to add a toolbar (or other fixed windows) that limits the available main docking space? HOT 9
- Is there a way to make input_text to show only the last part of the text while deactivated HOT 2
- offline build HOT 13
- FontAwesome solid vs. regular HOT 4
- Problems with implot from vcpkg HOT 1
- RunnerParams backendType compatibility is broken HOT 1
- Improve HELLOIMGUI_WIN32_NO_CONSOLE implementation HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hello_imgui.