Changing dpi and font size

Open forum for end-user questions about Wine. Before asking questions, check out the Wiki as a first step.
Forum Rules
Locked
Yuriy Lazutin
Newbie
Newbie
Posts: 2
Joined: Mon Feb 22, 2021 3:26 pm

Changing dpi and font size

Post by Yuriy Lazutin »

Hello everyone,
When i executing some windows programs i have a very small fonts on my hidpi monitor. I tried to resolve this issue in different ways, and found that i can change dpi via winecfg tool (Graphics->Screen resolution). But how can i do this without winecfg? Usually i creating for every program a separate bash script and configure a much parameters as possible in it. How can i change screen dpi or font size without winecfg? Is it possibbe to setup some environment variable (for example WINEDPI) and then call wine? I tried to find response in documentation, but not found anything that i need.
jkfloris
Level 12
Level 12
Posts: 3136
Joined: Thu Aug 14, 2014 10:10 am

Re: Changing dpi and font size

Post by jkfloris »

This setting is stored in the registry. Change 0x60 to the desired value

Code: Select all

wine reg add "HKEY_CURRENT_USER\Control Panel\Desktop" /v LogPixels /t REG_DWORD /d 0x60 /f
Yuriy Lazutin
Newbie
Newbie
Posts: 2
Joined: Mon Feb 22, 2021 3:26 pm

Re: Changing dpi and font size

Post by Yuriy Lazutin »

jkfloris wrote: Tue Feb 23, 2021 11:23 am
Thank you so much! Your method worked and this is what I need. I added a few actions to keep the previous DPI value and restore it later. I give an example, maybe someone will be useful.

Code: Select all

#!/bin/bash

WINEPREFIX="/opt/Wine64"
NEWDPI="0x90"
OLDDPI=$( wine reg query "HKEY_CURRENT_USER\Control Panel\Desktop" | grep "LogPixels" | awk ' {print $3} ' | sed 's/\r$//' )

if [ "${OLDDPI}" != "${NEWDPI}" ]; then
  wine reg add "HKEY_CURRENT_USER\Control Panel\Desktop" /v LogPixels /t REG_DWORD /d ${NEWDPI} /f
fi

wine "plsqldev.exe"

if [ "${OLDDPI}" != "${NEWDPI}" ] && [ ! -z "${OLDDPI}" ]; then
  wine reg add "HKEY_CURRENT_USER\Control Panel\Desktop" /v LogPixels /t REG_DWORD /d ${OLDDPI} /f
fi
Locked