| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
Termtab.Graphics.FreeType
Description
Minimal FFI binding to the system FreeType library.
We deliberately bind the handful of FreeType entry points we need rather than
depend on the freetype2 Hackage package: that package vendors and compiles
FreeType's C source (including a bundled zlib) which does not build on the
hermetic Apple-SDK toolchain. Linking the nixpkgs system freetype via
pkgconfig-depends: freetype2 is robust across clang versions.
This is the raw rasterization layer: it turns a glyph (a Unicode code point, e.g. a SMuFL notehead in Bravura) into an 8-bit grayscale coverage bitmap plus placement metrics. Glyph caching lives one layer up in Termtab.Graphics.Font.
Synopsis
- data FontFace
- newFontFace :: FilePath -> IO FontFace
- freeFontFace :: FontFace -> IO ()
- withFontFace :: FilePath -> (FontFace -> IO a) -> IO a
- data GlyphBitmap = GlyphBitmap {}
- renderGlyph :: FontFace -> Int -> Char -> IO (Maybe GlyphBitmap)
Documentation
newFontFace :: FilePath -> IO FontFace Source #
Load a font face from a file path. Throws via error on failure.
freeFontFace :: FontFace -> IO () Source #
Release a font face and its owning library.
withFontFace :: FilePath -> (FontFace -> IO a) -> IO a Source #
Bracketed newFontFace / freeFontFace.
data GlyphBitmap Source #
An 8-bit grayscale coverage bitmap plus FreeType placement metrics.
Constructors
| GlyphBitmap | |