Loaded and parsed struct of an .sfl file (a bitmap font file).
Some details from the Info-block that are not available in all parsing methods
Some details from the Common-block that are not available in all parsing methods
Hashmap of the characters in the font. <CharID, BMCharacter
>
Load and parse a BMFont
from the given path
, which should be an .sfl file.
use bmfont_parser::{BMFont, Format};
let bmfont = match BMFont::from_path(&Format::SFL, "examples/fonts/iosevka.sfl") {
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.
use bmfont_parser::{BMFont, Format};
let iosevka_sfl = include_str!("../examples/fonts/iosevka.sfl");
let bmfont = match BMFont::from_loaded(&Format::SFL, iosevka_sfl, &["examples/fonts/iosevka.png"]) {
Ok(bmfont) => bmfont,
Err(_) => panic!("Failed to load iosevka.sfl"),
};
println!("bmfont: {}", bmfont);
Performs copy-assignment from source
. Read more
Formats the value using the given formatter. Read more
Formats the value using the given formatter. Read more
Creates owned data from borrowed data, usually by cloning. Read more
🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more
Converts the given value to a String
. Read more
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)
🔬 This is a nightly-only experimental API. (get_type_id
)
this method will likely be replaced by an associated static