Skip to content

global vf

The vf library can be used when Lua code, as defined in the commands of the font, is executed. The functions provided are similar as the commands: char, down, fontid, image, node, nop, pop, push, right, rule, special and pdf. This library has been present for a while but not been advertised and tested much, if only because it's easy to define an invalid font (or mess up the PDF stream). Keep in mind that the Lua snippets are executed each time when a character is output.

😱 Types incomplete or incorrect? πŸ™ Please contribute!


methods


vf.char


function vf.char(n: integer)

Typeset a character from the current font, and move right by the character’s width.

Reference:

vf.down


function vf.down(down: integer)

Move down on the page.

vf.fontid


function vf.fontid(fontid: integer)

Reference:

vf.image


function vf.image(image: (Image|ImageSpec))

Output an image (the argument can be either an image variable or an image_spec table)

Reference:

vf.node


function vf.node(list: Node {
    next = Node?,
    prev = Node?,
    id = integer,
    subtype = integer,
    head = Node?,
    attr = Node,
})

Output this node (list), and move right by the width of this list.

Reference:

vf.nop


function vf.nop()

Do nothing.

Reference:

😱 Types incomplete or incorrect? πŸ™ Please contribute!

vf.pop


function vf.pop()

Pop position.

Reference:

😱 Types incomplete or incorrect? πŸ™ Please contribute!

vf.push


function vf.push()

Save the current position.

Reference:

😱 Types incomplete or incorrect? πŸ™ Please contribute!

vf.right


function vf.right(right: integer)

Move right on the page.

vf.rule


function vf.rule(
  height: integer,
  width: integer
)

Output a rule (height * width) and move right.

Reference:

vf.special


function vf.special(special: string)

Output a \special command.

vf.pdf


function vf.pdf(
  mode: unknown,
  general_text: string
)

Output a pdf literal.

The first string is one of origin, page, text, font, direct or raw

Reference:

vf.pdf


function vf.pdf(general_text: string)

Output a pdf literal.

If you have one string only origin is assumed.

Reference: