build_font

Macro build_font 

Source
macro_rules! build_font {
    (
        path = $path:literal,
        name = $name:ident,
        skip_categories = $skip_categories:literal $(,)?
    ) => { ... };
    (
        path = $path:literal,
        name = $name:ident $(,)?
    ) => { ... };
}
Available on crate feature macros only.
Expand description

Only designed to be used inside build.rs

This macro is used to generate the code for a font file, and set up the build script to rerun if the font file changes.

The generated code will include an enum with all the glyphs in the font, optionally split by category

To include the generated code, see [font_map::include_font]

ยงExample

use font_map::build_font;

fn main() {
    build_font!(
        path = "../examples/slick.ttf",
        name = SlickFont,
        skip_categories = false, /* Can be omitted - if `true`, generate one giant enum instead of a set of categories */
    );
}