wNim icon indicating copy to clipboard operation
wNim copied to clipboard

wSystemDpiAware gives bad text render

Open retsyo opened this issue 2 years ago • 1 comments

for the following code, I think if I use let app = App(wSystemDpiAware), then all controls including the texts on them should zoom according to DPI.

but obvoiusly, according to the image, for Chinese, later characters in the text are eaten; for English, first characters are eaten

so what is the problem? and how to fix it? Thanks

import winim
import wnim

let app = App(wSystemDpiAware)

let mainForm = Frame(title="a form", size=(875+21, 212+47))
let panel = Panel(mainForm)

let progress_c = Gauge(panel, range=100, value=33,  )
progress_c.font = Font(pointSize=9, faceName="tahoma", )

# let static2_c = StaticText(panel, style=wTeRight, label="abcdefgh",  )
let static2_c = StaticText(panel, style=wTeRight, label="进度条:",  )
#static2_c.font = Font(pointSize=14 )

mainForm.layout:
    static2_c:
        left = 18
        top = 170
        right = 103
        bottom = 203

    progress_c:
        left = 115
        top = 172
        right = 857
        bottom = 197

mainForm.center
mainForm.show()

app.mainLoop()

noDPI——Chinese DPI_Chinese

noDPI-En dpi_en

retsyo avatar Oct 08 '23 13:10 retsyo

wSystemDpiAware is not automatic scaling; it tells the system to assume that your application has considered DPI scaling, so it should not 'auto scale.' For how to handle DPI scaling, please consider functions in wFrame, such as dpiAutoScale.

khchen avatar Jul 12 '24 18:07 khchen