pcf-font-embed-0.1.2.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 Source #

Arguments

:: FilePath

Font to render with

-> String

Text to render

-> Q Exp 

Render text at compile time. Default opaque and blank colors of 0x00 and 0xFF are used respectively. The generated expression consists of a PCFText.

embedPCFTextColor Source #

Arguments

:: FilePath

Font to render with

-> Word8

Opaque color value

-> Word8

Blank color value

-> String

Text to render

-> Q Exp 

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