Giter Club home page Giter Club logo

Comments (9)

andydotxyz avatar andydotxyz commented on May 3, 2024

Hi, I have seen something similar on macOS - I think the text render code we import varies between platform.

If you run with FYNE_SCALE=2 does it look better (the UI will be bigger though)

from fyne.

dz0ny avatar dz0ny commented on May 3, 2024

Well kinda, but you can still see same font issues.

image

from fyne.

andydotxyz avatar andydotxyz commented on May 3, 2024

I have removed a workaround that was added for macOS - can you update and let me know if this makes things better? Thanks

from fyne.

dz0ny avatar dz0ny commented on May 3, 2024

image

Seems bit better to me, but scaling is broken now:

 env FYNE_SCALE=2FYNE_SCALE=2 go run main.go
# github.com/go-gl/glfw/v3.2/glfw
In file included from ../.gobu/global/pkg/mod/github.com/go-gl/[email protected]/v3.2/glfw/c_glfw_linbsd.go:24:
../.gobu/global/pkg/mod/github.com/go-gl/[email protected]/v3.2/glfw/glfw/src/linux_joystick.c: In function ‘_glfwInitJoysticksLinux’:
../.gobu/global/pkg/mod/github.com/go-gl/[email protected]/v3.2/glfw/glfw/src/linux_joystick.c:224:42: warning: ‘%s’ directive output may be truncated writing up to 255 bytes into a region of size 9 [-Wformat-truncation=]
             snprintf(path, sizeof(path), "%s/%s", dirname, entry->d_name);
                                          ^~~~~~~
In file included from /usr/include/stdio.h:873,
                 from /usr/include/X11/Xcursor/Xcursor.h:26,
                 from ../.gobu/global/pkg/mod/github.com/go-gl/[email protected]/v3.2/glfw/glfw/src/x11_platform.h:39,
                 from ../.gobu/global/pkg/mod/github.com/go-gl/[email protected]/v3.2/glfw/glfw/src/internal.h:169,
                 from ../.gobu/global/pkg/mod/github.com/go-gl/[email protected]/v3.2/glfw/glfw/src/x11_init.c:28,
                 from ../.gobu/global/pkg/mod/github.com/go-gl/[email protected]/v3.2/glfw/c_glfw_linbsd.go:19:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:67:10: note: ‘__builtin___snprintf_chk’ output between 12 and 267 bytes into a destination of size 20
   return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        __bos (__s), __fmt, __va_arg_pack ());
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
panic: reflect: slice index out of range

goroutine 1 [running, locked to thread]:
reflect.Value.Index(0x748560, 0xc00000c780, 0x97, 0x0, 0x748560, 0x0, 0x0)
	/home/dz0ny/.gobu/1.11.4/go/src/reflect/value.go:924 +0x20a
github.com/go-gl/gl/v3.2-core/gl.Ptr(0x748560, 0xc00000c780, 0x748560)
	/home/dz0ny/.gobu/global/pkg/mod/github.com/go-gl/[email protected]/v3.2-core/gl/conversions.go:44 +0x12a
github.com/fyne-io/fyne/driver/gl.(*glCanvas).newGlTextTexture(0xc0005920c0, 0x84cdc0, 0xc000b5c4d0, 0x44)
	/home/dz0ny/.gobu/global/pkg/mod/github.com/fyne-io/[email protected]/driver/gl/gl.go:120 +0x4c6
github.com/fyne-io/fyne/driver/gl.(*glCanvas).drawText(0xc0005920c0, 0xc000b5c4d0, 0x44, 0x8, 0x8000000000000000, 0x8000000000000000)
	/home/dz0ny/.gobu/global/pkg/mod/github.com/fyne-io/[email protected]/driver/gl/draw.go:163 +0x194
github.com/fyne-io/fyne/driver/gl.(*glCanvas).drawObject(0xc0005920c0, 0x84cdc0, 0xc000b5c4d0, 0x4, 0x4, 0x8000000000000000, 0x8000000000000000)
	/home/dz0ny/.gobu/global/pkg/mod/github.com/fyne-io/[email protected]/driver/gl/draw.go:179 +0x26e
github.com/fyne-io/fyne/driver/gl.(*glCanvas).paint.func1(0x84cdc0, 0xc000b5c4d0, 0x4, 0x4)
	/home/dz0ny/.gobu/global/pkg/mod/github.com/fyne-io/[email protected]/driver/gl/canvas.go:131 +0x64
github.com/fyne-io/fyne/driver/gl.walkObjects(0x84cdc0, 0xc000b5c4d0, 0x4, 0x4, 0xc000f4fd78)
	/home/dz0ny/.gobu/global/pkg/mod/github.com/fyne-io/[email protected]/driver/gl/draw.go:29 +0x1f6
github.com/fyne-io/fyne/driver/gl.walkObjects(0x84cfa0, 0xc00006a540, 0x4, 0x4, 0xc000f4fd78)
	/home/dz0ny/.gobu/global/pkg/mod/github.com/fyne-io/[email protected]/driver/gl/draw.go:26 +0x197
github.com/fyne-io/fyne/driver/gl.walkObjects(0x84cc40, 0xc000096050, 0x4, 0x4, 0xc000f4fd78)
	/home/dz0ny/.gobu/global/pkg/mod/github.com/fyne-io/[email protected]/driver/gl/draw.go:19 +0x2bb
github.com/fyne-io/fyne/driver/gl.walkObjects(0x7fa4bea21210, 0xc00006a3c0, 0x4, 0x4, 0xc000f4fd78)
	/home/dz0ny/.gobu/global/pkg/mod/github.com/fyne-io/[email protected]/driver/gl/draw.go:26 +0x197
