/// generate FIGlet font from string literal
generate FIGlet font from string literal
generate FIGlet font from string literal
pub fn from_content(contents: &str) -> Result<FIGfont, String> {
        let lines: Vec<&str> = contents.lines().collect();
        if lines.is_empty() {
            return Err("can not generate FIGlet font from empty string".to_string());
        }
        let header_line = FIGfont::read_header_line(&lines.get(0).unwrap())?;
        let comments = FIGfont::read_comments(&lines, header_line.comment_lines)?;
        let fonts = FIGfont::read_fonts(&lines, &header_line)?;
        Ok(FIGfont {
            header_line,
            comments,
            fonts,
        })
    }
pub fn from_content ( contents : & str ) -> Result < FIGfont , String > { let lines : Vec < & str > = contents . lines ( ) . collect ( ) ; if lines . is_empty ( ) { return Err ( " " . to_string ( ) ) ; } let header_line = FIGfont :: read_header_line ( & lines . get ( 0 ) . unwrap ( ) ) ? ; let comments = FIGfont :: read_comments ( & lines , header_line . comment_lines ) ? ; let fonts = FIGfont :: read_fonts ( & lines , & header_line ) ? ; Ok ( FIGfont { header_line , comments , fonts , } ) }
generate FIGlet font from string literal
generate FIGlet font from string literal
contents
&str