Files
dreport/backend/src/typst_engine/fonts.rs
2026-03-29 05:11:22 +03:00

18 lines
539 B
Rust
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
use std::path::PathBuf;
use typst_kit::fonts::{FontSearcher, Fonts};
/// Proje fontlarını yükler (backend/fonts/ dizininden).
/// Uygulama başlangıcında bir kez çağrılır ve paylaşılır.
pub fn load_fonts() -> Fonts {
let font_dir = font_dir();
FontSearcher::new()
.include_system_fonts(false)
.search_with(&[font_dir])
}
fn font_dir() -> PathBuf {
// Cargo manifest dizinine göre fonts/ klasörü
let manifest_dir = env!("CARGO_MANIFEST_DIR");
PathBuf::from(manifest_dir).join("fonts")
}