~alcinnz/harfbuzz-pure

ref: afc5608d58a63dd48d3132c53bebd38f66c10a52 harfbuzz-pure/Data/Text/Glyphize/Font.hs -rw-r--r-- 983 bytes
afc5608d — Adrian Cochrane Correction: buffer's codepoints are all Chars. 2 years ago
                                                                                
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
34
35
module Data.Text.Glyphize.Font where

import Data.ByteString
import Data.Text.Short

data Face = Face -- TODO Define

-- countFace :: ByteString -> Int
-- createFace :: ByteString -> Int -> IO Face
-- ftCreateFace :: FT_Face -> 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
-- ftCreateFont ::FT_Face -> FontOptions -> IO 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?