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

Strange behavior when using hBox with unicode char #61

Closed
sifmelcara opened this issue Jun 5, 2016 · 3 comments
Closed

Strange behavior when using hBox with unicode char #61

sifmelcara opened this issue Jun 5, 2016 · 3 comments

Comments

@sifmelcara
Copy link
Contributor

module Main where

import qualified Brick.Main as M
import qualified Brick.Widgets.Core as WC

ui = WC.vLimit h . WC.hLimit 5 $ WC.hBox
    [ WC.str text2 
    , WC.vLimit h $ WC.fill '$'
    ]
    where
    h = 3
    text1 = "    \n寬字\n    \n"
    text2 = "    \nabcd\n    \n"

main :: IO ()
main = M.simpleMain ui

The program displays

    $
abcd$
    $

But when I replace WC.str text2 by WC.str text1, it displays


寬字 

Both abcd and 寬字 occupy 4 display length in my terminal.
Maybe there is something wrong with wide character rendering?

@jtdaugherty
Copy link
Owner

Right now, wide characters are not supported. I've had it on my TODO list for some time, but I haven't spent any time investigating what would be required. (I supported this in vty-ui previously so I'm familiar with the problem and its solution; I just haven't dedicated time to fixing this in brick.)

I'll take a look at this in the next few days.

Thanks!

@jtdaugherty
Copy link
Owner

I started to implement this and ran into a problem with Vty, so this will have to wait until Vty moves forward a bit (see jtdaugherty/vty#94).

@jtdaugherty
Copy link
Owner

This is now fixed and is released on Hackage in version 0.14.

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

2 participants