2020-12-23 21:50:23 +01:00
|
|
|
//! based on the proof of concept at ../../src/poc/cjkscroll.c
|
|
|
|
|
|
|
|
use libnotcurses_sys::*;
|
|
|
|
|
2020-12-25 19:35:21 +01:00
|
|
|
fn main() -> NcResult<()> {
|
2021-01-02 22:58:35 +01:00
|
|
|
let mut nc = FullMode::new()?;
|
2021-01-03 02:40:28 +01:00
|
|
|
let plane = nc.stdplane();
|
2020-12-23 21:50:23 +01:00
|
|
|
plane.set_scrolling(true);
|
|
|
|
|
2020-12-24 02:47:26 +01:00
|
|
|
let mut wc = '\u{4e00}'; // 一
|
2020-12-23 21:50:23 +01:00
|
|
|
|
|
|
|
loop {
|
2020-12-26 07:34:26 +01:00
|
|
|
plane.putchar(wc)?;
|
2020-12-23 21:50:23 +01:00
|
|
|
wc = core::char::from_u32(wc as u32 + 1).expect("invalid char");
|
|
|
|
|
2021-01-02 19:45:15 +01:00
|
|
|
// 龣
|
|
|
|
if wc == '\u{9fa5}' {
|
2020-12-23 21:50:23 +01:00
|
|
|
wc = '\u{4e00}';
|
|
|
|
}
|
2021-01-02 19:45:15 +01:00
|
|
|
rsleep![&mut nc, 0, 0, 30];
|
2020-12-23 21:50:23 +01:00
|
|
|
}
|
|
|
|
}
|