-
-
Notifications
You must be signed in to change notification settings - Fork 242
Dpi scaling #770
-
Was messing around and found this worked pretty well for me. I have 2 monitors. One with 100% scaling and one with 150%. Compared to standard popup menu, it looks like the font is pretty much the same size.
theme.nss
$scale = reg.get('HKCU\Control Panel\Desktop', "AppliedDPI")
$dpi = $scale / 96.0
theme
{
name="modern"
dark=true
view=view.auto
background
{
color=auto
opacity=auto
effect=3
}
font
{
size=(14 * dpi)
}
image.align=2
}
Beta Was this translation helpful? Give feedback.
All reactions
Replies: 2 comments 1 reply
-
i do not have/use 2 monitors, but i have questions:
- do you know why
AppliedDPIis inHKCU\Control Panel\Desktop\WindowMetricsfor me? - why do not use
LogPixels(HKCU\Control Panel\Desktop) instead? - why don't you add TextScaleFactor too (
HKCU\Software\Microsoft\Accessibility)
// Get display DPI scaling $dpi = reg.get('HKCU\Control Panel\Desktop', 'LogPixels') $displayScale = if(dpi==0, 96, dpi)/96 // do not know what happened if null or do not exist // Get accessibility text scaling $textScale = reg.get('HKCU\Software\Microsoft\Accessibility', 'TextScaleFactor') $textScaleFix = if(textScale==0, 100, textScale) // fix for % $textScaleFactor = $textScaleFix/100 // Final $finalScale = 14 * $displayScale * $textScaleFactor
Beta Was this translation helpful? Give feedback.
All reactions
-
I dont have LogPixels and my TextScaleFactor is always 100 even if my 4k is 150. I t5ried to see if there is per monitor setting, and i cant find this. There is "HKEY_CURRENT_USER\Control Panel\Desktop\PerMonitorSettings\XXXXXXXXXXXXXXX" but its 0 for both my screens.
do you know why AppliedDPI is in HKCU\Control Panel\Desktop\WindowMetrics for me?
Actually for me too now 🤔
Beta Was this translation helpful? Give feedback.
All reactions
-
DPI:
- Windows only stores one primary DPI value in this registry location, even if you have multiple monitors with different scaling settings.
- Windows doesn't expose per-monitor DPI information to the registry in a way that NS can access and use dynamically.
TextScaleFactor :
image
A year ago I had some ideas on the topic, but I gave up - the end result is not satisfactory. I saw the post and was curious
Beta Was this translation helpful? Give feedback.