~alcinnz/harfbuzz-pure

144c40dbf48c165643a343436bc7b1a36d404a26 — Adrian Cochrane 2 years ago be23e60
Try wrapping HarfBuzz C++ functions in C functions for calling convention/linking issues.

Committing so I can try building on a newer OS.
3 files changed, 10 insertions(+), 6 deletions(-)

M Data/Text/Glyphize/Buffer.hs
M Main.hs
M harfbuzz-pure.cabal
M Data/Text/Glyphize/Buffer.hs => Data/Text/Glyphize/Buffer.hs +4 -4
@@ 80,7 80,7 @@ data Buffer = Buffer {
    replacementCodepoint :: Char
    -- ^ the hb_codepoint_t that replaces invalid entries for a given encoding
    -- when adding text to buffer .
}
} deriving (Eq, Show, Read)

-- | An empty buffer with sensible default properties.
defaultBuffer = Buffer {


@@ 100,9 100,9 @@ defaultBuffer = Buffer {
        replacementCodepoint = '\xFFFD'
    }

data ContentType = ContentTypeUnicode | ContentTypeGlyphs deriving (Eq, Show)
data Direction = DirLTR | DirRTL | DirTTB | DirBTT deriving (Eq, Show)
data ClusterLevel = ClusterMonotoneGraphemes | ClusterMonotoneChars | ClusterChars deriving (Eq, Show)
data ContentType = ContentTypeUnicode | ContentTypeGlyphs deriving (Eq, Show, Read)
data Direction = DirLTR | DirRTL | DirTTB | DirBTT deriving (Eq, Show, Read)
data ClusterLevel = ClusterMonotoneGraphemes | ClusterMonotoneChars | ClusterChars deriving (Eq, Show, Read)

data GlyphInfo = GlyphInfo {
    codepoint :: Word32,

M Main.hs => Main.hs +4 -1
@@ 2,8 2,11 @@
module Main where

import "harfbuzz-pure" Data.Text.Glyphize
import "harfbuzz-pure" Data.Text.Glyphize.Buffer

main :: IO ()
main = do
    putStr "Hello, world!\n"
    buf' <- freeze' defaultBuffer
    -- buf <- thaw' buf'
    print "Hello, world"
    -- TODO test I can shape text!

M harfbuzz-pure.cabal => harfbuzz-pure.cabal +2 -1
@@ 62,7 62,8 @@ library
  -- Other library packages from which modules are imported.
  build-depends:       base >=4.9 && <5, bytestring, text, text-short, utf8-light
--                       , freetype2 >= 0.2
  extra-libraries:     harfbuzz
  pkgconfig-depends:   harfbuzz
  cxx-sources:         c-bits/hbc-buffer.c
  
  -- Directories containing source files.
  -- hs-source-dirs: