From d5fea320dd0ab4ed5ad9d9bdf33a4fafa34c0a4c Mon Sep 17 00:00:00 2001 From: Simon Bruder Date: Fri, 12 Jul 2024 20:56:25 +0200 Subject: [PATCH] Add branding to labels --- src/label/mod.rs | 5 +++++ src/label/preset.rs | 16 ++++++++++++++-- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/src/label/mod.rs b/src/label/mod.rs index 34f2db1..5cdeef3 100644 --- a/src/label/mod.rs +++ b/src/label/mod.rs @@ -60,6 +60,7 @@ pub struct LabelConfig { code128: Option, id_text: Option, short_id_text: Option, + branding: Option, } #[derive(Debug)] @@ -170,6 +171,10 @@ impl LabelPage { cfg.draw(layer, font, self.short_id.as_ref())?; } + if let Some(cfg) = &config.branding { + cfg.draw(layer, font, Some("li7y"))?; + } + Ok(()) } } diff --git a/src/label/preset.rs b/src/label/preset.rs index abb2d45..353b0f3 100644 --- a/src/label/preset.rs +++ b/src/label/preset.rs @@ -32,14 +32,18 @@ impl Into for LabelPreset { position: (Mm(0.0), Mm(22.0)), }), short_id_text: None, + branding: Some(TextConfig { + font_size: 7.0, + position: (Mm(39.5), Mm(0.6)), + }), }, Self::SeikoSlpMrlCode128 => LabelConfig { width: Mm(44.45), height: Mm(24.13), data_matrix: None, code128: Some(Code128Config { - scale: (Mm(44.45), Mm(19.0)), - position: (Mm(0.0), Mm(2.5)), + scale: (Mm(44.45), Mm(18.75)), + position: (Mm(0.0), Mm(2.75)), }), id_text: Some(TextConfig { font_size: 7.0, @@ -49,6 +53,10 @@ impl Into for LabelPreset { font_size: 7.0, position: (Mm(0.0), Mm(0.0)), }), + branding: Some(TextConfig { + font_size: 7.0, + position: (Mm(39.5), Mm(0.6)), + }), }, Self::SeikoSlpMrl => LabelConfig { width: Mm(44.45), @@ -69,6 +77,10 @@ impl Into for LabelPreset { font_size: 7.0, position: (Mm(17.0), Mm(0.0)), }), + branding: Some(TextConfig { + font_size: 7.0, + position: (Mm(39.5), Mm(0.6)), + }), }, } }