Alexey-T / CudaText

Cross-platform text editor, written in Free Pascal
Mozilla Public License 2.0
2.51k stars 173 forks source link

dpi aware for 2 monitors with different DPI #5748

Open ligq opened 2 days ago

ligq commented 2 days ago

Thank you for developing such a nice editor. I have a request for dpi aware. I have a laptop and an external monitor. The OS is windows11. The two screens have different dpi scale. When the CudaText window switchs from one screen to the other, the font becomes blurry. Could you please solve this issue? Thanks again.

Alexey-T commented 1 day ago

try this beta version. cudatext.zip

it has in maniest now

<dpiAware>True/PM</dpiAware>

ligq commented 1 day ago

try this beta version. cudatext.zip

it has in maniest now

<dpiAware>True/PM</dpiAware>

Thank you for your quick response. The blurry font is gone. However, the font size does not scale with the screen scale. On higher scale screen, the font size is too small.

Alexey-T commented 1 day ago

changed 'dpiaware' again. beta cudatext.zip

if font is not scaled again, try to change option: "ui_scale".

ligq commented 1 day ago

changed 'dpiaware' again. beta cudatext.zip

if font is not scaled again, try to change option: "ui_scale".

I'm sorry. But still the font is not scaled. And the "ui_scale" option does not affect any font size.

BTW, the cudatext window size scales with screen, but the font size does not scale.

Alexey-T commented 1 day ago

because font is changed by different option: "ui_font_scale". it's description in default.json

All fonts scale factor in %, 70 to 500. [has suffix] If value=0, it follows the option "ui_scale". Note: don't set 0 for Windows, it causes too big fonts with High-DPI.

try the value 0 and then 100 to 200.

ligq commented 1 day ago

because font is changed by different option: "ui_font_scale". it's description in default.json

All fonts scale factor in %, 70 to 500. [has suffix] If value=0, it follows the option "ui_scale". Note: don't set 0 for Windows, it causes too big fonts with High-DPI.

try the value 0 and then 100 to 200.

I tried different "ui_scale" and "ui_font_scale", the issue is still there.

Alexey-T commented 1 day ago

i don't have such hardware yet, wait until i get it and test this.

  1. window size. as i get, it is auto changed according to current monitor? good.
  2. font size. as i get, it is not changed to current monitor. i suggest you to set fixed value of "ui_font_scale" (eg 200) for 2nd monitor and keep Cud window always on 2nd monitor. it is partial workaround.
ligq commented 1 day ago

i don't have such hardware yet, wait until i get it and test this.

  1. window size. as i get, it is auto changed according to current monitor? good.
  2. font size. as i get, it is not changed to current monitor. i suggest you to set fixed value of "ui_font_scale" (eg 200) for 2nd monitor and keep Cud window always on 2nd monitor. it is partial workaround.

I prefer the old version. When cudatext switches the screen, I just restart the cudatext then everything is fine. Since cudatext is fast, this is OK. For the new version you provided in this thread, when cudatext switches the screen, I have to change ui_scale and ui_scale_font. It is not convenient. Thanks again.

Alexey-T commented 1 day ago

Ok, reverted to value from 1.128.0