Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch from dirs-next to dirs and release a new version #248

Merged
merged 1 commit into from
Jul 18, 2024
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.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "font-kit"
version = "0.14.0"
version = "0.14.1"
authors = ["Patrick Walton <[email protected]>"]
description = "A cross-platform font loading library"
license = "MIT OR Apache-2.0"
Expand Down Expand Up @@ -63,7 +63,7 @@ freetype-sys = "0.20"
yeslogic-fontconfig-sys = "6.0"

[target.'cfg(not(any(target_arch = "wasm32", target_family = "windows", target_os = "android", target_env = "ohos")))'.dependencies]
dirs-next = "2.0"
dirs = "5.0"

[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
walkdir = "2.1"
8 changes: 4 additions & 4 deletions src/sources/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ use std::path::{Path, PathBuf};
use walkdir::WalkDir;

#[cfg(not(any(target_os = "android", target_family = "windows", target_env = "ohos")))]
use dirs_next;
use dirs;
#[cfg(target_family = "windows")]
use std::ffi::OsString;
#[cfg(target_family = "windows")]
Expand Down Expand Up @@ -203,7 +203,7 @@ fn default_font_directories() -> Vec<PathBuf> {
PathBuf::from("/Library/Fonts"),
PathBuf::from("/Network/Library/Fonts"),
];
if let Some(mut path) = dirs_next::home_dir() {
if let Some(mut path) = dirs::home_dir() {
path.push("Library");
path.push("Fonts");
directories.push(path);
Expand All @@ -224,11 +224,11 @@ fn default_font_directories() -> Vec<PathBuf> {
PathBuf::from("/var/run/host/usr/share/fonts"), // Flatpak specific
PathBuf::from("/var/run/host/usr/local/share/fonts"),
];
if let Some(path) = dirs_next::home_dir() {
if let Some(path) = dirs::home_dir() {
directories.push(path.join(".fonts")); // ~/.fonts is deprecated
directories.push(path.join("local").join("share").join("fonts")); // Flatpak specific
}
if let Some(mut path) = dirs_next::data_dir() {
if let Some(mut path) = dirs::data_dir() {
path.push("fonts");
directories.push(path);
}
Expand Down