github.com/fyne-io/fyne/driver/gl.walkObjects(0x84cc40, 0xc0000960a0, 0x0, 0x0, 0xc000f4fd78)
	/home/dz0ny/.gobu/global/pkg/mod/github.com/fyne-io/[email protected]/driver/gl/draw.go:19 +0x2bb
github.com/fyne-io/fyne/driver/gl.(*glCanvas).paint(0xc0005920c0, 0x8000000000000000, 0x8000000000000000)
	/home/dz0ny/.gobu/global/pkg/mod/github.com/fyne-io/[email protected]/driver/gl/canvas.go:133 +0x124
github.com/fyne-io/fyne/driver/gl.(*gLDriver).runGL(0xc00000c6e0)
	/home/dz0ny/.gobu/global/pkg/mod/github.com/fyne-io/[email protected]/driver/gl/loop.go:101 +0x456
github.com/fyne-io/fyne/driver/gl.(*gLDriver).Run(0xc00000c6e0)
	/home/dz0ny/.gobu/global/pkg/mod/github.com/fyne-io/[email protected]/driver/gl/driver.go:82 +0x2b
github.com/fyne-io/fyne/app.(*fyneApp).Run(0xc00008b1d0)
	/home/dz0ny/.gobu/global/pkg/mod/github.com/fyne-io/[email protected]/app/app.go:34 +0x33
main.main()
	/home/dz0ny/ui/main.go:15 +0x83
exit status 2

my go.sum

github.com/fyne-io/examples v0.0.0-20181230225548-8bfbdf6dcf9b h1:IbieckAzS7x64KEtLnAy/atiGkd00VgwpYOe0lU3Ao8=
github.com/fyne-io/examples v0.0.0-20181230225548-8bfbdf6dcf9b/go.mod h1:5H9Rmf1bXgeOLtOmTvNIYn9qQYpLTYjmA9rNGdwdudk=
github.com/fyne-io/fyne v0.0.0-20190101011624-e7e11452a8cb h1:EwMQdD3SrbxmxLVKCM0Zj5hEwpBdArZdhKhhVvKM5l4=
github.com/fyne-io/fyne v0.0.0-20190101011624-e7e11452a8cb/go.mod h1:7hMcoQylYaW/zrCA54lzQnTxzOcsCTzqAp7qOCJixz8=
github.com/fyne-io/fyne v0.0.0-20190102124432-060540100c6d h1:+h65p2009+klHN6d4XejhnDwRInrNSlh3aBTucdw5Gc=
github.com/fyne-io/fyne v0.0.0-20190102124432-060540100c6d/go.mod h1:7hMcoQylYaW/zrCA54lzQnTxzOcsCTzqAp7qOCJixz8=
github.com/go-gl/gl v0.0.0-20181026044259-55b76b7df9d2 h1:78Hza2KHn2PX1jdydQnffaU2A/xM0g3Nx1xmMdep9Gk=
github.com/go-gl/gl v0.0.0-20181026044259-55b76b7df9d2/go.mod h1:482civXOzJJCPzJ4ZOX/pwvXBWSnzD4OKMdH4ClKGbk=
github.com/go-gl/glfw v0.0.0-20181213070059-819e8ce5125f h1:7MsFMbSn8Lcw0blK4+NEOf8DuHoOBDhJsHz04yh13pM=
github.com/go-gl/glfw v0.0.0-20181213070059-819e8ce5125f/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU=
github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0 h1:DACJavvAHhabrF08vX0COfcOBJRhZ8lUbR+ZWIs0Y5g=
github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k=
github.com/srwiley/oksvg v0.0.0-20181204230515-738c2688bcb3 h1:TDsNJr08g+4K/G5rfrt3gIftqhpGClMXKM0OJQD7VNU=
github.com/srwiley/oksvg v0.0.0-20181204230515-738c2688bcb3/go.mod h1:afMbS0qvv1m5tfENCwnOdZGOF8RGR/FsZ7bvBxQGZG4=
github.com/srwiley/rasterx v0.0.0-20181219215540-696f7edb7a7e h1:FFotfUvew9Eg02LYRl8YybAnm0HCwjjfY5JlOI1oB00=
github.com/srwiley/rasterx v0.0.0-20181219215540-696f7edb7a7e/go.mod h1:mvWM0+15UqyrFKqdRjY6LuAVJR0HOVhJlEgZ5JWtSWU=
golang.org/x/image v0.0.0-20181116024801-cd38e8056d9b h1:VHyIDlv3XkfCa5/a81uzaoDkHH4rr81Z62g+xlnO8uM=
golang.org/x/image v0.0.0-20181116024801-cd38e8056d9b/go.mod h1:ux5Hcp/YLpHSI86hEcLt0YII63i6oz57MZXIpbrjZUs=
golang.org/x/net v0.0.0-20181220203305-927f97764cc3 h1:eH6Eip3UpmR+yM/qI9Ijluzb1bNv/cAU/n+6l8tRSis=
golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=

from fyne.

andydotxyz avatar andydotxyz commented on May 3, 2024

Thanks for this. I think the crash may be due to your env - try removing the duplicate FYNE_SCALE and see if it helps

from fyne.

andydotxyz avatar andydotxyz commented on May 3, 2024

I added some error handling code to the scale parsing - hopefully it should provide a more helpful response than the above.
Can you please let us know if there is still an issue - otherwise I think this can be closed.

from fyne.

dz0ny avatar dz0ny commented on May 3, 2024

image
Yep it can be closed, thx.

from fyne.

dz0ny avatar dz0ny commented on May 3, 2024

And as bonus fractional scaling also works, great job.

image

from fyne.

andydotxyz avatar andydotxyz commented on May 3, 2024

Yup, it’s fully scalable, so that will always work. It aims to set a sensible scale based on screen resolution - this is usually between 1.0 and 2.0 :)

from fyne.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.