From d3bb3d92191d9e740c1d827e5c56f58d725d8c42 Mon Sep 17 00:00:00 2001 From: Adrian Cochrane Date: Mon, 19 Dec 2022 10:48:06 +1300 Subject: [PATCH] Upload documentation on initialization/finalization routines. --- Graphics/Text/Font/Choose/Init.hs | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/Graphics/Text/Font/Choose/Init.hs b/Graphics/Text/Font/Choose/Init.hs index 33f0fbc..7981b96 100644 --- a/Graphics/Text/Font/Choose/Init.hs +++ b/Graphics/Text/Font/Choose/Init.hs @@ -5,14 +5,40 @@ import Prelude hiding (init) import Graphics.Text.Font.Choose.Config +-- | Loads the default configuration file and returns the resulting configuration. +-- Does not load any font information. initLoadConfig = fcInitLoadConfig >>= ptr2config foreign import ccall "FcInitLoadConfig" fcInitLoadConfig :: IO Config_ +-- | Loads the default configuration file and builds information about the available fonts. +-- Returns the resulting configuration. initLoadConfigAndFonts = fcInitLoadConfigAndFonts >>= ptr2config foreign import ccall "FcInitLoadConfigAndFonts" fcInitLoadConfigAndFonts :: IO Config_ +-- | Initialize fontconfig library +-- Loads the default configuration file and the fonts referenced therein and +-- sets the default configuration to that result. +-- Returns whether this process succeeded or not. +-- If the default configuration has already been loaded, +-- this routine does nothing and returns FcTrue. foreign import ccall "FcInit" init :: IO Bool +-- | Frees all data structures allocated by previous calls to fontconfig functions. +-- Fontconfig returns to an uninitialized state, +-- requiring a new call to one of the FcInit functions before any other +-- fontconfig function may be called. foreign import ccall "FcFini" fini :: IO () +-- | Forces the default configuration file to be reloaded +-- and resets the default configuration. Returns `False` if the configuration +-- cannot be reloaded (due to configuration file errors, +-- allocation failures or other issues) and leaves the existing configuration +-- unchanged. Otherwise returns True. foreign import ccall "FcInitReinitialize" reinit :: IO Bool +-- | Checks the rescan interval in the default configuration, +-- checking the configuration if the interval has passed and +-- reloading the configuration if when any changes are detected. +-- Returns False if the configuration cannot be reloaded (see FcInitReinitialize). +-- Otherwise returns True. foreign import ccall "FcInitBringUptoDate" bringUptoDate :: IO Bool +-- | Library version number +-- Returns the version number of the library. foreign import ccall "FcGetVersion" version :: Int -- 2.30.2