feat/more-print-quotes #3
@@ -24,8 +24,9 @@
|
|||||||
//! band and are not stored by the printer (no memory switch writes).
|
//! band and are not stored by the printer (no memory switch writes).
|
||||||
//!
|
//!
|
||||||
//! Each photo is captioned with the event name and place above it, and a
|
//! Each photo is captioned with the event name and place above it, and a
|
||||||
//! keepsake line, the capture date and time and one of `QUOTES` below it, in
|
//! keepsake line, the capture date and time and one of `QUOTES` below it. The
|
||||||
//! German with the English directly underneath. The timestamp is the system
|
//! captions are in German with the English directly underneath, the quotes in
|
||||||
|
//! English only. The timestamp is the system
|
||||||
//! clock in local time, so the booth's clock has to be right for it to mean
|
//! clock in local time, so the booth's clock has to be right for it to mean
|
||||||
//! anything. Text goes out in the printer's own code page (PC437), since it
|
//! anything. Text goes out in the printer's own code page (PC437), since it
|
||||||
//! prints UTF-8 bytes as separate glyphs; see `code_page`.
|
//! prints UTF-8 bytes as separate glyphs; see `code_page`.
|
||||||
@@ -619,16 +620,16 @@ mod tests {
|
|||||||
width_bytes: 1,
|
width_bytes: 1,
|
||||||
data: vec![0; 1],
|
data: vec![0; 1],
|
||||||
};
|
};
|
||||||
let job = encode(&bitmap, &Head::default(), 2, STAMP, 6);
|
let last = QUOTES.len() - 1;
|
||||||
|
let job = encode(&bitmap, &Head::default(), 2, STAMP, last);
|
||||||
assert!(contains_line(&job[0], EVENT_TITLE) && contains_line(&job[0], EVENT_PLACE));
|
assert!(contains_line(&job[0], EVENT_TITLE) && contains_line(&job[0], EVENT_PLACE));
|
||||||
assert!(contains_line(&job[2], KEEPSAKE_DE) && contains_line(&job[2], KEEPSAKE_EN));
|
assert!(contains_line(&job[2], KEEPSAKE_DE) && contains_line(&job[2], KEEPSAKE_EN));
|
||||||
assert!(contains_line(&job[2], STAMP));
|
assert!(contains_line(&job[2], STAMP));
|
||||||
// Consecutive copies get consecutive quotes, wrapping round the list.
|
// Consecutive copies get consecutive quotes, wrapping round the list.
|
||||||
assert!(contains_line(&job[2], QUOTES[6][0]) && contains_line(&job[2], QUOTES[6][1]));
|
assert!(QUOTES[last].iter().all(|line| contains_line(&job[2], line)));
|
||||||
assert!(contains_line(&job[5], QUOTES[7][0]) && contains_line(&job[5], QUOTES[7][1]));
|
assert!(QUOTES[0].iter().all(|line| contains_line(&job[5], line)));
|
||||||
assert!(
|
assert!(
|
||||||
encode(&bitmap, &Head::default(), 1, STAMP, QUOTES.len() - 1)[2]
|
job[2].ends_with(&footer(&Head::default(), STAMP, QUOTES[last])[1..])
|
||||||
.ends_with(&footer(&Head::default(), STAMP, "ES[QUOTES.len() - 1])[1..])
|
|
||||||
);
|
);
|
||||||
// The real stamp is as wide as the one used here.
|
// The real stamp is as wide as the one used here.
|
||||||
let now = Local::now().format(STAMP_FORMAT).to_string();
|
let now = Local::now().format(STAMP_FORMAT).to_string();
|
||||||
|
|||||||
@@ -1,42 +1,9 @@
|
|||||||
//! Quotes printed under each photo, one per slip.
|
//! Quotes printed under each photo, one per slip.
|
||||||
|
|
||||||
/// One is printed per slip, one printed line per entry. The first eight are
|
/// One is printed per slip, one printed line per entry, in English. Each line
|
||||||
/// German with the English underneath; the rest are English only. Each line is
|
/// is short enough for a single 80 mm line (longer quotes are split by hand); on
|
||||||
/// short enough for a single 80 mm line (longer quotes are split by hand); on
|
|
||||||
/// 58 mm paper the longer ones wrap.
|
/// 58 mm paper the longer ones wrap.
|
||||||
pub const QUOTES: &[&[&str]] = &[
|
pub const QUOTES: &[&[&str]] = &[
|
||||||
&[
|
|
||||||
"Analysis bestanden. Wunder gibt es doch.",
|
|
||||||
"Passed Analysis. Miracles do happen.",
|
|
||||||
],
|
|
||||||
&[
|
|
||||||
"Im Freihaus gibt es Kaffee und Hoffnung.",
|
|
||||||
"The Freihaus serves coffee and hope.",
|
|
||||||
],
|
|
||||||
&[
|
|
||||||
"TISS sagt nein. Mein Herz sagt auch nein.",
|
|
||||||
"TISS says no. So does my heart.",
|
|
||||||
],
|
|
||||||
&[
|
|
||||||
"WINF: zwei Fächer, eine Deadline.",
|
|
||||||
"WINF: two subjects, one deadline.",
|
|
||||||
],
|
|
||||||
&[
|
|
||||||
"Karlsplatz: der schönste Umweg zur Uni.",
|
|
||||||
"Karlsplatz: the prettiest detour to class.",
|
|
||||||
],
|
|
||||||
&[
|
|
||||||
"Prüfungswoche: Schlafen ist optional.",
|
|
||||||
"Exam week: sleeping is optional.",
|
|
||||||
],
|
|
||||||
&[
|
|
||||||
"Die Bibliothek kennt alle meine Ausreden.",
|
|
||||||
"The library has heard all my excuses.",
|
|
||||||
],
|
|
||||||
&[
|
|
||||||
"Mathe ist einfach, sagt die Mathematik.",
|
|
||||||
"Maths is easy, says maths.",
|
|
||||||
],
|
|
||||||
// The good times.
|
// The good times.
|
||||||
&["Good times, good people."],
|
&["Good times, good people."],
|
||||||
&["Glad you came."],
|
&["Glad you came."],
|
||||||
|
|||||||
Reference in New Issue
Block a user