The font family returned by fontique for the Hani script is Yu Gothic UI on Windows, which does not have the character 汉. The character is in Microsoft YaHei UI, which is not returned at all.
Reproduction:
use fontique::{Collection, FallbackKey, Script, SourceCache};
let mut collection = Collection::default();
let mut source_cache = SourceCache::default();
let family_ids: Vec<_> = collection
.fallback_families(FallbackKey::new(Script::from_bytes(*b"Hani"), None))
.collect();
let family_names: Vec<_> = family_ids
.iter()
.map(|&id| collection.family_name(id).unwrap().to_owned())
.collect();
println!("fallback families: {family_names:?}");
let family_id = family_ids[0];
let family_name = collection.family_name(family_id).unwrap().to_owned();
let family = collection.family(family_id).unwrap();
let font = family.default_font().unwrap();
let data = font.load(Some(&mut source_cache)).unwrap();
let charmap = font.charmap_index().charmap(data.as_ref()).unwrap();
println!("{family_name}: 汉 -> {:?}", charmap.map('汉'));
The problematic line seems to be here, which doesn't contain enough characters for more coverage:
|
(Script::from_str_unchecked("Hani"), "今"), |
though apparently for DirectWrite only a single font is queried anyway, so it wouldn't be the only thing that needs to be fixed.
|
fn family_name_for_text(&mut self, text: &str, locale: Option<&str>) -> Option<String> { |
The font family returned by fontique for the
Haniscript isYu Gothic UIon Windows, which does not have the character汉. The character is inMicrosoft YaHei UI, which is not returned at all.Reproduction:
The problematic line seems to be here, which doesn't contain enough characters for more coverage:
parley/fontique/src/script.rs
Line 112 in 8294d3e
though apparently for DirectWrite only a single font is queried anyway, so it wouldn't be the only thing that needs to be fixed.
parley/fontique/src/backend/dwrite.rs
Line 200 in 8294d3e