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
Post Reply
Yuriy Lazutin
Newbie
Newbie
Posts: 2
Joined: Mon Feb 22, 2021 3:26 pm

Changing dpi and font size

Post by Yuriy Lazutin » Mon Feb 22, 2021 3:50 pm

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 9
Level 9
Posts: 1438
Joined: Thu Aug 14, 2014 10:10 am

Re: Changing dpi and font size

Post by jkfloris » Tue Feb 23, 2021 11:23 am

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 » Tue Feb 23, 2021 3:12 pm

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

Post Reply