module Graphics.PDF.Font
(
Font(..)
,chooseFont
)
where
import Graphics.PDF.LowLevel
data Font = TimesRoman
| TimesBold
| TimesItalic
| Helvetica
| HelveticaBold
| HelveticaOblique
| HelveticaBoldOblique
| Courier
| CourierBold
| CourierOblique
| CourierBoldOblique
| Symbol
| ZapfDingbats
instance Show Font where
show TimesRoman = "Times-Roman"
show TimesBold = "Times-Bold"
show TimesItalic = "Times-Italic"
show Helvetica = "Helvetica"
show HelveticaBold = "Helvetica-Bold"
show HelveticaOblique = "Helvetica-Oblique"
show HelveticaBoldOblique = "Helvetica-BoldOblique"
show Courier = "Courier"
show CourierBold = "Courier-Bold"
show CourierOblique = "Courier-Oblique"
show CourierBoldOblique = "Courier-BoldOblique"
show Symbol = "Symbol"
show ZapfDingbats = "ZapfDingbats"
type Size = Int
newFont :: String -> PdfObject
newFont name= pdfDictionary [("Type",PdfName "FontDescriptor"),
("Subtype",PdfName "Type1"),
("BaseFont",PdfName name)
]
chooseFont :: Font -> Size -> PdfCmd
chooseFont font fontSize = (PdfBT fontName fontSize,[(PdfFont,fontName,PdfUnknownPointer fontName),
(PdfAnyObject, fontName, newFont fontName)
])
where
fontName = show font