Skip to content

When using ebiten framework to display Chinese characters, I will find that the text becomes fuzzy. How to solve this problem? #2660

Answered by hajimehoshi
xtrn143 asked this question in Q&A
Discussion options

You must be logged in to vote

I'm not sure how fuzzy the text is. A screenshot would be helpful. Would this work?

func (g Game) Layout(outsideWidth, outsideHeight int) (screenWidth, screenHeight int) {
	s := ebiten.DeviceScaleFactor()
	return int(800*s), int(600*s)
}

If s is more than 1, the text would be small (so you would have to use a bigger size) but this would render texts in high resolution.

See also https://github.com/hajimehoshi/ebiten/blob/main/examples/highdpi/main.go

Replies: 1 comment 6 replies

Comment options

You must be logged in to vote
6 replies
@hajimehoshi
Comment options

@hajimehoshi
Comment options

@xtrn143
Comment options

@hajimehoshi
Comment options

Answer selected by hajimehoshi
@xtrn143
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants