Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ libloading = "0.9"
epoxy = "0.1.0"
glow = "0.17.0"
resource = "0.6.1" # font emedding
fontconfig = "0.10.2" # font loading
fontconfig = "0.11.0" # font loading
keycode = "1.0.0"

[dependencies.relm4-icons]
Expand Down
9 changes: 6 additions & 3 deletions src/femtovg_area/imp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -214,10 +214,13 @@ impl FemtoVGArea {
let fontconfig = Fontconfig::new();

let mut load_font = |family: &str, style: Option<&str>| -> Result<FontId> {
let font = fontconfig
let fc = fontconfig
.as_ref()
.and_then(|fc| fc.find(family, style))
.ok_or_else(|| anyhow::anyhow!("Font family '{}' not found", family))?;
.ok_or(anyhow::anyhow!("Could not initialize Fontconfig"))?;

let font = fc
.find(family, style)
.map_err(|e| anyhow::anyhow!("Font family '{}' not found: {}", family, e))?;

let face_index = font.index.unwrap_or(0).max(0) as u32;

Expand Down
Loading