pcf-font-embed-0.1.0.0: Template Haskell for embedding text rendered using PCF fonts.

Safe HaskellNone
LanguageHaskell2010

Graphics.Text.PCF.Embed

Contents

Description

pcf-font-embed allows users to render and embed text with X11 PCF fonts at compile-time. Perhaps the best use-case for this library is in generating textures for text rendering with accelerated graphics. For reference, here is a simple example of pcf-font-embed in action:

{-# LANGUAGE TemplateHaskell #-}
import Graphics.Text.PCF
import Graphics.Text.PCF.Embed

-- | USAGE: program
main :: IO ()
main = putStrLn $ pcf_text_ascii $(embedPCFText "font.pcf.gz" "Hello!")

Synopsis

Embedding

embedPCFText :: FilePath -> String -> Q Exp Source #

Render text at compile time. The generated expression consists of a PCFText.