pub struct FontPropertyBuilder { /* private fields */ }
Expand description
Builder for FontProperty
Implementations§
Source§impl FontPropertyBuilder
impl FontPropertyBuilder
Sourcepub fn new() -> FontPropertyBuilder
pub fn new() -> FontPropertyBuilder
Examples found in repository?
examples/list-fonts.rs (line 30)
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
fn main() {
// Enumerate all fonts
let sysfonts = system_fonts::query_all();
for string in &sysfonts {
println!("{}", string);
}
let mut property = system_fonts::FontPropertyBuilder::new().monospace().build();
let sysfonts = system_fonts::query_specific(&mut property);
for string in &sysfonts {
println!("Monospaced font: {}", string);
}
let property = system_fonts::FontPropertyBuilder::new().family("Arial").build();
let (font, _) = system_fonts::get(&property).unwrap();
println!("{:?}", &font[..50]);
}
pub fn italic(self) -> FontPropertyBuilder
pub fn oblique(self) -> FontPropertyBuilder
pub fn bold(self) -> FontPropertyBuilder
Sourcepub fn monospace(self) -> FontPropertyBuilder
pub fn monospace(self) -> FontPropertyBuilder
Examples found in repository?
examples/list-fonts.rs (line 30)
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
fn main() {
// Enumerate all fonts
let sysfonts = system_fonts::query_all();
for string in &sysfonts {
println!("{}", string);
}
let mut property = system_fonts::FontPropertyBuilder::new().monospace().build();
let sysfonts = system_fonts::query_specific(&mut property);
for string in &sysfonts {
println!("Monospaced font: {}", string);
}
let property = system_fonts::FontPropertyBuilder::new().family("Arial").build();
let (font, _) = system_fonts::get(&property).unwrap();
println!("{:?}", &font[..50]);
}
Sourcepub fn family(self, name: &str) -> FontPropertyBuilder
pub fn family(self, name: &str) -> FontPropertyBuilder
Examples found in repository?
examples/list-fonts.rs (line 36)
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
fn main() {
// Enumerate all fonts
let sysfonts = system_fonts::query_all();
for string in &sysfonts {
println!("{}", string);
}
let mut property = system_fonts::FontPropertyBuilder::new().monospace().build();
let sysfonts = system_fonts::query_specific(&mut property);
for string in &sysfonts {
println!("Monospaced font: {}", string);
}
let property = system_fonts::FontPropertyBuilder::new().family("Arial").build();
let (font, _) = system_fonts::get(&property).unwrap();
println!("{:?}", &font[..50]);
}
Sourcepub fn build(self) -> FontProperty
pub fn build(self) -> FontProperty
Examples found in repository?
examples/list-fonts.rs (line 30)
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
fn main() {
// Enumerate all fonts
let sysfonts = system_fonts::query_all();
for string in &sysfonts {
println!("{}", string);
}
let mut property = system_fonts::FontPropertyBuilder::new().monospace().build();
let sysfonts = system_fonts::query_specific(&mut property);
for string in &sysfonts {
println!("Monospaced font: {}", string);
}
let property = system_fonts::FontPropertyBuilder::new().family("Arial").build();
let (font, _) = system_fonts::get(&property).unwrap();
println!("{:?}", &font[..50]);
}
Auto Trait Implementations§
impl Freeze for FontPropertyBuilder
impl RefUnwindSafe for FontPropertyBuilder
impl Send for FontPropertyBuilder
impl Sync for FontPropertyBuilder
impl Unpin for FontPropertyBuilder
impl UnwindSafe for FontPropertyBuilder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more