Function get

Source
pub fn get(config: &FontProperty) -> Option<(Vec<u8>, c_int)>
Expand description

Get the binary data and index of a specific font

Examples found in repository?
examples/list-fonts.rs (line 37)
23fn main() {
24	// Enumerate all fonts
25    let sysfonts = system_fonts::query_all();
26    for string in &sysfonts {
27        println!("{}", string);
28    }
29
30	let mut property = system_fonts::FontPropertyBuilder::new().monospace().build();
31	let sysfonts = system_fonts::query_specific(&mut property);
32	for string in &sysfonts {
33		println!("Monospaced font: {}", string);
34	}
35
36	let property = system_fonts::FontPropertyBuilder::new().family("Arial").build();
37	let (font, _) = system_fonts::get(&property).unwrap();
38	println!("{:?}", &font[..50]);
39}