mirror of
https://github.com/storytold/deckcraft.git
synced 2026-11-10 20:39:36 -06:00
address review: no catalog loading for loaded families when system fallback is off
This commit is contained in:
@@ -170,7 +170,13 @@ impl FontDb {
|
||||
continue;
|
||||
}
|
||||
if self.is_loaded(fam) || (self.system_fallback_enabled() && self.has_family(fam)) {
|
||||
let f = self.face(fam, style);
|
||||
// With system fallback off, only a face that is already loaded: `face` could load more catalog files.
|
||||
let f = if self.system_fallback_enabled() {
|
||||
self.face(fam, style)
|
||||
} else {
|
||||
let Some(f) = self.find(fam, style) else { continue };
|
||||
f
|
||||
};
|
||||
if f.family.eq_ignore_ascii_case(fam) && covers_cluster(&f, cluster) {
|
||||
return f;
|
||||
}
|
||||
|
||||
@@ -1294,7 +1294,7 @@ impl FontDb {
|
||||
Some(f)
|
||||
}
|
||||
|
||||
fn find(&self, family: &str, style: &str) -> Option<Arc<FontFace>> {
|
||||
pub(crate) fn find(&self, family: &str, style: &str) -> Option<Arc<FontFace>> {
|
||||
if style.contains('{') {
|
||||
{
|
||||
let faces = self.read_faces();
|
||||
|
||||
Reference in New Issue
Block a user