From 40175aac109a9d1034865d1452384bb71a16b6de Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Thu, 27 Oct 2022 08:25:30 -0600 Subject: [PATCH] Always match emoji regardless of attributes --- src/attrs.rs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/attrs.rs b/src/attrs.rs index 4e8bf01..37ad31f 100644 --- a/src/attrs.rs +++ b/src/attrs.rs @@ -74,11 +74,14 @@ impl<'a> Attrs<'a> { } 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")) + face.post_script_name.contains("Emoji") || + ( + face.style == self.style && + face.weight == self.weight && + face.stretch == self.stretch && + face.monospaced == self.monospaced + ) } pub fn compatible(&self, other: &Self) -> bool {