INNER CODE UNIT · Rust

insert_pem_text

matiaskorhonen/paper-age · src/builder.rs:142

    pub fn insert_pem_text(&mut self, pem: String) {
        debug!("Inserting PEM encoded ciphertext");

        let mut font_size = 13.0;
        let mut line_height = 15.0;

        // Rudimentary text scaling to get the Ascii Armor text to fit
        if pem.lines().count() > 42 {
            font_size = 6.5;
            line_height = 7.0;
        } else if pem.lines().count() > 39 {
            font_size = 7.0;
            line_height = 8.0;
        } else if pem.lines().count() > 27 {
            font_size = 8.0;
            line_height = 9.0;
        } else if pem.lines().count() > 22 {
            font_size = 10.0;

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…