UI and fonts are too big with right(native for display) DPI settings

The system:

Operating System: Manjaro Linux 
KDE Plasma Version: 5.27.8
KDE Frameworks Version: 5.110.0
Qt Version: 5.15.10
Kernel Version: 6.5.3-1-MANJARO (64-bit)
Graphics Platform: X11
Processors: 16 × AMD Ryzen 7 5800H with Radeon Graphics
Memory: 62.1 ГиБ of RAM
Graphics Processor: AMD Radeon Graphics
Manufacturer: HP
Product Name: Victus by HP Laptop 16-e0xxx

I have IPS display that have such characteristics:

Diagonal:   40.9cm (16.1")
Width:      35.6cm (14")
Height:     20cm (7.9")
Resolution: 2560x1440

This is from manufacturer documentation and also verified with ruler.

So it gives 182.278481DPI by width and 182.857143 DPI by height.
So I assume 182-183 will be good for it.

I use KDE, and in Display Settings configure scaling factor to 150%. It works well and sets automatically DPI in Font Configuration section to 144.

$ xrdb -query
Xcursor.size:   24
Xcursor.theme:  breeze_cursors
Xft.antialias:  1
Xft.dpi:        144
Xft.hinting:    1
Xft.hintstyle:  hintslight
Xft.rgba:       rgb
$ xdpyinfo | grep -B 2 resolution
screen #0:
  dimensions:    2560x1440 pixels (677x381 millimeters)
  resolution:    96x96 dots per inch

Now, I set scaling factor to 187.5%. This automatically sets DPI in font setting to 180(close enough).
This produces unusable interface. Everything is to big, not just the fonts, but spacing’s between elements. Sites in Firefox renders in horrible way. Applications both QT and GTK affected in similar way.
KDE application menu to big, spacing between elements to big.
Mostly its broken UI for everything (I tried to set smaller fonts, but this does not helps)
In this mode DPI detect site shows 192DPI.

$ xrdb -query
Xcursor.size:   24
Xcursor.theme:  breeze_cursors
Xft.antialias:  1
Xft.dpi:        180
Xft.hinting:    1
Xft.hintstyle:  hintslight
Xft.rgba:       rgb
$ xdpyinfo | grep -B 2 resolution
screen #0:
  dimensions:    2560x1440 pixels (677x381 millimeters)
  resolution:    96x96 dots per inch

Another approach, I add 50-display-size.conf file to /etc/X11/xorg.conf.d/ folder:

Section "Monitor"
    Identifier             "<default monitor>"
    DisplaySize             356 200 # 35.6cm x 20cm
EndSection

Set scaling factor in KDE settings to 100% and in Font Settings I set custom DPI to 183 (this is what Xorg calculates from my config).

$ xrdb -query
Xcursor.size:   24
Xcursor.theme:  breeze_cursors
Xft.antialias:  1
Xft.dpi:        183
Xft.hinting:    1
Xft.hintstyle:  hintslight
Xft.rgba:       rgb
$ xdpyinfo | grep -B 2 resolution
screen #0:
  dimensions:    2560x1440 pixels (356x200 millimeters)
  resolution:    183x183 dots per inch

This produces similar to setting scaling factor to 187.5% results. Everything broken and to big. Some elements like icons, seems to render in small size, but spacing between elements are still gigantic. Fonts is to big. In this mode DPI detect site shows 192DPI.
Sites also all broken, in Firefox and Librewolf (despite Librewolf always report 96DPI no mater what).
Also, in librewolf, with this settings, this site Display DPI detector - find out DPI of your monitor shows squares of right sizes (as I measure by ruler)
So something somewhere works correct…

grep DPI /var/log/Xorg.0.log # always shows the same
[     9.888] (==) AMDGPU(0): DPI set to (96, 96)
[     9.939] (WW) NVIDIA(G0): Unable to get display device for DPI computation.
[     9.939] (==) NVIDIA(G0): DPI set to (75, 75); computed from built-in default
Here is screen shots of 150% scale factor and 187.5% scale factor one after another:



And setting windows:




I use non default Icon theme - but this is all the same, if not worse, with default.

So, why is native DPI for my display DPI does not working? I will understand if this is was purely UI elements renser problem, luck of suppr for fruction scaling and such.

But:

  1. Fonts are rendered to big everywhere. Much bigger that they should.
  2. And 150% and 144DPI shows normal (maybe slightly bigger that desired in some places) results for fonts and UI.
  3. And, scale factors less than 150% (143.75% for example) works great as well.
$ inxi -G
Graphics:
  Device-1: NVIDIA GA106M [GeForce RTX 3060 Mobile / Max-Q] driver: nvidia
    v: 535.104.05
  Device-2: AMD Cezanne [Radeon Vega Series / Radeon Mobile Series]
    driver: amdgpu v: kernel
  Display: x11 server: X.Org v: 21.1.8 driver: X: loaded: amdgpu,nvidia
    unloaded: modesetting dri: radeonsi gpu: amdgpu s-res: 2560x1440
    resolution: 2560x1440
  API: EGL v: 1.5 drivers: nvidia platforms: gbm
  API: OpenGL v: 4.6.0 compat-v: 4.6 vendor: amd mesa v: 23.1.7-1
    renderer: AMD Radeon Graphics (renoir LLVM 16.0.6 DRM 3.54 6.5.3-1-MANJARO)
  API: Vulkan v: 1.3.264 drivers: nvidia,radv surfaces: xcb,xlib

At one point I decided to just leave it as it is, but maybe we can find the cause of it all, or learn something new.
Another motivation is, from my understanding, fonts renders best and correct when renderer knows real DPI of monitor. But it seems not the case? But they should? No way that 12pt font must looks gigantic and 6pt - okay in size?

In Display and Monitor → Display Configuration → Configure ‘scale’ to 100%.

1 Like

I did this when I changed DPI to native one:

If I don’t change anything and use 100% scale - I get tiny piny smally everything.

In Display and Monitor → Display Configuration:

  • Configure ‘scale’ to 100%.
  • Configure ‘resolution’ to 1920x1080
  • Do not set a custom DPI – Use the Default 96dpi
  • Reboot

If the font size is still not to your liking, try changing the ‘resolution’ to 1600x900, or possibly 1366x768. The 2560x1440 stated in your specifications may be the maximum resolution possible; but that’s not necessarily the resolution you should use.

Please also post the output of the following command:

sudo inxi --admin --verbosity=7 --filter --no-host --width

and report back with results of these instructions when ready. Cheers.

Newer heard that someone should run LCD display(or other with physical pixels not like CRT ones) in any resolution different from native. Except from games if you want more performance…

Because otherwise you will get software\hardware upscaling of framebuffer and blur or other artifacts, and loose all benefits of higer resolution, for example movie will downscale to hd first and then framebuffer will be upscaled again.

inxi output:

System:
  Kernel: 6.5.3-1-MANJARO arch: x86_64 bits: 64 compiler: gcc v: 13.2.1
    clocksource: tsc available: hpet,acpi_pm
    parameters: BOOT_IMAGE=/boot/vmlinuz-6.5-x86_64
    root=UUID=<filter> rw
    resume=UUID=<filter> udev.log_priority=3
    pcie_aspm=force pcie_aspm.policy=powersave amd_pstate=active
  Desktop: KDE Plasma v: 5.27.8 tk: Qt v: 5.15.10 wm: kwin_x11 dm: SDDM
    Distro: Manjaro Linux base: Arch Linux
Machine:
  Type: Laptop System: HP product: Victus by HP Laptop 16-e0xxx v: N/A
    serial: <filter> Chassis: type: 10 serial: <filter>
  Mobo: HP model: 88EE v: 80.73 serial: <filter> UEFI: AMI v: F.18
    date: 07/25/2023
Battery:
  ID-1: BAT0 charge: 66.1 Wh (100.0%) condition: 66.1/66.1 Wh (100.0%)
    volts: 16.9 min: 15.4 model: HP Primary type: Li-ion serial: <filter>
    status: full cycles: 45
Memory:
  System RAM: total: 64 GiB available: 62.15 GiB used: 9.41 GiB (15.1%)
  Array-1: capacity: 64 GiB note: est. slots: 2 modules: 2 EC: None
    max-module-size: 32 GiB note: est.
  Device-1: Bottom - Slot 1 (left) type: DDR4 detail: synchronous unbuffered
    (unregistered) size: 32 GiB speed: 3200 MT/s volts: curr: 1.2 min: 1.2
    max: 1.2 width (bits): data: 64 total: 64 manufacturer: G.Skill
    part-no: F4-3200C22-32GRS serial: <filter>
  Device-2: Bottom - Slot 2 (right) type: DDR4 detail: synchronous
    unbuffered (unregistered) size: 32 GiB speed: 3200 MT/s volts: curr: 1.2
    min: 1.2 max: 1.2 width (bits): data: 64 total: 64 manufacturer: G.Skill
    part-no: F4-3200C22-32GRS serial: <filter>
CPU:
  Info: model: AMD Ryzen 7 5800H with Radeon Graphics socket: FP6 bits: 64
    type: MT MCP arch: Zen 3 gen: 4 level: v3 note: check built: 2021-22
    process: TSMC n7 (7nm) family: 0x19 (25) model-id: 0x50 (80) stepping: 0
    microcode: 0xA50000D
  Topology: cpus: 1x cores: 8 tpc: 2 threads: 16 smt: enabled cache:
    L1: 512 KiB desc: d-8x32 KiB; i-8x32 KiB L2: 4 MiB desc: 8x512 KiB L3: 16 MiB
    desc: 1x16 MiB
  Speed (MHz): avg: 1552 high: 2634 min/max: 400/4463 base/boost: 3200/4450
    scaling: driver: amd-pstate-epp governor: powersave volts: 1.2 V
    ext-clock: 100 MHz cores: 1: 2407 2: 2376 3: 1944 4: 1915 5: 2557 6: 400
    7: 2634 8: 400 9: 2407 10: 400 11: 400 12: 400 13: 2060 14: 1915 15: 2222
    16: 400 bogomips: 102245
  Flags: 3dnowprefetch abm adx aes aperfmperf apic arat avic avx avx2 bmi1
    bmi2 bpext cat_l3 cdp_l3 clflush clflushopt clwb clzero cmov cmp_legacy
    constant_tsc cpb cppc cpuid cqm cqm_llc cqm_mbm_local cqm_mbm_total
    cqm_occup_llc cr8_legacy cx16 cx8 de decodeassists erms extapic
    extd_apicid f16c flushbyasid fma fpu fsgsbase fsrm fxsr fxsr_opt ht
    hw_pstate ibpb ibrs ibs invpcid irperf lahf_lm lbrv lm mba mca mce
    misalignsse mmx mmxext monitor movbe msr mtrr mwaitx nonstop_tsc nopl npt
    nrip_save nx ospke osvw overflow_recov pae pat pausefilter pclmulqdq
    pdpe1gb perfctr_core perfctr_llc perfctr_nb pfthreshold pge pku pni popcnt
    pse pse36 rapl rdpid rdpru rdrand rdseed rdt_a rdtscp rep_good sep sha_ni
    skinit smap smca smep ssbd sse sse2 sse4_1 sse4_2 sse4a ssse3 stibp succor
    svm svm_lock syscall tce topoext tsc tsc_scale umip v_spec_ctrl
    v_vmsave_vmload vaes vgif vmcb_clean vme vmmcall vpclmulqdq wbnoinvd wdt
    xgetbv1 xsave xsavec xsaveerptr xsaveopt xsaves
Graphics:
  Device-1: NVIDIA GA106M [GeForce RTX 3060 Mobile / Max-Q]
    vendor: Hewlett-Packard driver: nvidia v: 535.104.05
    alternate: nouveau,nvidia_drm non-free: 535.xx+
    status: current (as of 2023-09) arch: Ampere code: GAxxx
    process: TSMC n7 (7nm) built: 2020-23 pcie: gen: 1 speed: 2.5 GT/s lanes: 8
    link-max: gen: 4 speed: 16 GT/s lanes: 16 bus-ID: 01:00.0
    chip-ID: 10de:2520 class-ID: 0300
  Device-2: AMD Cezanne [Radeon Vega Series / Radeon Mobile Series]
    vendor: Hewlett-Packard driver: amdgpu v: kernel arch: GCN-5 code: Vega
    process: GF 14nm built: 2017-20 pcie: gen: 3 speed: 8 GT/s lanes: 16
    link-max: gen: 4 speed: 16 GT/s ports: active: eDP-1 empty: DP-1
    bus-ID: 06:00.0 chip-ID: 1002:1638 class-ID: 0300 temp: 37.0 C
  Device-3: Luxvisions Innotech HP Wide Vision HD Camera driver: uvcvideo
    type: USB rev: 2.0 speed: 480 Mb/s lanes: 1 mode: 2.0 bus-ID: 1-3:2
    chip-ID: 30c9:000e class-ID: 0e02
  Display: server: X.Org v: 21.1.8 compositor: kwin_x11 driver: X:
    loaded: amdgpu,nvidia unloaded: modesetting alternate: fbdev,nouveau,nv,vesa
    dri: radeonsi gpu: amdgpu display-ID: :0 screens: 1
  Screen-1: 0 s-res: 2560x1440 s-dpi: 96 s-size: 677x381mm (26.65x15.00")
    s-diag: 777mm (30.58") monitors: <missing: xrandr>
  Monitor-1: eDP-1 model: BOE Display 0x09e5 built: 2020 res: 2560x1440
    dpi: 183 gamma: 1.2 size: 355x200mm (13.98x7.87") diag: 407mm (16")
    ratio: 16:9 modes: max: 2560x1440 min: 640x480
  API: EGL v: 1.5 hw: drv: nvidia platforms: gbm: drv: nvidia
  API: OpenGL v: 4.6.0 compat-v: 4.6 vendor: amd mesa v: 23.1.7-1 glx-v: 1.4
    direct-render: yes renderer: AMD Radeon Graphics (renoir LLVM 16.0.6 DRM
    3.54 6.5.3-1-MANJARO) device-ID: 1002:1638 memory: 500 MiB unified: no
  API: Vulkan v: 1.3.264 layers: 1 device: 0 type: discrete-gpu name: NVIDIA
    GeForce RTX 3060 Laptop GPU driver: nvidia v: 535.104.05
    device-ID: 10de:2520 surfaces: xcb,xlib device: 1 type: integrated-gpu
    name: AMD Radeon Graphics (RADV RENOIR) driver: mesa radv v: 23.1.7-1
    device-ID: 1002:1638 surfaces: xcb,xlib
Audio:
  Device-1: NVIDIA GA106 High Definition Audio vendor: Hewlett-Packard
    driver: snd_hda_intel v: kernel pcie: gen: 3 speed: 8 GT/s lanes: 8 link-max:
    gen: 4 speed: 16 GT/s lanes: 16 bus-ID: 01:00.1 chip-ID: 10de:228e
    class-ID: 0403
  Device-2: AMD ACP/ACP3X/ACP6x Audio Coprocessor vendor: Hewlett-Packard
    driver: snd_rn_pci_acp3x v: kernel alternate: snd_pci_acp3x, snd_pci_acp5x,
    snd_pci_acp6x, snd_acp_pci, snd_rpl_pci_acp6x, snd_pci_ps,
    snd_sof_amd_renoir, snd_sof_amd_rembrandt pcie: gen: 3 speed: 8 GT/s
    lanes: 16 link-max: gen: 4 speed: 16 GT/s bus-ID: 06:00.5
    chip-ID: 1022:15e2 class-ID: 0480
  Device-3: AMD Family 17h/19h HD Audio vendor: Hewlett-Packard
    driver: snd_hda_intel v: kernel pcie: gen: 3 speed: 8 GT/s lanes: 16
    link-max: gen: 4 speed: 16 GT/s bus-ID: 06:00.6 chip-ID: 1022:15e3
    class-ID: 0403
  API: ALSA v: k6.5.3-1-MANJARO status: kernel-api with: aoss
    type: oss-emulator tools: alsactl,alsamixer,amixer
  Server-1: PipeWire v: 0.3.80 status: n/a (root, process) with:
    1: pipewire-pulse status: active 2: wireplumber status: active
    3: pipewire-alsa type: plugin 4: pw-jack type: plugin
    tools: pactl,pw-cat,pw-cli,wpctl
Network:
  Device-1: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet
    vendor: Hewlett-Packard driver: r8169 v: kernel pcie: gen: 1 speed: 2.5 GT/s
    lanes: 1 port: e000 bus-ID: 02:00.0 chip-ID: <filter> class-ID: 0200
  IF: eno1 state: down mac: <filter>
  Device-2: Realtek RTL8852AE 802.11ax PCIe Wireless Network Adapter
    vendor: Hewlett-Packard driver: rtw89_8852ae v: kernel pcie: gen: 1
    speed: 2.5 GT/s lanes: 1 port: d000 bus-ID: 03:00.0 chip-ID: <filter>
    class-ID: 0280
  IF: wlo1 state: up mac: <filter>
  IP v4: <filter> type: dynamic noprefixroute scope: global
    broadcast: <filter>
  IP v6: <filter> type: noprefixroute scope: link
  WAN IP: <filter>
Bluetooth:
  Device-1: Realtek Bluetooth Radio driver: btusb v: 0.8 type: USB rev: 1.0
    speed: 12 Mb/s lanes: 1 mode: 1.1 bus-ID: 1-4:3 chip-ID: 0bda:2852
    class-ID: e001 serial: <filter>
  Report: rfkill ID: hci0 rfk-id: 1 state: down bt-service: enabled,running
    rfk-block: hardware: no software: yes address: see --recommends
Logical:
  Message: No logical block device data found.
RAID:
  Message: No RAID data found.
Drives:
  Local Storage: total: 476.94 GiB used: 76.55 GiB (16.0%)
  ID-1: /dev/nvme0n1 maj-min: 259:0 vendor: Samsung model: MZVLB512HBJQ-000H1
    size: 476.94 GiB block-size: physical: 4096 B logical: 4096 B
    speed: 31.6 Gb/s lanes: 4 tech: SSD serial: <filter> fw-rev: HPS0NEXF
    temp: 34.9 C scheme: GPT
  SMART: yes health: PASSED on: 64d 11h cycles: 1,452
    read-units: 750,969,661 [384 TB] written-units: 20,475,940 [10.4 TB]
  Message: No optical or floppy data found.
Partition:
  ID-1: / raw-size: 467.81 GiB size: 467.58 GiB (99.95%)
    used: 76.55 GiB (16.4%) fs: xfs block-size: 4096 B dev: /dev/nvme0n1p2
    maj-min: 259:2 label: N/A uuid: <filter>
  ID-2: /boot/efi raw-size: 300 MiB size: 299.3 MiB (99.76%)
    used: 296 KiB (0.1%) fs: vfat block-size: 4096 B dev: /dev/nvme0n1p1
    maj-min: 259:1 label: N/A uuid: <filter>
Swap:
  Kernel: swappiness: 1 (default 60) cache-pressure: 100 (default) zswap: yes
    compressor: zstd max-pool: 20%
  ID-1: swap-1 type: partition size: 8.8 GiB used: 0 KiB (0.0%) priority: -2
    dev: /dev/nvme0n1p3 maj-min: 259:3 label: swap
    uuid: <filter>
Unmounted:
  Message: No unmounted partitions found.
USB:
  Hub-1: 1-0:1 info: hi-speed hub with single TT ports: 4 rev: 2.0
    speed: 480 Mb/s (57.2 MiB/s) lanes: 1 mode: 2.0 chip-ID: 1d6b:0002
    class-ID: 0900
  Device-1: 1-3:2 info: Luxvisions Innotech HP Wide Vision HD Camera
    type: video driver: uvcvideo interfaces: 2 rev: 2.0
    speed: 480 Mb/s (57.2 MiB/s) lanes: 1 mode: 2.0 power: 500mA
    chip-ID: 30c9:000e class-ID: 0e02
  Device-2: 1-4:3 info: Realtek Bluetooth Radio type: bluetooth driver: btusb
    interfaces: 2 rev: 1.0 speed: 12 Mb/s (1.4 MiB/s) lanes: 1 mode: 1.1
    power: 500mA chip-ID: 0bda:2852 class-ID: e001 serial: <filter>
  Hub-2: 2-0:1 info: super-speed hub ports: 2 rev: 3.1
    speed: 10 Gb/s (1.16 GiB/s) lanes: 1 mode: 3.2 gen-2x1 chip-ID: 1d6b:0003
    class-ID: 0900
  Hub-3: 3-0:1 info: hi-speed hub with single TT ports: 4 rev: 2.0
    speed: 480 Mb/s (57.2 MiB/s) lanes: 1 mode: 2.0 chip-ID: 1d6b:0002
    class-ID: 0900
  Device-1: 3-2:2 info: Elecom M-DT1DRBK or M-DT2DRBK DEFT Wireless Optical
    Mouse type: mouse driver: elecom,usbhid interfaces: 1 rev: 2.0
    speed: 1.5 Mb/s (183 KiB/s) lanes: 1 mode: 1.0 power: 98mA
    chip-ID: 056e:00ff class-ID: 0301
  Hub-4: 4-0:1 info: super-speed hub ports: 2 rev: 3.1
    speed: 10 Gb/s (1.16 GiB/s) lanes: 1 mode: 3.2 gen-2x1 chip-ID: 1d6b:0003
    class-ID: 0900
Sensors:
  System Temperatures: cpu: 46.6 C mobo: N/A gpu: amdgpu temp: 37.0 C
  Fan Speeds (rpm): fan-1: 2198 fan-2: 2401
Info:
  Processes: 341 Uptime: 4h 25m wakeups: 2 Init: systemd v: 254
  default: graphical tool: systemctl Compilers: gcc: 13.2.1 alt: 12
  clang: 16.0.6 Packages: pm: pacman pkgs: 1163 libs: 342 tools: pamac
  pm: flatpak pkgs: 0 Shell: Sudo (sudo) v: 1.9.14p3 default: Bash v: 5.1.16
  running-in: konsole inxi: 3.3.30

Did you even try the suggestions to see if they might solve your problem?

2560x1440 multiplied by a scale of 100% is still 2560x1440. At that resolution on a 16.1’’ screen there’s no wonder that everything seems so small.

From the reverse perspective: if 2560x1440 is the maximum possible resolution of this monitor (which equates to 100% of the screen area), simple logic dictates that scaling to 150% (no matter the font DPI) will certainly produce results much as you described:

I notice your Display Configuration screen offers different capabilities than mine. Mine allows scaling either by System or X11:

Mine allows scaling to be handled by either by X11 or the system; a feature yours seems to lack. Of course, available options mainly reflect differences in respective hardware. Interesting, nonetheless.

I have no suggestions apart from those already mentioned.

If they don’t work for you (I hope they do), then I must leave you to the maelstrom of physical and chemical chaos from which we all evolved; or someone with perhaps deeper insight. Cheers.

This is probably coming from the fact you are in a wayland session.
(and OP is using X11)

I considered it; and that the OP uses KWin as opposed SDDM; and uses the new 6.5 kernel – but I had no information that might have made those relevant.

Good catch, though, I switched to Wayland again yesterday.

Another possibly helpful thing to check is whether fontconfig DPI and subpixel layout set also to match the physical display. This was the culprit in my case for an HTPC using an older HDMI TV with low DPI as the display.

Here’s an example for HDMI Vizio M601d-A3/A3R. This display has BGR (blue-green-red) subpixel layout, and 36 DPI:

Expand for example: ~/.config/fontconfig/conf.d/19-DisplayProperties.conf
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "urn:fontconfig:fonts.dtd">
<!-- Generated by Font Manager. Do NOT edit this file. -->
<fontconfig>
  <match target="font">
    <edit name="rgba" mode="assign" binding="strong">
      <int>2</int>
    </edit>
    <edit name="lcdfilter" mode="assign" binding="strong">
      <int>1</int>
    </edit>
    <edit name="scale" mode="assign" binding="strong">
      <double>1.0</double>
    </edit>
    <edit name="dpi" mode="assign" binding="strong">
      <double>36.0</double>
    </edit>
  </match>
</fontconfig>

The values for rgba setting can be found here under the "Configuration File Format → <const> section.

[…SNIP…]

unknown         rgba            0
rgb             rgba            1
bgr             rgba            2
vrgb            rgba            3
vbgr            rgba            4
none            rgba            5

[…SNIP…]

It’s a possibility.

Earlier I mentioned option differences between the OP and mine in System Settings, Display Configuration; because the OP is using X11 and I switched back to Wayland recently - thanks to @cscs for reminding me of that.

The point being that mine (using Wayland; scroll back for screenshot) has a scaling toggle which the OP doesn’t have (using X11); that seems to allow a scaling mode choice.

I’d be interested in knowing whether the OP’s issue would persist after switching to the Wayland compositor. It’s quite easy to install on Manjaro KDE:

sudo pacman -S plasma-wayland-session

…which installs xorg-xwayland and plasma-wayland-session.

My problem is not that it is to small.
My problem is, that with native DPI for my display everything is to big, fonts and spacings and GUI in general. Look like everything thinks I use smartphone or something.
Maybe somewhere some additional scaling applied to fonts rendering and else after some threshold?
I expect that GUI in general can became broken because of reasons, but font size must be adequate?

I use everything default for Manjaro KDE installation, except pipewire.

I will look into it when have time, thank you. I am a bit scared to broke something.

When you do have time:

sudo pacman -S plasma-wayland-session

This command installs Wayland on KDE plus a required dependency. A reboot is then needed.

Wayland can then be selected at your (SDDM) Login Screen (bottom left corner). You can switch back to X11 at any time using that same toggle at login. Cheers.

Ok.

Currently I have such file /.config/fontconfig/fonts.conf
<?xml version='1.0'?>
<!DOCTYPE fontconfig SYSTEM 'urn:fontconfig:fonts.dtd'>
<fontconfig>
 <!-- 
 Artificial oblique for fonts without an italic or oblique version
 -->
 <match target="font">
  <!-- check to see if the font is roman -->
  <test name="slant">
   <const>roman</const>
  </test>
  <!-- check to see if the pattern requested non-roman -->
  <test compare="not_eq" name="slant" target="pattern">
   <const>roman</const>
  </test>
  <!-- multiply the matrix to slant the font -->
  <edit name="matrix" mode="assign">
   <times>
    <name>matrix</name>
    <matrix>
     <double>1</double>
     <double>0.2</double>
     <double>0</double>
     <double>1</double>
    </matrix>
   </times>
  </edit>
  <!-- pretend the font is oblique now -->
  <edit name="slant" mode="assign">
   <const>oblique</const>
  </edit>
  <!-- and disable embedded bitmaps for artificial oblique -->
  <edit name="embeddedbitmap" mode="assign">
   <bool>false</bool>
  </edit>
 </match>
 <!--
 Synthetic emboldening for fonts that do not have bold face available
 -->
 <match target="font">
  <!-- check to see if the weight in the font is less than medium which possibly need emboldening -->
  <test compare="less_eq" name="weight">
   <const>medium</const>
  </test>
  <!-- check to see if the pattern requests bold -->
  <test compare="more_eq" name="weight" target="pattern">
   <const>bold</const>
  </test>
  <!--
		  set the embolden flag
		  needed for applications using cairo, e.g. gucharmap, gedit, ...
		-->
  <edit name="embolden" mode="assign">
   <bool>true</bool>
  </edit>
  <!--
		 set weight to bold
		 needed for applications using Xft directly, e.g. Firefox, ...
		-->
  <edit name="weight" mode="assign">
   <const>bold</const>
  </edit>
 </match>
 <match target="font">
  <edit name="rgba" mode="assign">
   <const>rgb</const>
  </edit>
 </match>
 <match target="font">
  <edit name="hinting" mode="assign">
   <bool>true</bool>
  </edit>
 </match>
 <match target="font">
  <edit name="hintstyle" mode="assign">
   <const>hintslight</const>
  </edit>
 </match>
 <dir>~/.fonts</dir>
 <match target="font">
  <edit name="antialias" mode="assign">
   <bool>true</bool>
  </edit>
 </match>
</fontconfig>

144DPI and 150% scale in KDE settings.

I googled that:
A font is often measured in pt (points). Points dictate the height of the lettering. There are approximately 72 (72.272) points in one inch, or in 2.54 cm. For example, the font size 72 would be about one inch tall, and 36 would be about half an inch. The image shows examples of font sizes ranging from 6 pt to 84 pt.

Here is photo for 72 and 36pt fonts:


And here is macro photo that shows that I have RGB pixels. It also shows that 10pt font takes 26pixels in height:

macro photo

And here photo that shows that my display have ~12 pixels per 1/16 inch. What gives ~192DPI (183 actually), so roughly 96x2

macro photo

Any advice on what I should write in fonts config?

And here is photos of 72pt and 36pt Hack font when I set 183DPI and 100% scaling:


They are bigger than they should be.

Try setting the DPI and subpixel hinting to match the physical display specs. It’s likely that the monitor is a more common DPI like 192 which is what MacBook Retina and other similar displays use. This is also 2x the most common & default Xorg DPI of 96 (2 x 96 = 192).

Maybe try setting rgba (subpixel layout) to rgb (const 1), scale to 1, default lcdfilter 1, and dpi to 192.0:

<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "urn:fontconfig:fonts.dtd">
<fontconfig>
  <match target="font">
    <edit name="rgba" mode="assign" binding="strong">
      <int>1</int>
    </edit>
    <edit name="lcdfilter" mode="assign" binding="strong">
      <int>1</int>
    </edit>
    <edit name="scale" mode="assign" binding="strong">
      <double>1.0</double>
    </edit>
    <edit name="dpi" mode="assign" binding="strong">
      <double>192.0</double>
    </edit>
  </match>
</fontconfig>

Also in “System Settings -> Display Configuration” make sure to set scaling to 100%. For Xorg, also match the screen & font DPI settings to 192. Sometimes for Xorg/X11, setting DPI is easier said than done, but maybe this doc helps

Last thing is that lcdfilter can give different results based on the display & your personal preferences. This page has demos of lcdfilter values, and should work for your RGB subpixel layout display. The lcdfilter that works best for your display should have the least noticeable color banding. Smoother edges are more preferable for the font characters with curved edges. The idea behind this setting is that it works alongside subpixel layout to reduce color fringing and approximate smooth curves on the grid-based pixelated display.

Out of interest, did you try this approach?

There are different scale related settings in Wayland than exist in X11.

If the 192 DPI with scaling factor set to 1:1 (or 100%) doesn’t result in proper sizing for your display… based on the above specs, the DPI.lv website calculates 182 DPI for 2560x1440 & 16.1-inch display.

The general rule is that DPI settings should match the physical display specs such that a 1:1 scaling factor will result in fonts being the proper size. If DPI is set to higher values, the fonts will look smaller at 100% (a.k.a 1:1) scaling. If DPI is set to smaller values, the fonts will look larger at 100% scaling factor.

Anytime scaling factor is set above 100%, everything gets multiplied by that value. So for example with 150% (1.5:1), the fonts, window sizes, and everything else gets magnified 150%.

Ideally you want to work at 1:1 scaling and get things rendering at the proper size. Then if fonts are still too small to read, adjust the default system UI font size larger in pt values, and increase scaling factor until it looks how you prefer.

EDIT: Again, make sure to double-check that Xorg DPI settings are also matching fontconfig. X11 is known to try defaulting to 96 DPI. Also to complicate things… there is a separate Xorg font DPI setting (Xft.dpi), and finally, setting DPI for X11 in general is buggy and doesn’t always “take” the first time.

Check all of the following:

# INXI display DPI settings (for Xorg it will show DPI for both Screen & Monitor)
# Output should have both:
#  Screen-1: [...]   s-dpi: <YOUR PHYSICAL DISPLAY DPI>   [...]
#  Monitor-1: [...]  dpi: <YOUR PHYSICAL DISPLAY DPI>  [...]
sudo inxi --graphics  --admin  --filter --no-host --width
# Xorg DPI setting
# Output should match DPI
xdpyinfo | grep -B2 resolution
# Xorg also has a separate font DPI setting...
# Output should have:  Xft.dpi: <YOUR PHYSICAL DISPLAY DPI>
xrdb -query |grep dpi
# DPI settings logged by Xorg ideally should also match...
# yet, these may be miscalculated by display drivers at startup and may be set manually later in an xsession or other startup script
# Still, it's good to check what Xorg & GPU drivers think the DPI is...
grep DPI /var/log/Xorg.0.log

EDIT2: A few things to note about your display:

  • The laptop’s specs show that this is a “QHD” display (16.1" diagonal, QHD, native resolution: 2560x1440)
  • The 2560x1440 resolution itself is probably going to make things seem tiny when rendered at proper DPI.
    • Once the DPI settings match the physical characteristics of this display, the pt sizes of rendered fonts should be correct relative to everything else (widgets, buttons, windows, etc…)

    • Scaling factor then can be increased to your preference, but note that this will magnify everything including the fonts with their relative sizing when compared to widgets, windows, etc…

    • Some people over on Reddit had this to say:

      If you go 4k, 32in is the smallest to use it at 100%. For laptops, 4k at 14 or 15in works well at 200%.

  • A general strategy for tuning these settings:
    • Start with 1:1 scaling factor (100% scale)
    • Match DPI settings to the physical display specs
    • If fonts look too small, increase default System UI font size in pt units until things look good relative to one another, and are more readable.
    • If things still appear too small, increase the scaling factor above 100%
      • Just be aware: As soon as scaling factor is touched, font sizing in pt will not match pixel-perfect to physical display pixels.

EDIT3: Another final place to set DPI settings is in xorg.conf files (e.g. drop-in files under /etc/X11/xorg.conf.d). Some guidance for doing this here. Generally Xorg is a mess and you might try @soundofthunder’s advice to get a Wayland session working even if only to sanity-check yourself and avoid pulling your hair out trying to configure X11.

1 Like

This is what I am trying to do, but this renders everything to big.
My physical DPI is 183.

I measured it by the ruler :grinning: :straight_ruler:

If you look up the hardware reports 355x200mm (13.98x7.87") screen size,
what means the same 183 DPI.

192 - will make everything even bigger (also, it seems that GTK applications(Firefox precisely), after some threshold (somewhere after DPI144) will use 192 DPI, what makes its UI and web pages gigantic.

Basically, I want to use screen native DPI and cannot understand why everything renders so big.

Also, can someone point me where and how I can change Gdk/UnscaledDPI
How to calculate it?
I tried to change ~/.config/xsettingsd/xsettingsd.conf
But it gets rewritten after reboot. Current settings:

Gdk/UnscaledDPI 98304
Gdk/WindowScalingFactor 1
I created ~/.config/fontconfig/conf.d/16-HDPI.conf
<?xml version='1.0'?>
<!DOCTYPE fontconfig SYSTEM 'urn:fontconfig:fonts.dtd'>
<!-- Generated by Font Manager. Do NOT edit this file. -->
<fontconfig>
 <match target="pattern">
  <edit mode="assign" name="antialias">
   <bool>true</bool>
  </edit>
  <edit mode="assign" name="autohint">
   <bool>false</bool>
  </edit>
  <edit mode="assign" name="hinting">
   <bool>true</bool>
  </edit>
  <edit mode="assign" name="hintstyle">
   <const>hintmedium</const>
  </edit>
  <edit binding="strong" mode="assign" name="rgba">
   <const>rgb</const>
  </edit>
  <edit binding="strong" mode="assign" name="lcdfilter">
   <const>lcdlight</const>
  </edit>
  <edit binding="strong" mode="assign" name="dpi">
   <double>183.0</double>
  </edit>
 </match>
 </fontconfig>
I created /etc/X11/xorg.conf.d/50-display-size.conf
# DPI monitor configuration

Section "Monitor"
    Identifier             "<default monitor>"
    DisplaySize             356 200
EndSection
I created ~/.Xresources
Xft.dpi: 183
Xft.autohint: 0
Xft.lcdfilter:  lcdlight
Xft.hintstyle:  hintmedium
Xft.hinting: 1
Xft.antialias: 1
Xft.rgba: rgb
xdpyinfo | grep -B 2 resolution
screen #0:
  dimensions:    2560x1440 pixels (356x200 millimeters)
  resolution:    183x183 dots per inch
xrdb -query
Xcursor.size:   24
Xcursor.theme:  breeze_cursors
Xft.antialias:  1
Xft.autohint:   0
Xft.dpi:        183
Xft.hinting:    1
Xft.hintstyle:  hintmedium
Xft.lcdfilter:  lcdlight
Xft.rgba:       rgb
printenv - redacted unrelated stuff
COLORFGBG=15;0
COLORTERM=truecolor
DESKTOP_SESSION=plasma
DISPLAY=:0
GTK_MODULES=canberra-gtk-module
QT_AUTO_SCREEN_SCALE_FACTOR=0
QT_LINUX_ACCESSIBILITY_ALWAYS_ON=1
QT_SCREEN_SCALE_FACTORS=eDP=1;DisplayPort-0=1;DP-1-0=1;DP-1-1=1;HDMI-1-0=1;
XCURSOR_SIZE=24
XCURSOR_THEME=breeze_cursors
XDG_CURRENT_DESKTOP=KDE
XDG_SESSION_TYPE=x11
XDG_VTNR=2
SHLVL=1

Scale factor in KDE settings is 100%

But they DON’T. They are to big.

But can someone with 96DPI screen help me to compare physical font size?
For example, this is photo with ruler of Kate editor with Hack font in 72pt size:

Photo

I tried Wayland. Result in general the same. 150% scaling gives good result. But anything close to physical monitor DPI - gives everything gigantic in size.
In system scale and (x11 app will scale on their own) modes result roughly the same (except blurriness of some apps in system scale mode).

Your settings look good as far as I can tell. :thinking: :person_shrugging:

Although, Xorg is known to be a hassle when configuring things for HiDPI displays. Also, it seems that KDE devs are working on HiDPI support recently. Finally, this thread talks about the need (or not) for xsettingsd with KDE Plasma >= 5.27

This page says to calculate Gdk/UnscaledDPI by multiplying the DPI by 1024. For your example of 98304, it looks like it’s still set to 96: 98304 / 1024 = 96.

Maybe try setting it to: 187392 ? (183*1024 = 187392)

Disclaimer: I’ve never had to change this setting, so “take this with a grain of salt” / “your mileage may vary”, etc…

Again, maybe this thread about xsettingsd might be helpful?

Unfortunately, I currently only have a non-standard HTPC display that’s basically a low-DPI (36) HDMI TV.

I’m currently also using Wayland + Sway, so I’ve had a much better DPI-aware & fractional scaling experience overall when compared to Xorg / X11. It seems that getting Xorg to respect HiDPI & scaling properly is complicated and messy.

Thank you for info.
Indeed when I revert all to KDE screen scale mechanism, that sets dpi to 144, Gdk/UnscaledDPI automatically sets to 147456 (144*1024).
This is works great for me.
But I want to dig to the core, why my native DPI wont work… I will try to spawn my question in other places, maybe something will catch up.