sfl_parser

Crates.iosfl_parser
lib.rssfl_parser
version1.3.1
sourcesrc
created_at2018-03-10 22:07:49.195655
updated_at2019-01-15 21:14:32.026065
descriptionLightweight and easy-to-use bitmap font (.sfl) parser
homepage
repositoryhttps://github.com/Teascade/sfl_parser
max_upload_size
id54916
size27,675
Sofia Talarmo (Teascade)

documentation

https://docs.rs/sfl_parser

README

sfl_parser

Build Status Docs Crates.io

sfl_parser has permanently moved to bmfont_parser, as the name has grown inaccurate to the functionality of this crate

A lightweight and easy-to-use .sfl file (bitmap font) parser made with Rust.

How to use

Documentation at docs.rs or simply:

  1. Add the following to your dependencies:
    [dependencies]
    sfl_parser="1.3"
    
  2. To your Rust project add the following line:
    extern crate sfl_parser;
    
  3. You're done! Here is an example of how to use it:
     use sfl_parser::BMFont;
    
     let bmfont = match BMFont::from_path("examples/fonts/iosevka.sfl") {
         Ok(bmfont) => bmfont,
         Err(_) => panic!("Failed to load iosevka.sfl"),
     };
    
     println!("bmfont: {}", bmfont);
    
     // Or Alternatively
    
     let iosevka_sfl = include_str!("examples/fonts/iosevka.sfl");
    
     let bmfont = match BMFont::from_loaded(iosevka_sfl, "examples/fonts/iosevka.sfl") {
         Ok(bmfont) => bmfont,
         Err(_) => panic!("Failed to load iosevka.sfl"),
     };
    
     println!("bmfont: {}", bmfont);
    

License

This crate is distributed under the terms of the MIT License.

Commit count: 24

cargo fmt