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)
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}
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)
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}
Sourcepub fn family(self, name: &str) -> FontPropertyBuilder
pub fn family(self, name: &str) -> FontPropertyBuilder
Examples found in repository?
examples/list-fonts.rs (line 36)
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}
Sourcepub fn build(self) -> FontProperty
pub fn build(self) -> FontProperty
Examples found in repository?
examples/list-fonts.rs (line 30)
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}
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