diff --git a/src/printer.rs b/src/printer.rs index 6e7bf15..8fc27d6 100644 --- a/src/printer.rs +++ b/src/printer.rs @@ -24,8 +24,9 @@ //! 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 -//! keepsake line, the capture date and time and one of `QUOTES` below it, in -//! German with the English directly underneath. The timestamp is the system +//! keepsake line, the capture date and time and one of `QUOTES` below it. The +//! 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 //! anything. Text goes out in the printer's own code page (PC437), since it //! prints UTF-8 bytes as separate glyphs; see `code_page`. @@ -619,16 +620,16 @@ mod tests { width_bytes: 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[2], KEEPSAKE_DE) && contains_line(&job[2], KEEPSAKE_EN)); assert!(contains_line(&job[2], STAMP)); // 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!(contains_line(&job[5], QUOTES[7][0]) && contains_line(&job[5], QUOTES[7][1])); + assert!(QUOTES[last].iter().all(|line| contains_line(&job[2], line))); + assert!(QUOTES[0].iter().all(|line| contains_line(&job[5], line))); assert!( - encode(&bitmap, &Head::default(), 1, STAMP, QUOTES.len() - 1)[2] - .ends_with(&footer(&Head::default(), STAMP, "ES[QUOTES.len() - 1])[1..]) + job[2].ends_with(&footer(&Head::default(), STAMP, QUOTES[last])[1..]) ); // The real stamp is as wide as the one used here. let now = Local::now().format(STAMP_FORMAT).to_string(); diff --git a/src/quotes.rs b/src/quotes.rs index 58b60c1..7159bf1 100644 --- a/src/quotes.rs +++ b/src/quotes.rs @@ -1,42 +1,9 @@ //! Quotes printed under each photo, one per slip. -/// One is printed per slip, one printed line per entry. The first eight are -/// German with the English underneath; the rest are English only. Each line is -/// short enough for a single 80 mm line (longer quotes are split by hand); on +/// One is printed per slip, one printed line per entry, in English. Each line +/// is short enough for a single 80 mm line (longer quotes are split by hand); on /// 58 mm paper the longer ones wrap. 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. &["Good times, good people."], &["Glad you came."],