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

MacOS: fuzzy font on Retina #280

Closed
dant3 opened this issue Aug 9, 2022 · 3 comments
Closed

MacOS: fuzzy font on Retina #280

dant3 opened this issue Aug 9, 2022 · 3 comments

Comments

@dant3
Copy link

dant3 commented Aug 9, 2022

I'm trying to run an example from the readme.md of the engine on a mac.
The button text looks really fuzzy. Looks as if some antialiasing is missing. Most likely the problem is because Retina is not supported. My system is MacBook Pro (16-inch, 2019).

image

P.S. Sorry for the camera photo, but there is no way I can demonstrate this with the screenshot -- since the problem is caused by Retina.

@danaugrs
Copy link
Member

Yeah, this is probably because of the lack of HDPI support and maybe also due to non-pixel perfect alignment of the font. PRs are welcome, although #281 should probably be tackled first.

@qizhanchan
Copy link

Any Updates?

zyxkad added a commit to zyxkad/g3n-engine that referenced this issue Dec 3, 2023
Font's on retina will be blur cause Rentina have 2x DPI
Now we times the DPI by 2 when on darwin, and scale the Label panel by 0.5 to keep the original size
Since we scaled the panel size back, so it should not affect much on non-Rentina darwin
However, if you are using non-darwin with rentina monitor, issue g3n#280 will still happen, need a way to detect the monitor
@zyxkad
Copy link
Contributor

zyxkad commented Dec 3, 2023

Any Updates?

Hi @qizhanchan , I made the pr #298 to fix this, you can test it if you want.

xackery pushed a commit to xackery/engine that referenced this issue Feb 28, 2024
* fix g3n#280
Font's on retina will be blur cause Rentina have 2x DPI
Now we times the DPI by 2 when on darwin, and scale the Label panel by 0.5 to keep the original size
Since we scaled the panel size back, so it should not affect much on non-Rentina darwin
However, if you are using non-darwin with rentina monitor, issue g3n#280 will still happen, need a way to detect the monitor

* remove a debug log

* we should devide on int but not floor, or the text will be out of shape

* Revert "we should devide on int but not floor, or the text will be out of shape"
I was completely wrong, we should divide on the floor or the text won't keep it's original size

This reverts commit 73f1b6a.

* use `window.Get().GetScale()` instead of hardcoded size and os

* use explicit rune casting to pass `go test`

* fix format for font.go

* fix for Edit
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

4 participants