gelatin-fruity-0.1.0.0: Gelatin's support for rendering TTF outlines, using FontyFruity.

Copyright(c) 2017 Schell Scivally
LicenseMIT
MaintainerSchell Scivally <schell@takt.com>
Safe HaskellNone
LanguageHaskell2010

Gelatin.Fruity

Description

Provides two high-level functions that create gelatin renderers:

coloredString
font strings filled with color
texturedString
font strings filled with a texture mapping

Provides one mid-level function for extracting a font outline:

stringOutline
raw geometry of a font string

For help obtaining a Font within your program, check out loadFontFile.

Synopsis

Documentation

coloredString Source #

Arguments

:: Backend t e (V2 Float, V4 Float) (V2 Float) Float s

A backend for rendering geometry with V2V4 vertices.

-> Font

The font to use.

-> Int

The dpi to use for reading the font geometry.

-> Float

Your target pixel width.

-> String

The string to render.

-> (V2 Float -> V4 Float)

A function from font geometry/space to color.

-> IO (Renderer (V2 Float) Float s) 

Creates a gelatin Renderer that renders the given string in 2d space.

texturedString Source #

Arguments

:: Backend t e (V2 Float, V2 Float) (V2 Float) Float s

A backend for rendering geometry with V2V2 vertices.

-> Font

The font to use.

-> Int

The dpi to use for reading the font geometry.

-> Float

Your target pixel width.

-> String

The string to render.

-> t

The texture.

-> (V2 Float -> V2 Float)

A function from font geometry/space to texture mapping (uv coords).

-> IO (Renderer (V2 Float) Float s) 

Creates a gelatin Renderer that renders the given string in 2d space, using a given texture.

stringOutline Source #

Arguments

:: Font

The font to extract geometry from.

-> Int

The dpi to read the font at.

-> Float

The target pixel width of the resulting geometry.

-> String

The string to construct and extract the geometry with.

-> Vector (RawGeometry (V2 Float)) 

Extract the outlines of a given string using a font. Returns a vector of RawBeziers and RawTriangles.