2020-02-08 08:15:32 +01:00
|
|
|
module PDF.Font (
|
2020-03-06 19:19:53 +01:00
|
|
|
Decoder
|
|
|
|
, Encoder
|
|
|
|
, Font(..)
|
2020-02-08 08:15:32 +01:00
|
|
|
, FontSet
|
|
|
|
, emptyFont
|
|
|
|
) where
|
|
|
|
|
|
|
|
import Data.ByteString (ByteString)
|
|
|
|
import Data.Map (Map)
|
|
|
|
import Data.Text (Text)
|
|
|
|
import PDF.Object (Name)
|
|
|
|
|
2020-03-06 19:19:53 +01:00
|
|
|
type Decoder = ByteString -> Either String Text
|
|
|
|
type Encoder = Text -> Either String ByteString
|
|
|
|
data Font = Font {
|
|
|
|
decode :: Decoder
|
|
|
|
, encode :: Encoder
|
|
|
|
}
|
|
|
|
|
2020-02-08 08:15:32 +01:00
|
|
|
type FontSet = Map Name Font
|
|
|
|
|
|
|
|
emptyFont :: Font
|
2020-03-06 19:19:53 +01:00
|
|
|
emptyFont = Font {
|
|
|
|
decode = \_ -> Left "No fond loaded"
|
|
|
|
, encode = \_ -> Left "No fond loaded"
|
|
|
|
}
|