summaryrefslogtreecommitdiffstats
path: root/svgbob/src/buffer/cell_buffer/settings.rs
diff options
context:
space:
mode:
Diffstat (limited to 'svgbob/src/buffer/cell_buffer/settings.rs')
-rw-r--r--svgbob/src/buffer/cell_buffer/settings.rs37
1 files changed, 37 insertions, 0 deletions
diff --git a/svgbob/src/buffer/cell_buffer/settings.rs b/svgbob/src/buffer/cell_buffer/settings.rs
new file mode 100644
index 0000000..06a8d76
--- /dev/null
+++ b/svgbob/src/buffer/cell_buffer/settings.rs
@@ -0,0 +1,37 @@
+#[derive(Debug, Clone)]
+pub struct Settings {
+ /// font-size of the text
+ pub font_size: usize,
+ /// the font used for the text
+ pub font_family: String,
+ /// the color fill used in filled solid shape
+ pub fill_color: String,
+ /// the backdrop background color
+ pub background: String,
+ /// the stroke color of lines, and shapes
+ pub stroke_color: String,
+ /// the width of the stroke
+ pub stroke_width: f32,
+ /// the scale multiplier
+ pub scale: f32,
+}
+impl Settings {
+ /// the inverse of the default scale 10
+ pub fn scale_inverse(&self) -> f32 {
+ 1.0 / self.scale
+ }
+}
+
+impl Default for Settings {
+ fn default() -> Self {
+ Settings {
+ font_size: 16,
+ font_family: "monospace".into(),
+ fill_color: "black".into(),
+ background: "white".into(),
+ stroke_color: "black".into(),
+ stroke_width: 2.0,
+ scale: 10.0,
+ }
+ }
+}