| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Codec.Ktx2.Font
Synopsis
- data Bundle = Bundle {}
- loadBundle :: ReadChunk a => Context a -> IO Bundle
- loadBundleBytes :: ByteString -> IO Bundle
- loadBundleFile :: FilePath -> IO Bundle
- freeBundle :: Bundle -> IO ()
- bundleFont :: FilePath -> FilePath -> FilePath -> FilePath -> IO ()
- data StackContext a = StackContext {}
- createStackContext :: Foldable t => t Bundle -> IO (StackContext ())
- pushBundleFont :: Context -> Bundle -> IO Int
- destroyStackContext :: StackContext a -> IO ()
- lookupAtlas :: Font -> StackContext a -> Maybe Compact
- lookupBundled :: Font -> StackContext a -> Maybe a
- mapWithBundle :: Foldable t => t (Bundle, a -> b) -> StackContext a -> StackContext b
- mapBundled :: (a -> b) -> StackContext a -> StackContext b
- pattern KTX_KEY_atlas :: Text
- pattern KTX_KEY_kbts :: Text
- pattern KTX_KEY_kbts_version :: Text
- kbtsVersion :: Text
KTX font bundles
Constructors
| Bundle | |
loadBundle :: ReadChunk a => Context a -> IO Bundle Source #
Load bundle data from already opened KTX2 reader context
loadBundleBytes :: ByteString -> IO Bundle Source #
freeBundle :: Bundle -> IO () Source #
Shaping context
data StackContext a Source #
Constructors
| StackContext | |
Instances
createStackContext :: Foldable t => t Bundle -> IO (StackContext ()) Source #
Create shaping context and push fonts from all the bundles.
pushBundleFont :: Context -> Bundle -> IO Int Source #
Put already-loaded font to context.
The context will NOT keep a fontData reference.
destroyStackContext :: StackContext a -> IO () Source #
Destroy shaping context.
NB: Does NOT free the fonts as they may be shared with other stacks. Use freeBundle for that.
Associated data utilities
lookupAtlas :: Font -> StackContext a -> Maybe Compact Source #
lookupBundled :: Font -> StackContext a -> Maybe a Source #
mapWithBundle :: Foldable t => t (Bundle, a -> b) -> StackContext a -> StackContext b Source #
Update font annotations with the bundle collection annotated with update functions.
This may be used to attach more information, e.g. after all fonts were assigned texture slots.
The update collection should be a superset of what was initially bundled. Otherwise you may see missing things downstream.
mapBundled :: (a -> b) -> StackContext a -> StackContext b Source #
Format internals
pattern KTX_KEY_atlas :: Text Source #
pattern KTX_KEY_kbts :: Text Source #
pattern KTX_KEY_kbts_version :: Text Source #
kbtsVersion :: Text Source #