module Ui.Symbol where
import Data.Text (Text)
symbol :: Text -> [Glyph] -> Symbol
symbol :: Text -> [Glyph] -> Symbol
symbol Text
name = Text -> Bool -> [Glyph] -> Symbol
Symbol Text
name Bool
False
simple :: Text -> Text -> Symbol
simple :: Text -> Text -> Symbol
simple Text
name Text
chars = Text -> Bool -> [Glyph] -> Symbol
Symbol Text
name Bool
True [Text -> Glyph
glyph Text
chars]
glyph :: Text -> Glyph
glyph :: Text -> Glyph
glyph Text
text = Glyph
{ glyph_text :: Text
glyph_text = Text
text
, glyph_font :: Maybe Font
glyph_font = forall a. Maybe a
Nothing
, glyph_size :: Int
glyph_size = Int
0
, glyph_align :: (Double, Double)
glyph_align = (Double
0, Double
0)
, glyph_rotate :: Int
glyph_rotate = Int
0
}
size :: Int -> Glyph -> Glyph
size :: Int -> Glyph -> Glyph
size Int
n Glyph
g = Glyph
g { glyph_size :: Int
glyph_size = Int
n }
glyph_at :: Int -> (Double, Double) -> Glyph -> Glyph
glyph_at :: Int -> (Double, Double) -> Glyph -> Glyph
glyph_at Int
size (Double, Double)
align Glyph
glyph = Glyph
glyph { glyph_size :: Int
glyph_size = Int
size, glyph_align :: (Double, Double)
glyph_align = (Double, Double)
align }
type Font = String
data Symbol = Symbol {
Symbol -> Text
name :: Text
, Symbol -> Bool
absolute_y :: Bool
, Symbol -> [Glyph]
glyphs :: [Glyph]
} deriving (Int -> Symbol -> ShowS
[Symbol] -> ShowS
Symbol -> Font
forall a.
(Int -> a -> ShowS) -> (a -> Font) -> ([a] -> ShowS) -> Show a
showList :: [Symbol] -> ShowS
$cshowList :: [Symbol] -> ShowS
show :: Symbol -> Font
$cshow :: Symbol -> Font
showsPrec :: Int -> Symbol -> ShowS
$cshowsPrec :: Int -> Symbol -> ShowS
Show)
data Glyph = Glyph {
Glyph -> Text
glyph_text :: Text
, Glyph -> Maybe Font
glyph_font :: Maybe Font
, Glyph -> Int
glyph_size :: Int
, Glyph -> (Double, Double)
glyph_align :: (Double, Double)
, Glyph -> Int
glyph_rotate :: Int
} deriving (Int -> Glyph -> ShowS
[Glyph] -> ShowS
Glyph -> Font
forall a.
(Int -> a -> ShowS) -> (a -> Font) -> ([a] -> ShowS) -> Show a
showList :: [Glyph] -> ShowS
$cshowList :: [Glyph] -> ShowS
show :: Glyph -> Font
$cshow :: Glyph -> Font
showsPrec :: Int -> Glyph -> ShowS
$cshowsPrec :: Int -> Glyph -> ShowS
Show)