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

Multiline text rendering is misaligned #5264

Open
2 tasks done
pjanx opened this issue Nov 13, 2024 · 5 comments
Open
2 tasks done

Multiline text rendering is misaligned #5264

pjanx opened this issue Nov 13, 2024 · 5 comments
Labels
bug Something isn't working

Comments

@pjanx
Copy link

pjanx commented Nov 13, 2024

Checklist

  • I have searched the issue tracker for open issues that relate to the same problem, before opening a new one.
  • This issue only relates to a single bug. I will open new issues for any other problems.

Describe the bug

Fyne seemingly doesn't bother to pixel align text when rendering, and so it often ends up fuzzy.
See the animated screenshot.

How to reproduce

Have a lot of lines of text in your application.

Screenshots

animated

Example code

package main

import (
	"strings"
	"time"

	"fyne.io/fyne/v2"
	"fyne.io/fyne/v2/app"
	"fyne.io/fyne/v2/widget"
)

func main() {
	a := app.New()
	w := a.NewWindow("Bugs")
	w.Resize(fyne.NewSize(480, 360))
	me := widget.NewMultiLineEntry()
	w.SetContent(me)

	long := strings.Repeat("Lorem ipsum dolor sit amet\n", 60)
	short := strings.Repeat("Lorem ipsum dolor sit amet\n", 40)
	var which bool
	t := time.NewTicker(time.Second / 2)
	go func() {
		for {
			<-t.C
			which = !which
			if which {
				me.SetText(long)
			} else {
				me.SetText(short)
			}
			me.TypedKey(&fyne.KeyEvent{Name: fyne.KeyPageDown})
		}
	}()
	w.ShowAndRun()
}

Fyne version

2.5.2

Go compiler version

1.23.2

Operating system and version

Linux

Additional Information

No response

@pjanx pjanx added the unverified A bug that has been reported but not verified label Nov 13, 2024
@andydotxyz
Copy link
Member

It does try to pixel align the text. It seems you have found a case where it fails.

Can you please provide full information about your monitor / resolution and any scaling applied by the operating system?

Also, if you run "fyne_demo" and go to the Advanced screen what does it report for scaling?

@andydotxyz andydotxyz added bug Something isn't working and removed unverified A bug that has been reported but not verified labels Nov 15, 2024
@pjanx
Copy link
Author

pjanx commented Nov 15, 2024

This was recorded without scaling, just scaled up twice without filtering to make it clearer, but I can generally test it just about everywhere, if you wait.

@andydotxyz
Copy link
Member

Please check the scale info from fyne_demo. User scale settings are only 1 of 3 possible sources of scaling on the output device.

@pjanx
Copy link
Author

pjanx commented Nov 16, 2024

Please check the scale info from fyne_demo

Like I stated, and also just run the example,
fyne

Problematic platforms include:

  • Linux (no scaling)
  • Windows (no scaling, compiled via fyne-cross)
  • Android (scale 3.00, texture scale 1.00)
  • macOS (scale 1.00, texture scale 2.00)

@andydotxyz
Copy link
Member

Perfect thanks

@andydotxyz andydotxyz added this to the E fixes (v2.5.x) milestone Nov 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants