minitypeset-opengl-0.3.0.0: Layout and render text with TrueType fonts using OpenGL

Safe HaskellNone
LanguageHaskell2010

Graphics.Rendering.MiniTypeset.FontTexture

Description

Store font glyphs in OpenGL textures

TODO: add (optional) subpixel rendering support (pre-render say 4 versions of the same glyphs with fractional horizontal offsets)

Synopsis

Documentation

data BufLoc Source #

The location of a glyph in a font texture collection

Constructors

BufLoc 

Fields

Instances
Show BufLoc Source # 
Instance details

Defined in Graphics.Rendering.MiniTypeset.FontTexture

data TexBuf Source #

A single texture buffer

Constructors

TexBuf 
Instances
Show TexBuf Source # 
Instance details

Defined in Graphics.Rendering.MiniTypeset.FontTexture

data TexCursor Source #

Constructors

TexCursor 

Fields

data FontTexture Source #

A font texture collection: possibly several textures containing bitmaps a given font with a given height.

newFontTexture' :: Font -> (Float, Float) -> String -> (Int, Int) -> Double -> IO FontTexture Source #

Creates a new (empty) font texture. We allow different horizontal and vertical scaling, but both are measured in pixel heights

lookupFontTexture :: FontTexture -> Char -> IO BufLoc Source #

Finds a character in the font texture (rendering it first if necessary). If the glyph is not present in the font, we return the "replacement character" instead. If that doesn't exist either, then we return the "not defined glyph" (glyph #0)

mbLookupFontTexture :: FontTexture -> Char -> IO (Maybe BufLoc) Source #

Finds a character in the font texture (rendering it first if necessary)

testRenderFullTextureQuad :: FontTexture -> Int -> IO () Source #

Renders the given font texture as a quad (useful for debugging)