Documentation ¶
Overview ¶
Package dvi implements encoding and decoding DVI documents.
More informations about the DVI standard can be found here:
Index ¶
- Variables
- func Dump(r io.Reader, f func(cmd Cmd) error) error
- type Cmd
- type CmdBOP
- type CmdDown1
- type CmdDown2
- type CmdDown3
- type CmdDown4
- type CmdEOP
- type CmdFnt1
- type CmdFnt2
- type CmdFnt3
- type CmdFnt4
- type CmdFntDef1
- type CmdFntDef2
- type CmdFntDef3
- type CmdFntDef4
- type CmdFntNum
- type CmdNOP
- type CmdPop
- type CmdPost
- type CmdPostPost
- type CmdPre
- type CmdPush
- type CmdPut1
- type CmdPut2
- type CmdPut3
- type CmdPut4
- type CmdPutRule
- type CmdRight1
- type CmdRight2
- type CmdRight3
- type CmdRight4
- type CmdSet1
- type CmdSet2
- type CmdSet3
- type CmdSet4
- type CmdSetChar
- type CmdSetRule
- type CmdW0
- type CmdW1
- type CmdW2
- type CmdW3
- type CmdW4
- type CmdX0
- type CmdX1
- type CmdX2
- type CmdX3
- type CmdX4
- type CmdXXX1
- type CmdXXX2
- type CmdXXX3
- type CmdXXX4
- type CmdY0
- type CmdY1
- type CmdY2
- type CmdY3
- type CmdY4
- type CmdZ0
- type CmdZ1
- type CmdZ2
- type CmdZ3
- type CmdZ4
- type ColorHandler
- type Font
- type Handler
- type Machine
- type Option
- type Program
- type Renderer
Constants ¶
This section is empty.
Variables ¶
var ErrSkipHandler = errors.New("dvi: skip handler")
ErrSkipHandler is used as a return value from Handler.Handle to indicate that the Handler should be skipped and is not suited to handle that special command.
Functions ¶
Types ¶
type Cmd ¶
type Cmd interface { Name() string // contains filtered or unexported methods }
Cmd is a DVI command.
type CmdBOP ¶
type CmdFntDef1 ¶
type CmdFntDef1 struct { ID uint8 `json:"id"` Checksum uint32 `json:"chksum"` Size int32 `json:"size"` Design int32 `json:"dsize"` Area string `json:"area"` Font string `json:"name"` }
func (CmdFntDef1) Name ¶
func (CmdFntDef1) Name() string
type CmdFntDef2 ¶
type CmdFntDef2 struct { ID uint16 `json:"id"` Checksum uint32 `json:"chksum"` Size int32 `json:"size"` Design int32 `json:"dsize"` Area string `json:"area"` Font string `json:"name"` }
func (CmdFntDef2) Name ¶
func (CmdFntDef2) Name() string
type CmdFntDef3 ¶
type CmdFntDef3 struct { ID uint32 `json:"id"` Checksum uint32 `json:"chksum"` Size int32 `json:"size"` Design int32 `json:"dsize"` Area string `json:"area"` Font string `json:"name"` }
func (CmdFntDef3) Name ¶
func (CmdFntDef3) Name() string
type CmdFntDef4 ¶
type CmdFntDef4 struct { ID int32 `json:"id"` Checksum uint32 `json:"chksum"` Size int32 `json:"size"` Design int32 `json:"dsize"` Area string `json:"area"` Font string `json:"name"` }
func (CmdFntDef4) Name ¶
func (CmdFntDef4) Name() string
type CmdPost ¶
type CmdPostPost ¶
type CmdPostPost struct { BOP uint32 `json:"bop"` Version uint8 `json:"version"` Trailer uint8 `json:"trailer"` }
func (CmdPostPost) Name ¶
func (CmdPostPost) Name() string
type CmdPre ¶
type CmdPutRule ¶
func (CmdPutRule) Name ¶
func (CmdPutRule) Name() string
type CmdSetChar ¶
type CmdSetChar struct {
Value uint8 `json:"-"`
}
func (CmdSetChar) Name ¶
func (c CmdSetChar) Name() string
type CmdSetRule ¶
func (CmdSetRule) Name ¶
func (CmdSetRule) Name() string
type ColorHandler ¶ added in v0.5.0
type ColorHandler struct {
// contains filtered or unexported fields
}
ColorHandler handles special DVI commands related with colors.
func NewColorHandler ¶ added in v0.5.0
func NewColorHandler(ktx kpath.Context) *ColorHandler
func (*ColorHandler) Background ¶ added in v0.5.0
func (ch *ColorHandler) Background() color.Color
Background returns the current color background from the ColorHandler.
func (*ColorHandler) Color ¶ added in v0.5.0
func (ch *ColorHandler) Color() color.Color
Color returns the current color from the ColorHandler.
func (*ColorHandler) Handle ¶ added in v0.5.0
func (ch *ColorHandler) Handle(p []byte) error
Handle handles a special DVI command.
type Font ¶
type Font struct {
// contains filtered or unexported fields
}
Font describes a DVI font, with TeX Font Metrics and its associated font glyph data.
type Handler ¶ added in v0.5.0
Handler handles special DVI XXXn commands. Users can customize how a DVI Machine will handle these commands.
Special commands are usually written in DVI files with an opaque payload of bytes, starting with a "well known" prefix. Ex:
color push gray 0 color pop color push BurntOrange
A Handler should return ErrSkipHandler if does not know how to handle a given special command data.
type Machine ¶
type Machine struct {
// contains filtered or unexported fields
}
Machine defines a DVI machine, handling DVI registers and DVI commands.
type Option ¶
type Option func(cfg *config) error
func WithContext ¶
func WithHandlers ¶ added in v0.5.0
WithHandlers specifies a list of Handlers a DVI Machine will use to handle the XXXn special commands.