From f92b2f66402fce1eb607dea26cc71eed8bf8d928 Mon Sep 17 00:00:00 2001 From: Profpatsch Date: Tue, 5 Oct 2021 11:26:43 +0200 Subject: pkgs/profpatsch/text-letter: generate PDF with monospace font This uses the system monospace font to generate a PDF. Before the printer would be sent a .txt, and it varies from printer to printer how plain text files are typeset (if at all). Now it only depends on the system monospace font, which is SourceCode Pro in my case (obvious TODO is to fix that sometime, or make it configurable). --- pkgs/profpatsch/text-letter.nix | 11 ++++++++++- pkgs/profpatsch/text-letter.rs | 8 -------- 2 files changed, 10 insertions(+), 9 deletions(-) (limited to 'pkgs/profpatsch') diff --git a/pkgs/profpatsch/text-letter.nix b/pkgs/profpatsch/text-letter.nix index f12f0ff2..987bc8dd 100644 --- a/pkgs/profpatsch/text-letter.nix +++ b/pkgs/profpatsch/text-letter.nix @@ -1,7 +1,9 @@ { pkgs, rust-deps, writeRustSimple, writeExecline, getBins }: let - bins = getBins pkgs.coreutils [ "date" "cat" ]; + bins = getBins pkgs.coreutils [ "date" "cat" ] + // getBins pkgs.paps [ "paps" ] + // getBins pkgs.ghostscript [ "ps2pdf" ]; mustache-interpol = writeRustSimple "mustache-interpol" { dependencies = [ @@ -16,9 +18,16 @@ let mustache-interpol ]; + text-letter-pdf = writeExecline "write-letter-pdf" {} [ + "pipeline" [ text-letter ] + "pipeline" [ bins.paps "--encoding=utf8" ] + bins.ps2pdf "-" + ]; + in { inherit mustache-interpol text-letter + text-letter-pdf ; } diff --git a/pkgs/profpatsch/text-letter.rs b/pkgs/profpatsch/text-letter.rs index 55921adc..1ff3bdf8 100644 --- a/pkgs/profpatsch/text-letter.rs +++ b/pkgs/profpatsch/text-letter.rs @@ -83,10 +83,6 @@ fn main() { - - - - {{{from_address_one_line}}} {{{an}}} @@ -96,10 +92,6 @@ fn main() { - - - - {{content}} "### ).expect("the template is malformed"); -- cgit 1.4.1