# FontProvider The font provider is responsible to provide fonts to the library. Before a font can be used it must be registered. ## Manual font registration Fonts can be registered manually. Provide the name alias ("droid" below) and the font file. ```rust let mut font_provider = FontProvider::new(); font_provider .register("droid", "assets/fonts/DroidSans.ttf") .unwrap(); ``` ## Automatic font registration Given there is a file describing the font registrations, the font provider can be created this way: ```rust let font_provider = FontProvider::from_file("assets/fonts.json"); ``` ## Format of the font registrations file It's a JSON file containing an array of font registrations. ```json [ { "name": "droid", "file": "fonts/DroidSans.ttf" } ] ```