summaryrefslogtreecommitdiffstats
path: root/src/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib.rs')
-rw-r--r--src/lib.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/lib.rs b/src/lib.rs
index b573b1a..6b1d6e1 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -1,4 +1,5 @@
mod codes;
+pub mod custom_char;
mod of_node;
use std::fs::{File, OpenOptions};
@@ -288,6 +289,17 @@ where
write_simple_code!(self, SpecialCode::LargeFont)
}
+ /// Custom character create
+ pub fn custom_char(&mut self, code: u8, value: [u8; 8]) -> std::io::Result<()> {
+ let mut res = 0u64;
+ let mut i = 0;
+ for b in value.iter().rev() {
+ res |= (*b as u64) << i;
+ i += 8;
+ }
+ write_simple_code!(self, SpecialCode::Generator(code, res))
+ }
+
pub fn gotoxy(&mut self, x: u32, y: u32) -> std::io::Result<()> {
write_simple_code!(self, SpecialCode::GotoXY(Some(x), Some(y)))
}