monomer-1.6.0.0: A GUI library for writing native Haskell applications.
Copyright(c) 2018 Francisco Vallarino
(c) 2016 Moritz Kiefer
LicenseBSD-3-Clause (see the LICENSE file)
Maintainerfjvallarino@gmail.com
Stabilityexperimental
Portabilitynon-portable
Safe HaskellSafe-Inferred
LanguageHaskell2010

Monomer.Graphics.FFI

Description

Provides functions for getting text dimensions and metrics.

Based on code from cocreature's https://github.com/cocreature/nanovg-hs

Synopsis

Documentation

data V4 a Source #

Vector of 4 strict elements.

Constructors

V4 !a !a !a !a 

Instances

Instances details
Read a => Read (V4 a) Source # 
Instance details

Defined in Monomer.Graphics.FFI

Show a => Show (V4 a) Source # 
Instance details

Defined in Monomer.Graphics.FFI

Methods

showsPrec :: Int -> V4 a -> ShowS #

show :: V4 a -> String #

showList :: [V4 a] -> ShowS #

Eq a => Eq (V4 a) Source # 
Instance details

Defined in Monomer.Graphics.FFI

Methods

(==) :: V4 a -> V4 a -> Bool #

(/=) :: V4 a -> V4 a -> Bool #

Ord a => Ord (V4 a) Source # 
Instance details

Defined in Monomer.Graphics.FFI

Methods

compare :: V4 a -> V4 a -> Ordering #

(<) :: V4 a -> V4 a -> Bool #

(<=) :: V4 a -> V4 a -> Bool #

(>) :: V4 a -> V4 a -> Bool #

(>=) :: V4 a -> V4 a -> Bool #

max :: V4 a -> V4 a -> V4 a #

min :: V4 a -> V4 a -> V4 a #

newtype Bounds Source #

Bounds of a block of text.

Constructors

Bounds (V4 CFloat) 

Instances

Instances details
Storable Bounds Source # 
Instance details

Defined in Monomer.Graphics.FFI

Read Bounds Source # 
Instance details

Defined in Monomer.Graphics.FFI

Show Bounds Source # 
Instance details

Defined in Monomer.Graphics.FFI

Eq Bounds Source # 
Instance details

Defined in Monomer.Graphics.FFI

Methods

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

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

Ord Bounds Source # 
Instance details

Defined in Monomer.Graphics.FFI

data GlyphPosition Source #

Position of a glyph in a text string.

Constructors

GlyphPosition 

Fields

peekBounds :: Ptr CFloat -> IO Bounds Source #

Reads Bounds from a pointer.

allocaBounds :: (Ptr CFloat -> IO b) -> IO b Source #

Allocates space for Bounds.

withCString :: Text -> (CString -> IO b) -> IO b Source #

withText :: Text -> (CString -> IO b) -> IO b Source #

withNull :: (Ptr a -> b) -> b Source #

Marshalling helper for a constant nullPtr

type CUStringLen = (Ptr CUChar, CInt) Source #

Same as CStringLen, but for strings of unsigned char* array type.

useAsCUStringLen :: ByteString -> (CUStringLen -> IO a) -> IO a Source #

Same as useAsCStringLen, but works with unsigned char* arrays.

allocCUStringLen :: ByteString -> (CUStringLen -> IO a) -> IO a Source #

Same as useAsCUStringLen, but copies the underlying memory, leaving freeing it to the C code.

copyCUStringLenMemory :: CUStringLen -> IO CUStringLen Source #

Copy memory under given pointer to a new address. The allocated memory is not garbage-collected and needs to be freed manually later.

newtype FMContext Source #

Constructors

FMContext (Ptr FMContext) 

Instances

Instances details
Storable FMContext Source # 
Instance details

Defined in Monomer.Graphics.FFI