Struct floem_cosmic_text::FontSystem
source · pub struct FontSystem { /* private fields */ }
Expand description
Access system fonts
Implementations§
source§impl FontSystem
impl FontSystem
sourcepub fn new() -> Self
pub fn new() -> Self
Create a new FontSystem
, that allows access to any installed system fonts
§Timing
This function takes some time to run. On the release build, it can take up to a second,
while debug builds can take up to ten times longer. For this reason, it should only be
called once, and the resulting FontSystem
should be shared.
pub fn new_with_fonts(fonts: impl Iterator<Item = Source>) -> Self
sourcepub fn new_with_locale_and_db(locale: String, db: Database) -> Self
pub fn new_with_locale_and_db(locale: String, db: Database) -> Self
Create a new FontSystem
, manually specifying the current locale and font database.
pub fn locale(&self) -> &str
pub fn db(&self) -> &RwLock<Database>
pub fn get_font(&self, id: ID) -> Option<Arc<Font>>
pub fn query(&self, family: &[FamilyOwned], attrs: Attrs<'_>) -> Option<ID>
pub fn query_monospace(&self, attrs: &Attrs<'_>) -> Option<ID>
pub fn face_name(&self, id: ID) -> String
Auto Trait Implementations§
impl !Freeze for FontSystem
impl !RefUnwindSafe for FontSystem
impl Send for FontSystem
impl Sync for FontSystem
impl Unpin for FontSystem
impl !UnwindSafe for FontSystem
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