forge_primitives/client.rs
1//! The `[client]` section of `forge.toml`.
2
3use serde::Deserialize;
4
5/// The `[client]` block of `forge.toml`: which of the sets forge ships a
6/// client draws with. The server carries these to a client on connect,
7/// so a client never reads `forge.toml` itself.
8#[derive(Debug, Clone, Default, Deserialize)]
9#[serde(default, deny_unknown_fields)]
10pub struct ClientConfig {
11 /// The mark, by name from [`MARK_NAMES`]. `None` is the built-in,
12 /// never a pinned value: a commented line in a hand-authored
13 /// `forge.toml` has to mean "unset".
14 pub mark: Option<String>,
15 /// The palette, by name from [`THEME_NAMES`].
16 pub theme: Option<String>,
17 /// The typefaces, by name from [`FONT_NAMES`]. `None` is the built-in
18 /// face - Fira Code for prose and code alike - shipped beside the view
19 /// rather than left to whatever the OS has.
20 pub font: Option<String>,
21}
22
23/// The marks forge ships, by the name `[client] mark` takes - a bounded set
24/// rather than a path, so every option is one forge has drawn.
25pub const MARK_NAMES: &[&str] = &[
26 "panes",
27 "klin",
28 "lanes",
29 "f_slab",
30 "split",
31 "spine",
32 "grid",
33 "clamp",
34 "strike",
35 "nest",
36 "chamfer",
37 "tally",
38 "stencil_f",
39];
40
41/// The palettes forge ships, by the name `[client] theme` takes.
42pub const THEME_NAMES: &[&str] = &["dark"];
43
44/// The typeface sets forge ships, by the name `[client] font` takes. The
45/// built-in face has no name of its own: an unset key draws it, and the
46/// one name here is the opt-out to the stacks the OS already has.
47pub const FONT_NAMES: &[&str] = &["system"];