From 7d15dc634b3be1b6e284bb6b2450e3736d3e6e8d Mon Sep 17 00:00:00 2001 From: Laurenz Date: Thu, 29 Jul 2021 12:21:55 +0200 Subject: Move font family and refactor alignment --- src/exec/state.rs | 25 +++---------------------- 1 file changed, 3 insertions(+), 22 deletions(-) (limited to 'src/exec') 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 { -- cgit v1.2.3