summaryrefslogtreecommitdiff
path: root/src/exec
diff options
context:
space:
mode:
authorMartin <mhaug@live.de>2021-03-19 22:36:13 +0100
committerGitHub <noreply@github.com>2021-03-19 22:36:13 +0100
commit6cb9fe9064a037224b6560b69b441b72e787fa94 (patch)
tree9a5474758e37199c7a01c6d22383ede225deab4d /src/exec
parent898dc38ec153709929d2513fb9d040dd2c1ce0fe (diff)
Text colors 🦩 (#18)
Diffstat (limited to 'src/exec')
-rw-r--r--src/exec/context.rs1
-rw-r--r--src/exec/state.rs6
2 files changed, 6 insertions, 1 deletions
diff --git a/src/exec/context.rs b/src/exec/context.rs
index 311619cc..761977fc 100644
--- a/src/exec/context.rs
+++ b/src/exec/context.rs
@@ -178,6 +178,7 @@ impl<'a> ExecContext<'a> {
font_size: self.state.font.font_size(),
top_edge: self.state.font.top_edge,
bottom_edge: self.state.font.bottom_edge,
+ color: self.state.font.color,
}
}
diff --git a/src/exec/state.rs b/src/exec/state.rs
index 6775f394..f66694fd 100644
--- a/src/exec/state.rs
+++ b/src/exec/state.rs
@@ -2,8 +2,9 @@ use std::rc::Rc;
use fontdock::{fallback, FallbackTree, FontStretch, FontStyle, FontVariant, FontWeight};
+use crate::color::{Color, RgbaColor};
use crate::geom::*;
-use crate::layout::VerticalFontMetric;
+use crate::layout::{Fill, VerticalFontMetric};
use crate::paper::{Paper, PaperClass, PAPER_A4};
/// The evaluation state.
@@ -115,6 +116,8 @@ pub struct FontState {
/// Whether the emphasis toggle is active or inactive. This determines
/// whether the next `_` makes italic or non-italic.
pub emph: bool,
+ /// The glyph fill color / texture.
+ pub color: Fill,
}
impl FontState {
@@ -149,6 +152,7 @@ impl Default for FontState {
scale: Linear::ONE,
strong: false,
emph: false,
+ color: Fill::Color(Color::Rgba(RgbaColor::BLACK)),
}
}
}