GithubHelp home page GithubHelp logo

Comments (10)

ericwq avatar ericwq commented on May 19, 2024 2

i am using this function to print chinese character. the key problem is the width of chinese rune.

it's a quick workaround.

func print_tb(x, y int, fg, bg termbox.Attribute, msg string) {
for _, c := range msg {
//fmt.Printf("%d ", utf8.RuneLen(c))
termbox.SetCell(x, y, c, fg, bg)
if utf8.RuneLen(c) > 1 { //handle chinese rune
x += 2
} else {
x++
}
}
}

from termbox-go.

nsf avatar nsf commented on May 19, 2024 2

utf8.RuneLen(c) doesn't represent cell's width. Use @mattn's library for that: https://github.com/mattn/go-runewidth

from termbox-go.

nsf avatar nsf commented on May 19, 2024

I'm waiting a pull request from this guy: #69

But apparently he's gone somewhere.

from termbox-go.

nsf avatar nsf commented on May 19, 2024

Just merged this pull request: #74

Does it work now?

from termbox-go.

dacez avatar dacez commented on May 19, 2024

i wil try later thx very much!

from termbox-go.

GeertJohan avatar GeertJohan commented on May 19, 2024

gomatrix still prints the japanese kana's correctly at termbox-go 10f14d7

from termbox-go.

mattn avatar mattn commented on May 19, 2024

Looking good!

from termbox-go.

GeertJohan avatar GeertJohan commented on May 19, 2024

😄 👍

from termbox-go.

dacez avatar dacez commented on May 19, 2024

It can print chinese too

from termbox-go.

ericwq avatar ericwq commented on May 19, 2024

thanks, i already done that.

from termbox-go.

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.