cpjreynolds / rustty

A terminal UI library
https://docs.rs/rustty
MIT License
153 stars 14 forks source link

Unicode square doesn't work #57

Open lovesegfault opened 6 years ago

lovesegfault commented 6 years ago

If you try to print '\u{2B1B}', which is Black Large Square on every cell it doesn't quite work. Take a look at this

screenshot from 2017-11-03 02-41-04

//Create terminal and canvas
let mut term = Terminal::new().unwrap();
let mut canvas = Widget::new(term.size().0, term.size().1);
canvas.align(&term, HorizontalAlign::Left, VerticalAlign::Top, 0);

let (width, height) = canvas.size();

'rendering: loop {
    while let Some(Event::Key(c)) =
        term.get_event(Duration::from_millis(200)).unwrap()
    {
        match c {
            'q' => break 'rendering,
            'g' => w.gen(),
            _ => {}
        }
    }
    for x in 0..width {
        for y in 0..height {
            let mut cell = canvas.get_mut(x, y).unwrap();
            cell.set_ch('\u{2B1B}');
        }
    }
    canvas.draw_into(&mut term);
    term.swap_buffers().unwrap();
}