This commit is contained in:
2026-04-07 01:07:12 +03:00
parent bc02bdc82d
commit 672f3297f6
24 changed files with 769 additions and 270 deletions

View File

@@ -8,27 +8,10 @@
#![cfg(not(target_arch = "wasm32"))]
use dreport_core::models::*;
use dreport_layout::{compute_layout, FontData, LayoutResult, ResolvedContent};
use dreport_layout::{compute_layout, LayoutResult, ResolvedContent};
fn load_test_fonts() -> Vec<FontData> {
let font_dir = std::path::Path::new(env!("CARGO_MANIFEST_DIR"))
.parent()
.unwrap()
.join("backend/fonts");
let mut fonts = Vec::new();
for entry in std::fs::read_dir(&font_dir).expect("backend/fonts directory not found") {
let entry = entry.unwrap();
let path = entry.path();
if path.extension().is_some_and(|e| e == "ttf") {
let data = std::fs::read(&path).unwrap();
if let Some(fd) = FontData::from_bytes(data) {
fonts.push(fd);
}
}
}
fonts
}
mod common;
use common::load_test_fonts;
fn base_template() -> Template {
Template {