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

Can't get better ascii border to display only the simple +,-,| ones. #310

Open
kernelPanic0x opened this issue Dec 4, 2021 · 3 comments

Comments

@kernelPanic0x
Copy link

Hi. Im new to this library and I am testing it out right now. When I copy the demo projects and run them it works but I only get "basic" borders meaning only "+ - |" symbols and not the better looking ascii borders.

The demo looks like this:

package main

import (
	"log"

	ui "github.com/gizak/termui/v3"
	"github.com/gizak/termui/v3/widgets"
)

func main() {
	if err := ui.Init(); err != nil {
		log.Fatalf("failed to initialize termui: %v", err)
	}
	defer ui.Close()

	p := widgets.NewParagraph()
	p.Text = "Hello World!"
	p.SetRect(0, 0, 25, 5)

	ui.Render(p)

	for e := range ui.PollEvents() {
		if e.Type == ui.KeyboardEvent {
			break
		}
	}
}
@kernelPanic0x
Copy link
Author

kernelPanic0x commented Dec 5, 2021

I don't know if it should make a differance but I'm using windows. Under linux the proper ascii borders get displayed but in windows not. Even in git bash in windows only the basic borders get displayed. Can I change this somehow? Would love to get the proper borders for the E S T H E T I C S ;)

@cogburnd02
Copy link

sounds like a windows unicode rendering bug?

@ulaan-bataar
Copy link

Hello,

Given the time past I figure u have already moved on from the issue you were facing.
For others that might come across the same "issue", it's quite simple.

The symbols used for rendering on Windows are coded in that way.
You could make a fork and edit them manually, these can be found in "master/symbols_windows.go"

package termui

const (
    TOP_LEFT     = '┌'
    TOP_RIGHT    = '┐'
    BOTTOM_LEFT  = '└'
    BOTTOM_RIGHT = '┘'

    VERTICAL_LINE   = '│'
    HORIZONTAL_LINE = '─'

    VERTICAL_LEFT   = '├'
    VERTICAL_RIGHT  = '┤'
    HORIZONTAL_UP   = '┬'
    HORIZONTAL_DOWN = '┴'

    QUOTE_LEFT  = '‹'
    QUOTE_RIGHT = '›'

    VERTICAL_DASH   = '│'
    HORIZONTAL_DASH = '─'
)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants