~alcinnz/harfbuzz-pure

ref: 2e079971838b7c0073bcf38ac0d5df56a5a6dbc5 harfbuzz-pure/Data/Text/Glyphize/Font.hs -rw-r--r-- 893 bytes
2e079971 — Adrian Cochrane Draft pure-functional Harfbuzz API. 2 years ago
                                                                                
2e079971 Adrian Cochrane
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
module Data.Text.Glyphize.Font where

import Data.ByteString
import Data.Text.Short

data Face = Face -- TODO Define

-- countFace :: ByteString -> Int
-- createFace :: ByteString -> Int -> Face
-- emptyFace :: Face
-- faceGlyphCount :: Face -> Int
-- faceIndex :: Face -> Int
-- faceUpem :: Face -> Int
-- Defer implementation of other functions

data Font = Font -- TODO Define
data FontOptions = FontOptions {
    x_ppem :: Int, y_ppem :: Int,
    ptem :: Int,
    x_scale :: Int, y_scale :: Int,
    slant :: Float
    -- Support variations? Variation coordinates?
}

-- createFont :: Face -> FontOptions -> Font
-- emptyFont :: Font
-- fontFace :: Font -> Face
-- fontGlyph :: Font -> Char -> Maybe Char -> Maybe Int
-- fontString2Glyph :: Font -> ShortText -> Maybe Int
-- fontGlyph2String :: Font -> Int -> ShortText
-- Defer implementation of other functions

-- Do we need FontFuncs?