Comments (4)
@mindv0rtex , DPI scaling is a WIP and currently has no effect. The whole thing was pushed prematurely, regretfully. I was using Syntacts and the example mahi-gui app as testing grounds while working on it.
In its present form, mahi-gui should do no DPI scaling yet (despite the option existing). I thought I would have this worked out soon enough that no one would catch it, but life got in the way. I just added a warning comment to not use it yet (it's the best I can do for now).
Sorry for the mess. Hopefully this is something I can resolve sooner than later.
Regarding sharper fonts, the general idea is that you load the font at a large size (e.g. 12 pt * dpi_scale), and then apply a global font scaling (e.g. 1.0 / dpi_scale). I was trying to make this work in Application.cpp
, but did not get it finished.
DPI scaling ImGui in general is a bit confusing. There are two approaches: 1) manually scale all of ImGui's styling sizes and any hard coded window sizes, or 2) scale the framebuffer and continue to work under the assumption of 96 DPI. The latter is preferred, and what I hope to get working eventually.
from mahi-gui.
I am sorry I stumbled upon an unfinished feature I was not meant to find 😄
Regarding sharper fonts, the general idea is that you load the font at a large size (e.g. 12 pt * dpi_scale), and then apply a global font scaling (e.g. 1.0 / dpi_scale). I was trying to make this work in Application.cpp, but did not get it finished.
Is this something I can do now with mahi-gui or would I need to use vanilla Dear Imgui?
from mahi-gui.
@epezent, in case this could be helpful for you, I managed to make your code work for Retina scaling with very minor tweaks:
- Changed
enable_dpi_aware()
to return2.0f
. I realize this is a hard-coded value, I was just trying to see if I could get it to work... - Removed dpi scale multiplier in methods that set/get window sizes.
Font size scaling and the DPI scaling method 1 are left untouched. I get nice crisp looking fonts now.
from mahi-gui.
Looks like this param in GLFW is relevant:
GLFW_COCOA_RETINA_FRAMEBUFFER specifies whether to use full resolution framebuffers on Retina displays. Possible values are GLFW_TRUE and GLFW_FALSE. This is ignored on other platforms.
from mahi-gui.
Related Issues (19)
- plot with automatical data Y-range? HOT 1
- XBar plot disappears during mouse drag HOT 1
- Build broken on Linux (x86_64) HOT 16
- macOS build fails HOT 1
- Why is BUILD_SHARED_LIBS unsupported? HOT 3
- Small compilation problems in Mingw-w64
- Puzzometry example crashes on OSX HOT 2
- Build fails on Linux (Ubuntu 20.04) HOT 1
- wasm demo support
- Util is missing HOT 1
- Update Implot
- User guide for absolute beginners? HOT 2
- Compiliation issue on MacOS HOT 1
- Updating to ImGui 1.88
- does mahi-gui use the standard or the docking branch of imgui? HOT 7
- ClangFormat not used in some files HOT 1
- Too many vertices in ImDrawList using 16-bit indices HOT 12
- [Linux] [patch] Yet some little build issues HOT 2
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 mahi-gui.