TextGrid background color shows visual artifacts when FYNE_SCALE is not 1.0, 1.5, or 2.0 #4844
Open
2 tasks done
Labels
unverified
A bug that has been reported but not verified
Checklist
Describe the bug
When glyphs have a TextGridStyle with BGColor that differs from the background, and FYNE_SCALE is set to values like 1.2 or 1.4, then text with the background color shows some vertical and horizontal lines between glyphs. This does not occur when the scale is set to values 1.0, 1.5, and 2.0. It is only tested on Linux.
This might seem like a harmless glitch but the artifacts can be quite extreme with some colors and users who change the scale will likely set FYNE_SCALE to values such as 1.2 or 1.3 where the problem occurs.
Workaround: none known
How to reproduce
Create a TextGrid and set it as main content, use some text generator like "github.com/drhodes/golorem" to fill it with strings, set a background color range, and show and display the window with the text grid. Launch with:
FYNE_SCALE=1.2 go run grid.go
Screenshots
In the following examples, the first has Scale 1.0 and the last has 1.5. These are fine. The two in the middle have scale 1.2 and 1.4 respectively, and show the artifacts.
Example code
Fyne version
2.4
Go compiler version
go version go1.22.0 linux/amd64
Operating system and version
Linux Mint 21.3 Cinnamon
Additional Information
There seems to be a line of pixels with background color between glyphs with certain scales. Some of the lines are irregular, indicating different bounding boxes of glyphs. This might be a more general driver / font rendering problem.
This could be a rounding error because the rendering is not non-pixel precise. It might be possible to fix the problem by manually drawing background rectangles of the right / a slightly larger size.
The text was updated successfully, but these errors were encountered: