Safe Haskell | None |
---|---|
Language | Haskell2010 |
- compileFontCache :: IO (Async FontCache)
- fontGeom :: Dpi -> FontString -> ([Bezier (V2 Float)], [Triangle (V2 Float)])
- findFont :: Async FontCache -> FontDescriptor -> IO (Maybe FilePath)
- allFonts :: Async FontCache -> IO (Maybe [FontDescriptor])
- withFontAsync :: Async FontCache -> FontDescriptor -> (Font -> IO a) -> IO (Maybe a)
- withFont :: FontCache -> FontDescriptor -> (Font -> IO a) -> IO (Maybe a)
- concaveTriangles :: [a] -> [Triangle a]
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
withFontAsync :: Async 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