Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wSystemDpiAware gives bad text render #117

Open
retsyo opened this issue Oct 8, 2023 · 1 comment
Open

wSystemDpiAware gives bad text render #117

retsyo opened this issue Oct 8, 2023 · 1 comment

Comments

@retsyo
Copy link

retsyo commented Oct 8, 2023

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

@khchen
Copy link
Owner

khchen commented Jul 12, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants