From 3fdac6cb82368885b9d451e121558b7577dbeeb8 Mon Sep 17 00:00:00 2001 From: Yevhenii Reizner Date: Sun, 1 Oct 2023 08:16:14 +0300 Subject: [PATCH] Enable the `fontconfig` feature by default. Closes #56 --- Cargo.toml | 12 ++++++++---- src/lib.rs | 1 + 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 55debe5..93084c1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -30,8 +30,12 @@ fontconfig-parser = { version = "0.5", optional = true, default-features = false env_logger = { version = "0.9", default-features = false } # 0.10 requires Rust 1.60+ [features] -default = ["fs", "memmap", "std"] -fontconfig = ["fontconfig-parser", "fs"] -fs = ["std"] # allows local filesystem interactions -memmap = ["fs", "memmap2"] # allows font files memory mapping, greatly improves performance +default = ["std", "fs", "memmap", "fontconfig"] std = ["ttf-parser/std"] +# Allows local filesystem interactions. +fs = ["std"] +# Allows font files memory mapping, greatly improves performance. +memmap = ["fs", "memmap2"] +# Enables minimal fontconfig support on Linux. +# Must be enabled for NixOS, otherwise no fonts will be loaded. +fontconfig = ["fontconfig-parser", "fs"] diff --git a/src/lib.rs b/src/lib.rs index b071b59..2b489cf 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -410,6 +410,7 @@ impl Database { } } + // Linux. #[cfg(all( unix, feature = "fontconfig",