diff options
| author | Laurenz <laurmaedje@gmail.com> | 2021-07-29 12:21:55 +0200 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2021-07-29 12:28:54 +0200 |
| commit | 7d15dc634b3be1b6e284bb6b2450e3736d3e6e8d (patch) | |
| tree | f1dc308528515ccfc90e047fe3cb75bd171b3f8c /src/exec | |
| parent | 853361338bd756c23992041511b1836a2cd0647f (diff) | |
Move font family and refactor alignment
Diffstat (limited to 'src/exec')
| -rw-r--r-- | src/exec/state.rs | 25 |
1 files changed, 3 insertions, 22 deletions
diff --git a/src/exec/state.rs b/src/exec/state.rs index 0145f60f..51bbe395 100644 --- a/src/exec/state.rs +++ b/src/exec/state.rs @@ -1,8 +1,9 @@ -use std::fmt::{self, Display, Formatter}; use std::rc::Rc; use crate::color::{Color, RgbaColor}; -use crate::font::{FontStretch, FontStyle, FontVariant, FontWeight, VerticalFontMetric}; +use crate::font::{ + FontFamily, FontStretch, FontStyle, FontVariant, FontWeight, VerticalFontMetric, +}; use crate::geom::*; use crate::layout::Paint; use crate::paper::{PaperClass, PAPER_A4}; @@ -236,26 +237,6 @@ impl Default for FamilyList { } } -/// A generic or named font family. -#[derive(Debug, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)] -pub enum FontFamily { - Serif, - SansSerif, - Monospace, - Named(String), -} - -impl Display for FontFamily { - fn fmt(&self, f: &mut Formatter) -> fmt::Result { - f.pad(match self { - Self::Serif => "serif", - Self::SansSerif => "sans-serif", - Self::Monospace => "monospace", - Self::Named(s) => s, - }) - } -} - /// Describes a line that is positioned over, under or on top of text. #[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)] pub struct LineState { |
