pub struct FontCollection { /* private fields */ }
Expand description
A collection of fonts
Implementations§
Source§impl FontCollection
impl FontCollection
Sourcepub fn new() -> FontCollection
pub fn new() -> FontCollection
Examples found in repository?
examples/render.rs (line 186)
185fn make_collection() -> FontCollection {
186 let mut collection = FontCollection::new();
187 let source = SystemSource::new();
188 let font = source
189 .select_best_match(&[FamilyName::SansSerif], &Properties::new())
190 .unwrap()
191 .load()
192 .unwrap();
193 collection.add_family(FontFamily::new_from_font(font));
194
195 let font = source
196 .select_by_postscript_name(DEVANAGARI_FONT_POSTSCRIPT_NAME)
197 .expect("failed to select Devanagari font")
198 .load()
199 .unwrap();
200 collection.add_family(FontFamily::new_from_font(font));
201
202 collection
203}
Sourcepub fn add_family(&mut self, family: FontFamily)
pub fn add_family(&mut self, family: FontFamily)
Examples found in repository?
examples/render.rs (line 193)
185fn make_collection() -> FontCollection {
186 let mut collection = FontCollection::new();
187 let source = SystemSource::new();
188 let font = source
189 .select_best_match(&[FamilyName::SansSerif], &Properties::new())
190 .unwrap()
191 .load()
192 .unwrap();
193 collection.add_family(FontFamily::new_from_font(font));
194
195 let font = source
196 .select_by_postscript_name(DEVANAGARI_FONT_POSTSCRIPT_NAME)
197 .expect("failed to select Devanagari font")
198 .load()
199 .unwrap();
200 collection.add_family(FontFamily::new_from_font(font));
201
202 collection
203}
pub fn itemize<'a>(&'a self, text: &'a str) -> Itemizer<'a>
Auto Trait Implementations§
impl Freeze for FontCollection
impl RefUnwindSafe for FontCollection
impl !Send for FontCollection
impl !Sync for FontCollection
impl Unpin for FontCollection
impl UnwindSafe for FontCollection
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