nicolasgargano / elm-escpos / Escpos.Internal

Note: you only need this module if you are writing a custom interpreter for Command.

Custom Types


type Command
    = Batch (List Attribute) (List Command)
    | Raw (List Basics.Int)
    | None
    | Write String
    | Newline
    | WriteLine String
    | HorizontalTab
    | VerticalTab
    | Initialize
    | Cut

The basic building block.


type Attribute
    = TextAttribute TextAttribute
    | AlignmentAttribute Alignment
    | WhiteOverBlack

Attributes.


type TextAttribute
    = Underline
    | Bold
    | CharacterSize CharacterSizing

Attributes that can be applied to text.


type CharacterSizing
    = Small
    | SmallDoubleWidth
    | SmallDoubleHeight
    | SmallDouble
    | Normal
    | NormalDoubleWidth
    | NormalDoubleHeight
    | NormalDouble

Size of the characters.


type Alignment
    = Left
    | Center
    | Right

How text should align. Note that you cannot have multiple alignments within the same line.

Convert

toBytes : Command -> Bytes

Convert a command to a series of bytes.