pub struct FontConf { /* private fields */ }Expand description
generic families, substitutes and language choices (see the module header)
Implementations§
Source§impl FontConf
impl FontConf
pub fn new() -> FontConf
Sourcepub fn load(&mut self, path: &str) -> bool
pub fn load(&mut self, path: &str) -> bool
add the rules of a fontconfig file (and of what it includes) -> it could be read
Sourcepub fn parse(&mut self, text: &str, dir: &str) -> usize
pub fn parse(&mut self, text: &str, dir: &str) -> usize
add the rules of fontconfig text (includes relative to dir) -> rules found
Sourcepub fn add_alias(
&mut self,
family: &str,
prefer: &[&str],
accept: &[&str],
default: &[&str],
)
pub fn add_alias( &mut self, family: &str, prefer: &[&str], accept: &[&str], default: &[&str], )
add an alias: prefer before the family, accept after it, default at the end
Sourcepub fn add_lang(
&mut self,
lang: Option<&str>,
family: Option<&str>,
mode: u8,
families: &[&str],
)
pub fn add_lang( &mut self, lang: Option<&str>, family: Option<&str>, mode: u8, families: &[&str], )
add a language rule (lang None: every language; family None: every family)
Sourcepub fn candidates(&self, family: &str, lang: &str) -> Vec<String>
pub fn candidates(&self, family: &str, lang: &str) -> Vec<String>
the families to try for a name in a language, best first (each once; generic names stay in the list where they stand)
Sourcepub fn lang_families(&self, lang: &str) -> Vec<String>
pub fn lang_families(&self, lang: &str) -> Vec<String>
the families a language adds to sans-serif (fallback.rs tries them first)
Trait Implementations§
Auto Trait Implementations§
impl Forget for FontConf
impl Freeze for FontConf
impl RefUnwindSafe for FontConf
impl Send for FontConf
impl Sync for FontConf
impl Unpin for FontConf
impl UnsafeUnpin for FontConf
impl UnwindSafe for FontConf
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