summaryrefslogtreecommitdiff
path: root/src/exec/state.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/exec/state.rs')
-rw-r--r--src/exec/state.rs25
1 files changed, 19 insertions, 6 deletions
diff --git a/src/exec/state.rs b/src/exec/state.rs
index 7957f312..c579bc4e 100644
--- a/src/exec/state.rs
+++ b/src/exec/state.rs
@@ -12,30 +12,43 @@ use crate::paper::{Paper, PaperClass, PAPER_A4};
/// The evaluation state.
#[derive(Debug, Clone, PartialEq)]
pub struct State {
- /// The current directions along which layouts are placed in their parents.
- pub dirs: LayoutDirs,
- /// The current alignments of layouts in their parents.
- pub aligns: LayoutAligns,
+ /// The current language-related settings.
+ pub lang: LangState,
/// The current page settings.
pub page: PageState,
/// The current paragraph settings.
pub par: ParState,
/// The current font settings.
pub font: FontState,
+ /// The current alignments of layouts in their parents.
+ pub aligns: Gen<Align>,
}
impl Default for State {
fn default() -> Self {
Self {
- dirs: LayoutDirs::new(Dir::TTB, Dir::LTR),
- aligns: LayoutAligns::new(Align::Start, Align::Start),
+ lang: LangState::default(),
page: PageState::default(),
par: ParState::default(),
font: FontState::default(),
+ aligns: Gen::new(Align::Start, Align::Start),
}
}
}
+/// Defines language properties.
+#[derive(Debug, Copy, Clone, PartialEq)]
+pub struct LangState {
+ /// The direction for text and other inline objects.
+ pub dir: Dir,
+}
+
+impl Default for LangState {
+ fn default() -> Self {
+ Self { dir: Dir::LTR }
+ }
+}
+
/// Defines page properties.
#[derive(Debug, Copy, Clone, PartialEq)]
pub struct PageState {