pub fn from_loaded<T: Into<String>>(sfl_contents: T, image_path: T) -> Result<BMFont, Error> {
        let mut bmfont = BMFont::load_sfl(sfl_contents)?;

        let mut pathbuf = PathBuf::new();
        pathbuf.push(image_path.into());

        bmfont.image_path = pathbuf;

        Ok(bmfont)
    }
/// Load and parse a `BMFont` from the given `String`, which should be the contents of an .sfl file.
///
/// # Examples
/// ```
/// use sfl_parser::BMFont;
///
/// let iosevka_sfl = include_str!("../examples/fonts/iosevka.sfl");
///
/// let bmfont = match BMFont::from_loaded(iosevka_sfl, "examples/fonts/iosevka.png") {
///     Ok(bmfont) => bmfont,
///     Err(_) => panic!("Failed to load iosevka.sfl"),
/// };
///
/// println!("bmfont: {}", bmfont);
/// ```
Load and parse a `BMFont` from the given `String`, which should be the contents of an .sfl file.
Load and parse a ` BMFont ` from the given ` String ` which should be the contents of an . sfl file .
pub fn from_loaded<T: Into<String>>(sfl_contents: T, image_path: T) -> Result<BMFont, Error> {
        let mut bmfont = BMFont::load_sfl(sfl_contents)?;
        let mut pathbuf = PathBuf::new();
        pathbuf.push(image_path.into());
        bmfont.image_path = pathbuf;
        Ok(bmfont)
    }
pub fn from_loaded < T : Into < String > > ( sfl_contents : T , image_path : T ) -> Result < BMFont , Error > { let mut bmfont = BMFont :: load_sfl ( sfl_contents ) ? ; let mut pathbuf = PathBuf :: new ( ) ; pathbuf . push ( image_path . into ( ) ) ; bmfont . image_path = pathbuf ; Ok ( bmfont ) }
Load and parse a `BMFont` from the given `String`, which should be the contents of an .sfl file.
Load and parse a ` BMFont ` from the given ` String ` which should be the contents of an . sfl file .
sfl_contents
T
image_path
T
sfl_contents
T
image_path
T
examples
```
use sfl_parser::BMFont.

let iosevka_sfl = include_str!("../examples/fonts/iosevka.sfl").

let bmfont = match BMFont::from_loaded(iosevka_sfl, "examples/fonts/iosevka.png") {
Ok(bmfont) => bmfont,
Err(_) => panic!("Failed to load iosevka.sfl"),
}.


` ` ` use sfl_parser :: BMFont . let iosevka_sfl = include_str! ( " .. / examples / fonts / iosevka . sfl " ) . let bmfont = match BMFont :: from_loaded ( iosevka_sfl " examples / fonts / iosevka . png " ) { Ok ( bmfont ) = > bmfont Err ( _ ) = > panic! ( " Failed to load iosevka . sfl " ) } .