~jaro/balkon

ref: aadf98c9885fd44c29fc0939bb61fd8b8ad8f00e balkon/test/Data/Text/ParagraphLayout/FontLoader.hs -rw-r--r-- 445 bytes
aadf98c9Jaro Clean up and update package description file. 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