label: Rename IdTextConfig to TextConfig
It is not specific to IDs.
This commit is contained in:
parent
ebbc5c0c19
commit
1a9f0f2e7d
|
@ -58,8 +58,8 @@ pub struct LabelConfig {
|
||||||
height: Mm,
|
height: Mm,
|
||||||
data_matrix: Option<DataMatrixConfig>,
|
data_matrix: Option<DataMatrixConfig>,
|
||||||
code128: Option<Code128Config>,
|
code128: Option<Code128Config>,
|
||||||
id_text: Option<IdTextConfig>,
|
id_text: Option<TextConfig>,
|
||||||
short_id_text: Option<IdTextConfig>,
|
short_id_text: Option<TextConfig>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
|
@ -120,12 +120,12 @@ impl Code128Config {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct IdTextConfig {
|
pub struct TextConfig {
|
||||||
font_size: f32,
|
font_size: f32,
|
||||||
position: (Mm, Mm),
|
position: (Mm, Mm),
|
||||||
}
|
}
|
||||||
|
|
||||||
impl IdTextConfig {
|
impl TextConfig {
|
||||||
fn draw<S: Into<String>>(
|
fn draw<S: Into<String>>(
|
||||||
&self,
|
&self,
|
||||||
layer: &PdfLayerReference,
|
layer: &PdfLayerReference,
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
use printpdf::Mm;
|
use printpdf::Mm;
|
||||||
use serde::Deserialize;
|
use serde::Deserialize;
|
||||||
|
|
||||||
use super::{Code128Config, DataMatrixConfig, IdTextConfig, LabelConfig};
|
use super::{Code128Config, DataMatrixConfig, LabelConfig, TextConfig};
|
||||||
|
|
||||||
#[derive(Clone, Debug, Deserialize)]
|
#[derive(Clone, Debug, Deserialize)]
|
||||||
#[serde(rename_all = "kebab-case")]
|
#[serde(rename_all = "kebab-case")]
|
||||||
|
@ -27,7 +27,7 @@ impl Into<LabelConfig> for LabelPreset {
|
||||||
position: (Mm(0.0), Mm(0.0)),
|
position: (Mm(0.0), Mm(0.0)),
|
||||||
}),
|
}),
|
||||||
code128: None,
|
code128: None,
|
||||||
id_text: Some(IdTextConfig {
|
id_text: Some(TextConfig {
|
||||||
font_size: 7.0,
|
font_size: 7.0,
|
||||||
position: (Mm(0.0), Mm(22.0)),
|
position: (Mm(0.0), Mm(22.0)),
|
||||||
}),
|
}),
|
||||||
|
@ -41,11 +41,11 @@ impl Into<LabelConfig> for LabelPreset {
|
||||||
scale: (Mm(44.45), Mm(19.0)),
|
scale: (Mm(44.45), Mm(19.0)),
|
||||||
position: (Mm(0.0), Mm(2.5)),
|
position: (Mm(0.0), Mm(2.5)),
|
||||||
}),
|
}),
|
||||||
id_text: Some(IdTextConfig {
|
id_text: Some(TextConfig {
|
||||||
font_size: 7.0,
|
font_size: 7.0,
|
||||||
position: (Mm(0.0), Mm(22.0)),
|
position: (Mm(0.0), Mm(22.0)),
|
||||||
}),
|
}),
|
||||||
short_id_text: Some(IdTextConfig {
|
short_id_text: Some(TextConfig {
|
||||||
font_size: 7.0,
|
font_size: 7.0,
|
||||||
position: (Mm(0.0), Mm(0.0)),
|
position: (Mm(0.0), Mm(0.0)),
|
||||||
}),
|
}),
|
||||||
|
@ -61,11 +61,11 @@ impl Into<LabelConfig> for LabelPreset {
|
||||||
scale: (Mm(27.45), Mm(16.0)),
|
scale: (Mm(27.45), Mm(16.0)),
|
||||||
position: (Mm(17.0), Mm(4.0)),
|
position: (Mm(17.0), Mm(4.0)),
|
||||||
}),
|
}),
|
||||||
id_text: Some(IdTextConfig {
|
id_text: Some(TextConfig {
|
||||||
font_size: 7.0,
|
font_size: 7.0,
|
||||||
position: (Mm(0.0), Mm(22.0)),
|
position: (Mm(0.0), Mm(22.0)),
|
||||||
}),
|
}),
|
||||||
short_id_text: Some(IdTextConfig {
|
short_id_text: Some(TextConfig {
|
||||||
font_size: 7.0,
|
font_size: 7.0,
|
||||||
position: (Mm(17.0), Mm(0.0)),
|
position: (Mm(17.0), Mm(0.0)),
|
||||||
}),
|
}),
|
||||||
|
|
Loading…
Reference in a new issue