| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
FreeType.FontConfig
Description
Convert between FontConfig & FreeType types.
Synopsis
- charIndex :: FT_Face -> Char -> Word
- fontCharSet :: FT_Face -> CharSet'
- fontCharSetAndSpacing :: FT_Face -> (Spacing, CharSet')
- fontQuery :: FilePath -> Int -> (Int, Pattern)
- fontQueryAll :: FilePath -> (Int, Int, FontSet)
- fontQueryFace :: FT_Face -> FilePath -> Int -> Pattern
- data FTFC_Instance = Instance {
- fontName :: Maybe String
- fontPath :: Maybe String
- fontFace :: FT_Face
- fontLoadFlags :: Int
- fontAntialias :: Bool
- fontEmbolden :: Bool
- fontIsColor :: Bool
- fontRenderFlags :: Int
- fontRenderFlagsSubpixel :: Int
- fontPixelSizeFixup :: Double
- fontPixelFixupEstimated :: Bool
- fontBGR :: Bool
- fontLCDFilter :: FT_LcdFilter
- fontFeats :: [String]
- fontMetrics :: FTFC_Metrics
- data FTFC_Metrics = Metrics {
- height :: Int
- descent :: Int
- ascent :: Int
- maxAdvance :: (Int, Int)
- metricsAntialias :: Bool
- metricsSubpixel :: FTFC_Subpixel
- metricsName :: Maybe String
- data FTFC_Subpixel
- data FTFC_Glyph a = Glyph {}
- instantiatePattern :: FT_Library -> Pattern -> (Double, Double) -> IO FTFC_Instance
- glyphForIndex :: FTFC_Instance -> Word32 -> FTFC_Subpixel -> (FT_Bitmap -> IO a) -> IO (FTFC_Glyph a)
- bmpAndMetricsForIndex :: FTFC_Instance -> FTFC_Subpixel -> Word32 -> IO (FT_Bitmap, FT_Glyph_Metrics)
Documentation
charIndex :: FT_Face -> Char -> Word Source #
Maps a Unicode char to a glyph index. This function uses information from several possible underlying encoding tables to work around broken fonts. As a result, this function isn't designed to be used in performance sensitive areas; results from this function are intended to be cached by higher level functions.
fontCharSet :: FT_Face -> CharSet' Source #
Scans a FreeType face and returns the set of encoded Unicode chars.
fontCharSetAndSpacing :: FT_Face -> (Spacing, CharSet') Source #
Scans a FreeType face and returns the set of encoded Unicode chars & the computed spacing type.
fontQuery :: FilePath -> Int -> (Int, Pattern) Source #
Constructs a pattern representing the idth face in file.
The number of faces in file is returned in count.
fontQueryAll :: FilePath -> (Int, Int, FontSet) Source #
Constructs patterns found in file, all patterns found in file are added to set.
The number of faces in file is returned in count.
The number of patterns added to set is returned.
fontQueryFace :: FT_Face -> FilePath -> Int -> Pattern Source #
Constructs a pattern representing face. file and id are used solely
as data for pattern elements (FC_FILE, FC_INDEX and sometimes FC_FAMILY).
data FTFC_Instance Source #
A FT_Face queried from FontConfig with glyph-loading parameters.
Constructors
| Instance | |
Fields
| |
data FTFC_Metrics Source #
Results queried from FontConfig with caller-relevant properties, notably relating to layout.
Constructors
| Metrics | |
Fields
| |
data FTFC_Subpixel Source #
Defines subpixel order to use. Note that this is *ignored* if antialiasing has been disabled.
Constructors
| SubpixelNone | From FontConfig. |
| SubpixelHorizontalRGB | |
| SubpixelHorizontalBGR | |
| SubpixelVerticalRGB | |
| SubpixelVerticalBGR | |
| SubpixelDefault | Disable subpixel antialiasing. |
data FTFC_Glyph a Source #
Results from glyphForIndex.
Constructors
| Glyph | |
Fields
| |
instantiatePattern :: FT_Library -> Pattern -> (Double, Double) -> IO FTFC_Instance Source #
Converts the results of a FontConfig query requesting a specific size
into a FT_Face & related properties.
Throw exceptions.
glyphForIndex :: FTFC_Instance -> Word32 -> FTFC_Subpixel -> (FT_Bitmap -> IO a) -> IO (FTFC_Glyph a) Source #
Looks up a given glyph in a FTFC_Instance & its underlying FT_Face
Taking into account additional properties from FontConfig.
Runs a provided callback to render the glyph into a reusable datastructure.
The FT_Bitmap given to this callback must not be used outside it.
Throws exceptions.
bmpAndMetricsForIndex :: FTFC_Instance -> FTFC_Subpixel -> Word32 -> IO (FT_Bitmap, FT_Glyph_Metrics) Source #
Convience API around glyphForIndex to retrieve the image & metrics of the font's glyph.