| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
KB.Text.Shape.Font
Synopsis
- extractBlob :: ByteString -> Int -> IO ByteString
- data FontData = FontData {}
- withFontData :: FontData -> (Font -> IO r) -> IO r
- data Font
- createFont :: ByteString -> Int -> IO FontData
- destroyFont :: FontData -> IO ()
- getFontInfo :: Font -> IO Info
- data FontInfo
- emToCaps :: Fractional a => Font -> a
- capHeight :: Num a => Font -> a
- unitsPerEm :: Num a => Font -> a
- withLoader :: (FontData -> Ptr LoadFontState -> IO a) -> IO a
- loadFont :: ByteString -> Int -> FontData -> Ptr LoadFontState -> IO (Either LoadFontError LoadFontResult)
- data LoadFontResult
- = LoadFontReady
- | LoadFontNeedsBlob {
- scratchSize :: Int
- outputSize :: Int
- placeBlob :: FontData -> Ptr LoadFontState -> Int -> Int -> IO ByteString
Documentation
extractBlob :: ByteString -> Int -> IO ByteString Source #
Extract and pre-process font data needed for shaping.
Haskell-owned font data
Constructors
| FontData | |
Fields
| |
Instances
An opaque handle to the font data.
createFont :: ByteString -> Int -> IO FontData Source #
destroyFont :: FontData -> IO () Source #
getFontInfo :: Font -> IO Info Source #
Instances
| Storable FontInfo Source # | |
Defined in KB.Text.Shape.FFI.Structs | |
| Show FontInfo Source # | |
| Eq FontInfo Source # | |
emToCaps :: Fractional a => Font -> a Source #
Scaling factor to go from font-specific Em units to a cap-height normalized units.
This results in more consistent font sizing when using multiple fonts. You may even have a chance to align something vertically!
capHeight :: Num a => Font -> a Source #
Get the height of font's capital letters, in the font's logical units.
unitsPerEm :: Num a => Font -> a Source #
Get the font's "Em square" size, in the font's logical units.
withLoader :: (FontData -> Ptr LoadFontState -> IO a) -> IO a Source #
loadFont :: ByteString -> Int -> FontData -> Ptr LoadFontState -> IO (Either LoadFontError LoadFontResult) Source #
data LoadFontResult Source #
Constructors
| LoadFontReady | |
| LoadFontNeedsBlob | |
Fields
| |
placeBlob :: FontData -> Ptr LoadFontState -> Int -> Int -> IO ByteString Source #