fmt
Some checks failed
CI / rust (push) Successful in 47s
CI / frontend (push) Failing after 10s
CI / wasm (push) Successful in 1m45s
CI / publish-crates (push) Successful in 23s
CI / publish-npm (push) Has been skipped

This commit is contained in:
2026-04-07 01:45:38 +03:00
parent b6aecc5f12
commit 603624724c
28 changed files with 1674 additions and 784 deletions

View File

@@ -1,10 +1,9 @@
use axum::{
Router,
Json, Router,
extract::{Path, State},
http::{StatusCode, header},
response::IntoResponse,
routing::get,
Json,
};
use dreport_layout::font_provider::FontProvider;
use serde::Serialize;
@@ -25,15 +24,14 @@ struct FontVariantResponse {
}
/// GET /api/fonts — list all available font families
async fn list_fonts(
State(registry): State<Arc<FontRegistry>>,
) -> Json<Vec<FontFamilyResponse>> {
async fn list_fonts(State(registry): State<Arc<FontRegistry>>) -> Json<Vec<FontFamilyResponse>> {
let families = registry.list_families();
let response: Vec<FontFamilyResponse> = families
.into_iter()
.map(|f| FontFamilyResponse {
family: f.family,
variants: f.variants
variants: f
.variants
.into_iter()
.map(|v| FontVariantResponse {
weight: v.weight,

View File

@@ -1,4 +1,4 @@
use axum::{Router, routing::get, Json};
use axum::{Json, Router, routing::get};
use serde::Serialize;
use std::sync::Arc;

View File

@@ -1,10 +1,9 @@
use axum::{
Router,
Json, Router,
extract::State,
http::{StatusCode, header},
response::IntoResponse,
routing::post,
Json,
};
use serde::Deserialize;
use std::sync::Arc;