~alcinnz/harfbuzz-pure

9f9a5ae511ae17aaf5c099c862d657a52189d754 — Adrian Cochrane 1 year, 11 months ago fd6388d
Fix use of utf8-light dependency, dropping it.
3 files changed, 11 insertions(+), 7 deletions(-)

M Data/Text/Glyphize/Buffer.hs
M Data/Text/Glyphize/Font.hs
M harfbuzz-pure.cabal
M Data/Text/Glyphize/Buffer.hs => Data/Text/Glyphize/Buffer.hs +5 -1
@@ 10,7 10,6 @@ import Control.Exception (bracket)

--- To fill computed text property.
import Data.Text.Encoding (decodeUtf8Lenient)
import Codec.Binary.UTF8.Light (encodeUTF8, w2c, c2w)

import qualified Data.Text.Array as A
import GHC.Exts (ByteArray#, sizeofByteArray#, Int#)


@@ 282,6 281,11 @@ tag_to_string tag = [
    w2c (shiftR tag 0 .&. 0x7f)
  ]

c2w :: Char -> Word32
c2w = toEnum . fromEnum
w2c :: Word32 -> Char
w2c = toEnum . fromEnum

------
--- Haskell-to-C conversion
------

M Data/Text/Glyphize/Font.hs => Data/Text/Glyphize/Font.hs +4 -4
@@ 6,10 6,10 @@ import Data.ByteString (packCStringLen)
import Data.Word (Word8, Word32)
import Data.Int (Int32)
import FreeType.Core.Base (FT_Face)
import Data.Text.Glyphize.Buffer (tag_to_string, tag_from_string, Direction, dir2int)
import Data.Text.Glyphize.Buffer (tag_to_string, tag_from_string, Direction, dir2int,
                                c2w, w2c)

import Control.Monad (forM, unless)
import Codec.Binary.UTF8.Light (w2c, c2w)
import Data.Maybe (fromMaybe)

import System.IO.Unsafe (unsafePerformIO)


@@ 353,8 353,8 @@ fontFace font = unsafePerformIO $ withForeignPtr font $ \font' -> do
    newForeignPtr_ face' -- FIXME: Keep the font alive...
foreign import ccall "hb_font_get_face" hb_font_get_face :: Font_ -> IO Face_
 
 -- | Fetches the glyph ID for a Unicode codepoint in the specified `Font`,
 -- with an optional variation selector.
-- | Fetches the glyph ID for a Unicode codepoint in the specified `Font`,
-- with an optional variation selector.
fontGlyph :: Font -> Char -> Maybe Char -> Maybe Word32
fontGlyph font char var =
    unsafePerformIO $ withForeignPtr font $ \font' -> alloca $ \ret -> do

M harfbuzz-pure.cabal => harfbuzz-pure.cabal +2 -2
@@ 10,7 10,7 @@ name:                harfbuzz-pure
-- PVP summary:      +-+------- breaking API changes
--                   | | +----- non-breaking API additions
--                   | | | +--- code changes with no API change
version:             0.1.0.0
version:             0.1.0.1

-- A short (one-line) description of the package.
synopsis:            Pure-functional Harfbuzz language bindings


@@ 60,7 60,7 @@ library
  -- other-extensions:    
  
  -- Other library packages from which modules are imported.
  build-depends:       base >=4.12 && <4.13, text >= 2.0 && < 3, utf8-light >= 0.4 && < 0.5,
  build-depends:       base >=4.12 && <4.13, text >= 2.0 && < 3,
                       bytestring >= 0.11, freetype2 >= 0.2, derive-storable >= 0.3 && < 1
  pkgconfig-depends:   harfbuzz