module Text
( Font(..)
, FontSize(..)
, getCombinedFont
)
where
import Data.List
data Font
= Arial
| Verdana
| TimesNewRoman
| CourierNew
| Serif
| SansSerif
| Font String deriving (Show, Eq)
data FontSize = Size Int deriving (Show, Eq)
convertFont :: Font -> String
convertFont font = case (font) of
Arial -> "Arial"
Verdana -> "Verdana"
TimesNewRoman -> "Times New Roman"
CourierNew -> "Courier New"
Serif -> "serif"
SansSerif -> "sans-serif"
Font family -> family
convertFontSize :: FontSize -> String
convertFontSize (Size size) = (show size) ++ "pt"
getCombinedFont :: Font -> FontSize -> String
getCombinedFont font fontSize =
intercalate " " [(convertFontSize fontSize), (convertFont font)]