Simulate DPI on Linux/Windows like in Android emulator

When im creating android emulator i can set resulution and dpi how to change DPI of window in linux/windows it should be possible but i don’t know where start research.

Anybody try to do something like this?