1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
//! HTTP handler for `GET /api/fonts`.
//!
//! Returns the list of TrueType fonts discovered at startup under the
//! configured `fonts_directory`. The render form's font dropdown
//! populates from this endpoint.
use Json;
use State;
use Serialize;
use crateCurrentUser;
use crateError;
use crateFontInfo;
use crateAppState;
/// Response body for `GET /api/fonts`.
/// `GET /api/fonts` — list discoverable fonts. Session + CSRF gated
/// alongside the other library routes so unauthenticated clients
/// cannot probe the configured directory.
///
/// # Errors
///
/// Returns the underlying [`Error`] only if the auth extractor
/// rejects the request; the font list itself is in memory and cannot
/// fail.
pub async