~jaro/balkon

ref: 633d18066bdebdd14f5ae6116741dcf7963327ce balkon/test/Data/Text/ParagraphLayout/FontLoader.hs -rw-r--r-- 445 bytes
633d1806Jaro Separate tests by module. 1 year, 7 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
module Data.Text.ParagraphLayout.FontLoader (loadUbuntuRegular) where

import Data.ByteString (readFile)
import Data.Text.Glyphize
    (Font
    ,createFace
    ,createFont
    )
import Prelude (IO, return)
import System.FilePath ((</>))

loadUbuntuRegular :: IO Font
loadUbuntuRegular = do
    ttf <- readFile ("assets" </> "fonts" </> "ubuntu" </> "Ubuntu-R.ttf")
    let face = createFace ttf 0
    let font = createFont face
    return font