mirror of
https://github.com/typst/typst
synced 2025-05-18 11:05:28 +08:00
Fix compilation on unix
This commit is contained in:
parent
e65c2b949c
commit
fbb823964f
14
src/env/fs.rs
vendored
14
src/env/fs.rs
vendored
@ -40,23 +40,23 @@ impl FsLoader {
|
|||||||
/// Search for fonts in the operating system's font directories.
|
/// Search for fonts in the operating system's font directories.
|
||||||
#[cfg(all(unix, not(target_os = "macos")))]
|
#[cfg(all(unix, not(target_os = "macos")))]
|
||||||
pub fn search_system(&mut self) {
|
pub fn search_system(&mut self) {
|
||||||
self.search_dir("/usr/share/fonts");
|
self.search_path("/usr/share/fonts");
|
||||||
self.search_dir("/usr/local/share/fonts");
|
self.search_path("/usr/local/share/fonts");
|
||||||
|
|
||||||
if let Some(dir) = dirs::font_dir() {
|
if let Some(dir) = dirs::font_dir() {
|
||||||
self.search_dir(dir);
|
self.search_path(dir);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Search for fonts in the operating system's font directories.
|
/// Search for fonts in the operating system's font directories.
|
||||||
#[cfg(target_os = "macos")]
|
#[cfg(target_os = "macos")]
|
||||||
pub fn search_system(&mut self) {
|
pub fn search_system(&mut self) {
|
||||||
self.search_dir("/Library/Fonts");
|
self.search_path("/Library/Fonts");
|
||||||
self.search_dir("/Network/Library/Fonts");
|
self.search_path("/Network/Library/Fonts");
|
||||||
self.search_dir("/System/Library/Fonts");
|
self.search_path("/System/Library/Fonts");
|
||||||
|
|
||||||
if let Some(dir) = dirs::font_dir() {
|
if let Some(dir) = dirs::font_dir() {
|
||||||
self.search_dir(dir);
|
self.search_path(dir);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user