handwriting-0.1.0.3: API Client for the handwriting.io API.

Copyright(C) 2016 Ismail Mustafa
LicenseBSD-style (see the file LICENSE)
MaintainerIsmail Mustafa <ismailmustafa@rocketmail.com
Stabilityprovisional
PortabilityOverloadedStrings
Safe HaskellNone
LanguageHaskell2010

Network.Handwriting

Contents

Description

API Client for the handwriting.io API.

Synopsis

Endpoints

getHandwriting :: Credentials -> String -> IO Handwriting Source

Get a single handwriting by id.

import Network.Handwriting
creds :: Credentials
creds = Credentials "key" "secret"

main :: IO ()
main = do
    handwritings <- getHandwritings creds "31SF81NG00ES"

getHandwritings :: Credentials -> IO [Handwriting] Source

Get a list of all Handwritings.

import Network.Handwriting
creds :: Credentials
creds = Credentials "key" "secret"

main :: IO ()
main = do
    handwritings <- getHandwritings creds

renderImage :: Credentials -> ImageParams -> String -> IO ByteString Source

Get a handwriting image as either a PDF or PNG.

import Network.Handwriting
creds :: Credentials
creds = Credentials "key" "secret"

main :: IO ()
main = do
    let params = defaultImageParams {format = PDF}
    imageByteString <- renderImage creds params "Hello World!"

Types, DataTypes, and Utilities

type Color = (Word8, Word8, Word8) Source

Color type representing (R,G,B).

data Credentials Source

Credentials that take and key and secret token.

Constructors

Credentials 

defaultImageParams :: ImageParams Source

Default image parameters provided for convenience.

data Format Source

Format determines rendered image format in either png or pdf.

Constructors

PNG 
PDF 

Instances

data Handwriting Source

Handwriting data type that contains all the information about a specific handwriting style.

Instances

Show Handwriting Source

Pretty print the handwriting data type.

Generic Handwriting Source 
ToJSON Handwriting Source 
FromJSON Handwriting Source

Handwriting JSON instance.

type Rep Handwriting Source 

data ImageParams Source

Optional image parameters that dictate different properties of the rendered image.

data PDFUnits Source

PDFUnits is used to specify measurements when rendering a PDF.

Constructors

Points 
Inches 

Instances

data RandomSeed Source

RandomSeed is used to specify if every rendered image called with the same parameters should render differently or the same each time.

Constructors

Randomize 
Repeatable