gelatin-0.0.0.2: An experimental real time renderer.

Safe HaskellNone
LanguageHaskell2010

Gelatin.Core.Rendering.Font

Synopsis

Documentation

compileFontCache :: IO (Async FontCache) Source

fontGeom :: Dpi -> FontString -> ([Bezier (V2 Float)], [Triangle (V2 Float)]) Source

Merges poly a into poly b by "cutting" a and inserting b. cutMerge :: Poly -> Poly -> Poly cutMerge as bs = (take (ndx + 1) as) ++ bs ++ [head bs] ++ (drop ndx as) where (ndx, _) = head $ sortBy (a b -> snd a compare snd b) $ zip [0..] $ map (distance (head bs)) as

findFont :: Async FontCache -> FontDescriptor -> IO (Maybe FilePath) Source

allFonts :: Async FontCache -> IO (Maybe [FontDescriptor]) Source

withFontAsync :: Async FontCache -> FontDescriptor -> (Font -> IO a) -> IO (Maybe a) Source

withFont :: FontCache -> FontDescriptor -> (Font -> IO a) -> IO (Maybe a) Source

concaveTriangles :: [a] -> [Triangle a] Source

Turns a polygon into a list of triangles that can be rendered using the Concave Polygon Stencil Test @see http://www.glprogramming.com/red/chapter14.html#name13