From 9710e81ac1f4bbe3ec1011f2a659583ea302d2bf Mon Sep 17 00:00:00 2001 From: Jurn Wubben Date: Thu, 25 Sep 2025 22:57:20 +0200 Subject: [PATCH] Started implementation on text mode --- src/escpos/job.rs | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/escpos/job.rs b/src/escpos/job.rs index 5a0a75f..7910ba4 100644 --- a/src/escpos/job.rs +++ b/src/escpos/job.rs @@ -21,11 +21,20 @@ pub enum BARType { EAN13 = 0x43, UPCA = 0x41, } - pub enum ImageOrientation { Preserve, Largest, } +#[repr(u8)] +pub enum JustifyOrientation {} + +#[repr(u8)] +pub enum TextEffect { + DoubleHeight = 16, + Bold = 8, + DoubleWidth = 32, + Justify(JustifyOrientation) = b'a', +} pub struct Job { pub ready: bool, @@ -46,6 +55,11 @@ impl Job { } } + pub fn write_feed(&mut self, amount: Option) -> () { + let amount = amount.unwrap_or(1); + self.content.extend_from_slice(&[0x1B, b'd', amount]) + } + // pub fn write_text(&mut self, text: String, ) pub fn write_bitmap( &mut self, img: &DynamicImage,