fonts: suppress error when a font is not found in font_dirs
... and the font locator will use a system locator as a follow up.
This commit is contained in:
1 parent
7783d124e5
commit
01f50102ab
2 files changed
+4
-3
No files matched your search
@@ -54,7 +54,7 @@ pub trait FontLocator {
|
||||
-> anyhow::Result<Vec<FontDataHandle>>;
|
||||
}
|
||||
|
||||
#[derive(Debug, Deserialize, Clone, Copy)]
|
||||
#[derive(Debug, Deserialize, Clone, Copy, PartialEq, Eq)]
|
||||
pub enum FontLocatorSelection {
|
||||
/// Use fontconfig APIs to resolve fonts (!macos, posix systems)
|
||||
FontConfig,
|
||||
|
||||
+3
-2
@@ -3,7 +3,7 @@
|
||||
//! but in the future I'd like to use its shaping functionality
|
||||
#![allow(dead_code)]
|
||||
use crate::config::{Config, FontAttributes};
|
||||
use crate::font::locator::FontDataHandle;
|
||||
use crate::font::locator::{FontDataHandle, FontLocatorSelection};
|
||||
use crate::font::shaper::{FallbackIdx, FontMetrics, GlyphInfo};
|
||||
use crate::font::units::*;
|
||||
use allsorts::binary::read::{ReadScope, ReadScopeOwned};
|
||||
@@ -119,7 +119,8 @@ impl ParsedFont {
|
||||
break;
|
||||
}
|
||||
}
|
||||
if !found {
|
||||
if !found && FontLocatorSelection::get_default() != FontLocatorSelection::ConfigDirsOnly
|
||||
{
|
||||
log::error!("Did not locate a font match for {:?}", attr);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user