to_yaff_string

Function to_yaff_string 

Source
pub fn to_yaff_string(font: &YaffFont) -> String
Examples found in repository?
examples/test.rs (line 13)
3fn main() {
4    let path_in = std::env::args()
5        .nth(1)
6        .expect("Please provide an input file path as the first argument");
7    let path_out = std::env::args()
8        .nth(2)
9        .expect("Please provide an output file path as the second argument");
10    let path_in2 = path_in.clone();
11    match YaffFont::from_path(path_in) {
12        Ok(font) => {
13            let yaff_string = to_yaff_string(&font);
14            std::fs::write(path_out, yaff_string).expect("Unable to write file");
15        }
16        Err(e) => {
17            eprintln!("Failed to parse YAFF data from file {}: {:?}", path_in2, e);
18            std::process::exit(1);
19        }
20    }
21}