{-# LANGUAGE TemplateHaskell #-}
module Main where
import Criterion.Main
import Data.Text.Glyphize
import FileEmbedLzma (embedLazyText, embedByteString)
import Data.FileEmbed (makeRelativeToProject)
import System.FilePath ((</>))
shapeStr txt = shape font defaultBuffer { text = txt } []
where font = createFont $ createFace $(
makeRelativeToProject ("assets" </> "Lora-Regular.ttf") >>=
embedByteString) 0
main = defaultMain [
bgroup "literature" [
bench "Dracula" $ whnf shapeStr
$(makeRelativeToProject ("bench" </> "dracula.txt") >>= embedLazyText)
]
]