Move font matching to Attrs
This commit is contained in:
parent
324c8837fd
commit
085231c153
2 changed files with 17 additions and 15 deletions
|
|
@ -45,4 +45,12 @@ impl<'a> Attrs<'a> {
|
|||
self.weight = weight;
|
||||
self
|
||||
}
|
||||
|
||||
pub fn matches(&self, face: &fontdb::FaceInfo) -> bool {
|
||||
face.style == self.style &&
|
||||
face.weight == self.weight &&
|
||||
face.stretch == self.stretch &&
|
||||
//TODO: smarter way of including emoji
|
||||
(face.monospaced == self.monospaced || face.post_script_name.contains("Emoji"))
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue