From eabbbf7eae04a4a8044d83acde84d8634f095b50 Mon Sep 17 00:00:00 2001 From: Laurenz Date: Sun, 22 Jan 2023 13:16:03 +0100 Subject: Name handling for New Computer Modern Math --- src/font/book.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/font') diff --git a/src/font/book.rs b/src/font/book.rs index dfc6140c..25b1fc85 100644 --- a/src/font/book.rs +++ b/src/font/book.rs @@ -299,7 +299,7 @@ fn decode_mac_roman(coded: &[u8]) -> String { coded.iter().copied().map(char_from_mac_roman).collect() } -/// Trim style naming from a family name. +/// Trim style naming from a family name and fix bad names. fn typographic_family(mut family: &str) -> &str { // Separators between names, modifiers and styles. const SEPARATORS: [char; 3] = [' ', '-', '_']; @@ -349,7 +349,11 @@ fn typographic_family(mut family: &str) -> &str { } } - &family[..len] + // Fix bad names. + match &family[..len] { + "NewComputerModernMath" => "New Computer Modern Math", + other => other, + } } /// How many words the two strings share in their prefix. -- cgit v1.2.3