Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- data Align
- newtype Font = Font {
- fontHandle :: CInt
- data TextRow = TextRow {}
- type TextRowPtr = Ptr TextRow
- data GlyphPosition = GlyphPosition {
- str :: !(Ptr CChar)
- glyphX :: !CFloat
- glyphPosMinX :: !CFloat
- glyphPosMaxX :: !CFloat
- type GlyphPositionPtr = Ptr GlyphPosition
- safeFont :: CInt -> Maybe Font
- createFont :: Context -> Text -> FileName -> IO (Maybe Font)
- createFontAtIndex :: Context -> Text -> FileName -> CInt -> IO (Maybe Font)
- createFontMem :: Context -> Text -> ByteString -> IO (Maybe Font)
- createFontMemAtIndex :: Context -> Text -> ByteString -> CInt -> IO (Maybe Font)
- findFont :: Context -> Text -> IO (Maybe Font)
- addFallbackFontId :: Context -> CInt -> CInt -> IO (Maybe Font)
- addFallbackFont :: Context -> Text -> Text -> IO (Maybe Font)
- resetFallbackFontsId :: Context -> CInt -> IO ()
- resetFallbackFonts :: Context -> Text -> IO ()
- fontSize :: Context -> CFloat -> IO ()
- fontBlur :: Context -> CFloat -> IO ()
- textLetterSpacing :: Context -> CFloat -> IO ()
- textLineHeight :: Context -> CFloat -> IO ()
- textAlign :: Context -> Set Align -> IO ()
- fontFaceId :: Context -> Font -> IO ()
- fontFace :: Context -> Text -> IO ()
- text :: Context -> CFloat -> CFloat -> Ptr CChar -> Ptr CChar -> IO ()
- textBox :: Context -> CFloat -> CFloat -> CFloat -> Text -> IO ()
- newtype Bounds = Bounds (V4 CFloat)
- peekBounds :: Ptr CFloat -> IO Bounds
- allocaBounds :: (Ptr CFloat -> IO b) -> IO b
- textBounds :: Context -> CFloat -> CFloat -> Text -> IO Bounds
- textBoxBounds :: Context -> CFloat -> CFloat -> CFloat -> Text -> IO Bounds
- textGlyphPositions :: Context -> CFloat -> CFloat -> Ptr CChar -> Ptr CChar -> GlyphPositionPtr -> CInt -> IO CInt
- textMetrics :: Context -> IO (CFloat, CFloat, CFloat)
- textBreakLines :: Context -> Ptr CChar -> Ptr CChar -> CFloat -> TextRowPtr -> CInt -> IO CInt
- createFont'_ :: Context -> Ptr CChar -> Ptr CChar -> IO CInt
- createFontAtIndex'_ :: Context -> Ptr CChar -> Ptr CChar -> CInt -> IO CInt
- createFontMem'_ :: Context -> Ptr CChar -> Ptr CUChar -> CInt -> CInt -> IO CInt
- createFontMemAtIndex'_ :: Context -> Ptr CChar -> Ptr CUChar -> CInt -> CInt -> CInt -> IO CInt
- findFont'_ :: Context -> Ptr CChar -> IO CInt
- addFallbackFontId'_ :: Context -> CInt -> CInt -> IO CInt
- addFallbackFont'_ :: Context -> Ptr CChar -> Ptr CChar -> IO CInt
- resetFallbackFontsId'_ :: Context -> CInt -> IO ()
- resetFallbackFonts'_ :: Context -> Ptr CChar -> IO ()
- fontSize'_ :: Context -> CFloat -> IO ()
- fontBlur'_ :: Context -> CFloat -> IO ()
- textLetterSpacing'_ :: Context -> CFloat -> IO ()
- textLineHeight'_ :: Context -> CFloat -> IO ()
- textAlign'_ :: Context -> CInt -> IO ()
- fontFaceId'_ :: Context -> CInt -> IO ()
- fontFace'_ :: Context -> Ptr CChar -> IO ()
- text'_ :: Context -> CFloat -> CFloat -> Ptr CChar -> Ptr CChar -> IO CFloat
- textBox'_ :: Context -> CFloat -> CFloat -> CFloat -> Ptr CChar -> Ptr CChar -> IO ()
- textBounds'_ :: Context -> CFloat -> CFloat -> Ptr CChar -> Ptr CChar -> Ptr CFloat -> IO CFloat
- textBoxBounds'_ :: Context -> CFloat -> CFloat -> CFloat -> Ptr CChar -> Ptr CChar -> Ptr CFloat -> IO ()
- textGlyphPositions'_ :: Context -> CFloat -> CFloat -> Ptr CChar -> Ptr CChar -> GlyphPositionPtr -> CInt -> IO CInt
- textMetrics'_ :: Context -> Ptr CFloat -> Ptr CFloat -> Ptr CFloat -> IO ()
- textBreakLines'_ :: Context -> Ptr CChar -> Ptr CChar -> CFloat -> TextRowPtr -> CInt -> IO CInt
Documentation
Newtype to avoid accidental use of ints
Font | |
|
TextRow | |
|
Instances
Eq TextRow Source # | |
Ord TextRow Source # | |
Show TextRow Source # | |
Storable TextRow Source # | |
type TextRowPtr = Ptr TextRow Source #
data GlyphPosition Source #
GlyphPosition | |
|
Instances
type GlyphPositionPtr = Ptr GlyphPosition Source #
createFont :: Context -> Text -> FileName -> IO (Maybe Font) Source #
Creates font by loading it from the disk from specified file name. Returns handle to the font.
createFontAtIndex :: Context -> Text -> FileName -> CInt -> IO (Maybe Font) Source #
Creates font by loading it from the disk from specified file name. fontIndex specifies which font face to load from a .ttf/.ttc file. Returns handle to the font.
createFontMem :: Context -> Text -> ByteString -> IO (Maybe Font) Source #
Creates font by loading it from the specified memory chunk. Returns handle to the font.
createFontMemAtIndex :: Context -> Text -> ByteString -> CInt -> IO (Maybe Font) Source #
Creates font by loading it from the specified memory chunk. fontIndex specifies which font face to load from a .ttf/.ttc file. Returns handle to the font.
findFont :: Context -> Text -> IO (Maybe Font) Source #
Finds a loaded font of specified name, and returns handle to it, or -1 if the font is not found.
addFallbackFontId :: Context -> CInt -> CInt -> IO (Maybe Font) Source #
Adds a fallback font by handle.
textLetterSpacing :: Context -> CFloat -> IO () Source #
Sets the letter spacing of current text style.
textLineHeight :: Context -> CFloat -> IO () Source #
Sets the proportional line height of current text style. The line height is specified as multiple of font size.
textAlign :: Context -> Set Align -> IO () Source #
Sets the text align of current text style, see NVGalign for options.
fontFaceId :: Context -> Font -> IO () Source #
Sets the font face based on specified id of current text style.
fontFace :: Context -> Text -> IO () Source #
Sets the font face based on specified name of current text styl
text :: Context -> CFloat -> CFloat -> Ptr CChar -> Ptr CChar -> IO () Source #
Draws text string at specified location. If end is specified only the sub-string up to the end is drawn.
textBox :: Context -> CFloat -> CFloat -> CFloat -> Text -> IO () Source #
Draws multi-line text string at specified location wrapped at the specified width. If end is specified only the sub-string up to the end is drawn. | White space is stripped at the beginning of the rows, the text is split at word boundaries or when new-line characters are encountered. | Words longer than the max width are slit at nearest character (i.e. no hyphenation).
Instances
Eq Bounds Source # | |
Ord Bounds Source # | |
Read Bounds Source # | |
Show Bounds Source # | |
Storable Bounds Source # | |
textBounds :: Context -> CFloat -> CFloat -> Text -> IO Bounds Source #
Measures the specified text string. Parameter bounds should be a pointer to float[4], if the bounding box of the text should be returned. The bounds value are [xmin,ymin, xmax,ymax] Returns the horizontal advance of the measured text (i.e. where the next character should drawn). Measured values are returned in local coordinate space.
textBoxBounds :: Context -> CFloat -> CFloat -> CFloat -> Text -> IO Bounds Source #
Measures the specified multi-text string. Parameter bounds should be a pointer to float[4], if the bounding box of the text should be returned. The bounds value are [xmin,ymin, xmax,ymax] Measured values are returned in local coordinate space.
textGlyphPositions :: Context -> CFloat -> CFloat -> Ptr CChar -> Ptr CChar -> GlyphPositionPtr -> CInt -> IO CInt Source #
Calculates the glyph x positions of the specified text. If end is specified only the sub-string will be used. Measured values are returned in local coordinate space.
textMetrics :: Context -> IO (CFloat, CFloat, CFloat) Source #
Returns the vertical metrics based on the current text style. Measured values are returned in local coordinate space.
textBreakLines :: Context -> Ptr CChar -> Ptr CChar -> CFloat -> TextRowPtr -> CInt -> IO CInt Source #
Breaks the specified text into lines. If end is specified only the sub-string will be used. White space is stripped at the beginning of the rows, the text is split at word boundaries or when new-line characters are encountered. Words longer than the max width are slit at nearest character (i.e. no hyphenation).
createFontMemAtIndex'_ :: Context -> Ptr CChar -> Ptr CUChar -> CInt -> CInt -> CInt -> IO CInt Source #
textBounds'_ :: Context -> CFloat -> CFloat -> Ptr CChar -> Ptr CChar -> Ptr CFloat -> IO CFloat Source #
textBoxBounds'_ :: Context -> CFloat -> CFloat -> CFloat -> Ptr CChar -> Ptr CChar -> Ptr CFloat -> IO () Source #