kb-text-shape
Safe HaskellNone
LanguageGHC2021

KB.Text.Shape.Font

Synopsis

Documentation

extractBlob :: ByteString -> Int -> IO ByteString Source #

Extract and pre-process font data needed for shaping.

data FontData Source #

Haskell-owned font data

Instances

Instances details
Show FontData Source # 
Instance details

Defined in KB.Text.Shape.Font

Eq FontData Source # 
Instance details

Defined in KB.Text.Shape.Font

withFontData :: FontData -> (Font -> IO r) -> IO r Source #

data Font Source #

An opaque handle to the font data.

Instances

Instances details
Storable Font Source # 
Instance details

Defined in KB.Text.Shape.FFI.Handles

Methods

sizeOf :: Font -> Int #

alignment :: Font -> Int #

peekElemOff :: Ptr Font -> Int -> IO Font #

pokeElemOff :: Ptr Font -> Int -> Font -> IO () #

peekByteOff :: Ptr b -> Int -> IO Font #

pokeByteOff :: Ptr b -> Int -> Font -> IO () #

peek :: Ptr Font -> IO Font #

poke :: Ptr Font -> Font -> IO () #

Show Font Source # 
Instance details

Defined in KB.Text.Shape.FFI.Handles

Methods

showsPrec :: Int -> Font -> ShowS #

show :: Font -> String #

showList :: [Font] -> ShowS #

Eq Font Source # 
Instance details

Defined in KB.Text.Shape.FFI.Handles

Methods

(==) :: Font -> Font -> Bool #

(/=) :: Font -> Font -> Bool #

Ord Font Source # 
Instance details

Defined in KB.Text.Shape.FFI.Handles

Methods

compare :: Font -> Font -> Ordering #

(<) :: Font -> Font -> Bool #

(<=) :: Font -> Font -> Bool #

(>) :: Font -> Font -> Bool #

(>=) :: Font -> Font -> Bool #

max :: Font -> Font -> Font #

min :: Font -> Font -> Font #

data FontInfo Source #

Instances

Instances details
Storable FontInfo Source # 
Instance details

Defined in KB.Text.Shape.FFI.Structs

Show FontInfo Source # 
Instance details

Defined in KB.Text.Shape.FFI.Structs

Eq FontInfo Source # 
Instance details

Defined in KB.Text.Shape.FFI.Structs

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.