From 6ad0be5fb36ee6fbb5e360664778450c5bdfe6bb Mon Sep 17 00:00:00 2001 From: Kirill Chibisov Date: Tue, 17 Mar 2020 04:50:12 +0300 Subject: [PATCH] Use font style for fontconfig fallback --- font/src/ft/mod.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/font/src/ft/mod.rs b/font/src/ft/mod.rs index d2a99ca..d393b63 100644 --- a/font/src/ft/mod.rs +++ b/font/src/ft/mod.rs @@ -215,7 +215,6 @@ impl FreeTypeRasterizer { let mut pattern = Pattern::new(); pattern.add_family(&desc.name); pattern.add_pixelsize(size); - let hash = pattern.hash(); // Add style to a pattern match desc.style { @@ -230,6 +229,9 @@ impl FreeTypeRasterizer { }, } + // Hash requested pattern + let hash = pattern.hash(); + pattern.config_substitute(config, fc::MatchKind::Pattern); pattern.default_substitute();