~alcinnz/Typograffiti

d787e09d2479cc4d28c493b9829c2aee0bf4e6d4 — Adrian Cochrane 1 year, 7 months ago c33b23e
Add usage info to draw-shaped.
1 files changed, 4 insertions(+), 2 deletions(-)

M app/Shaped.hs
M app/Shaped.hs => app/Shaped.hs +4 -2
@@ 7,7 7,7 @@ import Typograffiti (makeDrawGlyphs, allocAtlas, TextTransform(..),
import Typograffiti.Atlas (glyphRetriever)
import Control.Monad.Except (liftEither, runExceptT)
import Control.Monad.IO.Class (MonadIO (..))
import SDL hiding (rotate)
import SDL hiding (rotate, trace)
import Graphics.GL.Core32

import Data.Function (fix)


@@ 18,6 18,7 @@ import qualified Data.IntSet as IS
import Data.Int (Int32)
import Data.Text.Glyphize (GlyphInfo(..), GlyphPos(..))
import FreeType.Core.Base (ft_With_FreeType, ft_With_Face)
import Debug.Trace (trace)

main :: IO ()
main = do


@@ 39,7 40,8 @@ main = do
                | (ppemX, ',':ppemY) <- break (== ',') ppem ->
                    (fontfile, read ppemX, read ppemY, infile)
                | otherwise -> (fontfile, read ppem, read ppem, infile)
            _ -> (ttfName, 15, 15, "shaped.txt")
            _ -> trace "USAGE: draw-shaped FONTFILE PPEM FILE"
                (ttfName, 15, 15, "shaped.txt")
    text <- read <$> readFile infile :: IO [(Int32,Int32,[(GlyphInfo,GlyphPos)])]
    let glyphs = IS.fromList [fromIntegral $ codepoint info
            | (_, _, glyphs) <- text, (info, _) <- glyphs]