GithubHelp home page GithubHelp logo

duitdraw's People

Contributors

fhs avatar ktye avatar tobiasheinicke avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

duitdraw's Issues

macOS support

duitdraw in macOS gives this error:

2019/03/07 07:26:29 gldriver.Main called on thread 83675, but gldriver.init ran on 83673

Basically, this is complaining that shiny/driver.Main was not called from the goroutine running main.main function. Shiny calls runtime.LockOSThread in init function, locking main.main to a thread, and checks if driver.Main is called on the same thread. See this golang-nuts discussion.

I don't see any obvious fix without breaking compatibility with the 9fans.net/go/draw package.

Cannot cross-compile for Darwin.

Hello again,
I was testing the cross platform ability for this toolkit. I ran into another error when building for darwin,

Error:
(#) golang.org/x/mobile/gl
..\go\src\golang.org\x\mobile\gl\gl.go:20:12: undefined: context

I put the () to prevent github from bolding it.

Thanks!

Error when rebuilding duit.

Hello,

If I try and recompile the duit package after adding your files into the 9fans draw folder in src, I get the following error:

9fans.net/go/draw

..\go\src\9fans.net\go\draw\display.go:7:2: draw redeclared in this block
previous declaration at ..\go\src\9fans.net\go\draw\draw.go:57:102
..\go\src\9fans.net\go\draw\display.go:43:6: (*Display).AllocImage redeclared in this block
previous declaration at ..\go\src\9fans.net\go\draw\alloc.go:14:6
..\go\src\9fans.net\go\draw\display.go:104:6: (*Display).SetDebug redeclared in this block
previous declaration at ..\go\src\9fans.net\go\draw\debug.go:4:6
..\go\src\9fans.net\go\draw\freesubfont.go:7:10: undefined: Subfont
..\go\src\9fans.net\go\draw\image.go:7:2: draw redeclared as imported package name
previous declaration at ..\go\src\9fans.net\go\draw\draw.go:57:102

Thanks for trying to make this work, but your code is not working quite right yet!

Thanks!

freetype crashes occasionally in GlyphAdvance

I'm using the default font at @12pt. I generated a core dump and looked at it with the delve debugger. It seems it crashed when computing GlyphAdvance of 0 (U+0030) but I can't reproduce it. I'm guessing it crashed due to some internal state.

Anyway, I think we should look into moving to golang.org/x/image/font/sfnt rather than spend time debugging freetype.

panic: runtime error: index out of range

goroutine 29 [running, locked to thread]:
panic(0x66e0c0, 0x8f96d0)
        /home/big/go/src/runtime/panic.go:565 +0x2c5 fp=0xc0002c3668 sp=0xc0002c35d8 pc=0x42cbf5
runtime.panicindex()
        /home/big/go/src/runtime/panic.go:44 +0xfb fp=0xc0002c3698 sp=0xc0002c3668 pc=0x42b8fb
github.com/golang/freetype/truetype.(*GlyphBuf).loadSimple(0xc0000c8300, 0x8d7878, 0xac, 0x214bc, 0x3, 0xc000090370, 0x0, 0x0)
        /home/fhs/go/src/github.com/golang/freetype/truetype/glyph.go:329 +0x60b fp=0xc0002c3748 sp=0xc0002c3698 pc=0x57100b
github.com/golang/freetype/truetype.(*GlyphBuf).load(0xc0000c8300, 0x1001300000000, 0x1000000006cd601, 0x0)
        /home/fhs/go/src/github.com/golang/freetype/truetype/glyph.go:229 +0x32c fp=0xc0002c3888 sp=0xc0002c3748 pc=0x5702cc
github.com/golang/freetype/truetype.(*GlyphBuf).Load(0xc0000c8300, 0xc00000c3c0, 0x130000042b, 0x0, 0xc000178a80, 0xc00019ae80)
        /home/fhs/go/src/github.com/golang/freetype/truetype/glyph.go:102 +0xc4 fp=0xc0002c38c0 sp=0xc0002c3888 pc=0x56fce4
github.com/golang/freetype/truetype.(*face).GlyphAdvance(0xc0000c5800, 0x30, 0x10)
        /home/fhs/go/src/github.com/golang/freetype/truetype/face.go:347 +0x6e fp=0xc0002c3900 sp=0xc0002c38c0 pc=0x56f30e
github.com/ktye/duitdraw.(*pixFace).GlyphAdvance(0xc00004e7e0, 0xc000000030, 0x5d07b4)
        <autogenerated>:1 +0x44 fp=0xc0002c3928 sp=0xc0002c3900 pc=0x5cad74
github.com/ktye/duitdraw.(*Font).StringWidth(0xc000174140, 0x6bf0cc, 0x1, 0x0)
        /home/fhs/go/src/github.com/ktye/duitdraw/font.go:139 +0x72 fp=0xc0002c3970 sp=0xc0002c3928 pc=0x5c82e2
github.com/rjkroege/edwood/internal/frame.(*frameimpl).Init(0xc000214780, 0x14, 0x2a, 0x354, 0x3d, 0xc000454038, 0x1, 0x1)
        /home/fhs/go/src/github.com/rjkroege/edwood/internal/frame/frame.go:321 +0x13f fp=0xc0002c39b8 sp=0xc0002c3970 pc=0x5d052f
main.(*Text).Redraw(0xc000064398, 0x14, 0x2a, 0x354, 0x3d, 0x354, 0x100)
        /home/fhs/go/src/github.com/rjkroege/edwood/text.go:142 +0xe5 fp=0xc0002c3a10 sp=0xc0002c39b8 pc=0x619665
main.(*Text).Resize(0xc000064398, 0x0, 0x2a, 0x354, 0x3d, 0x1, 0x6cd658)
        /home/fhs/go/src/github.com/rjkroege/edwood/text.go:182 +0x1aa fp=0xc0002c3a70 sp=0xc0002c3a10 pc=0x619a1a
main.(*Window).Resize(0xc000064380, 0x0, 0x2a, 0x354, 0x3d, 0x0, 0x47f)
        /home/fhs/go/src/github.com/rjkroege/edwood/wind.go:265 +0x59c fp=0xc0002c3af0 sp=0xc0002c3a70 pc=0x624d3c
main.(*Column).Grow(0xc000240000, 0xc0000a8380, 0x1)
        /home/fhs/go/src/github.com/rjkroege/edwood/col.go:444 +0x6da fp=0xc0002c3c28 sp=0xc0002c3af0 pc=0x5f161a
main.(*Text).Show(0xc0000a8488, 0x480, 0x480, 0xffffffffffffff01)
        /home/fhs/go/src/github.com/rjkroege/edwood/text.go:1205 +0x370 fp=0xc0002c3c70 sp=0xc0002c3c28 pc=0x61fa80
main.openfile(0xc0000a8488, 0xc0002c3e48, 0xb)
        /home/fhs/go/src/github.com/rjkroege/edwood/look.go:665 +0x289 fp=0xc0002c3dd8 sp=0xc0002c3c70 pc=0x60fec9
main.plumblook(0xc00030d860)
        /home/fhs/go/src/github.com/rjkroege/edwood/look.go:235 +0x11b fp=0xc0002c3ea0 sp=0xc0002c3dd8 pc=0x60dd1b
main.mousethread(0xc000110000)
        /home/fhs/go/src/github.com/rjkroege/edwood/acme.go:295 +0x242 fp=0xc0002c3fd8 sp=0xc0002c3ea0 pc=0x5eaf12
runtime.goexit()
        /home/big/go/src/runtime/asm_amd64.s:1337 +0x1 fp=0xc0002c3fe0 sp=0xc0002c3fd8 pc=0x459591
created by main.main
        /home/fhs/go/src/github.com/rjkroege/edwood/acme.go:160 +0x887

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.