| Copyright | (c) 2017 Schell Scivally |
|---|---|
| License | MIT |
| Maintainer | Schell Scivally <schell@takt.com> |
| Safe Haskell | None |
| Language | Haskell2010 |
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.
- coloredString :: Backend t e (V2 Float, V4 Float) (V2 Float) Float s -> Font -> Int -> Float -> String -> (V2 Float -> V4 Float) -> IO (Renderer (V2 Float) Float s)
- texturedString :: Backend t e (V2 Float, V2 Float) (V2 Float) Float s -> Font -> Int -> Float -> String -> t -> (V2 Float -> V2 Float) -> IO (Renderer (V2 Float) Float s)
- stringOutline :: Font -> Int -> Float -> String -> Vector (RawGeometry (V2 Float))
Documentation
Arguments
| :: Backend t e (V2 Float, V4 Float) (V2 Float) Float s | A backend for rendering geometry with |
| -> 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.
Arguments
| :: Backend t e (V2 Float, V2 Float) (V2 Float) Float s | A backend for rendering geometry with |
| -> 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.
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.