huozi/layout/
layout_style.rs1use serde::{Deserialize, Serialize};
2
3#[derive(Debug, Clone, Default, Serialize, Deserialize)]
4#[serde(rename_all = "lowercase")]
5pub enum LayoutDirection {
6 #[default]
7 Horizontal,
8 Vertical,
9}
10
11#[derive(Debug, Clone, Serialize, Deserialize)]
13#[serde(rename_all = "camelCase", default)]
14pub struct LayoutStyle {
15 pub direction: LayoutDirection,
18 pub box_width: f64,
20 pub box_height: f64,
22 pub glyph_grid_size: f64,
24}
25
26impl Default for LayoutStyle {
27 fn default() -> Self {
28 Self {
29 direction: Default::default(),
30 box_width: 1280.,
31 box_height: 720.,
32 glyph_grid_size: 24.,
33 }
34 }
35}