Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Dpi scaling #770

elpapimango started this conversation in General
Nov 13, 2025 · 2 comments · 1 reply
Discussion options

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
}
You must be logged in to vote

Replies: 2 comments 1 reply

Comment options

i do not have/use 2 monitors, but i have questions:

  • do you know why AppliedDPI is in HKCU\Control Panel\Desktop\WindowMetrics for 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
You must be logged in to vote
1 reply
Comment options

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 🤔

Comment options

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

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet

AltStyle によって変換されたページ (->オリジナル) /