nanDECK Version 1.26.2

Hello everybody, I’ve released a new version of nanDECK, with bugs fixed and these new features:

New HTMLBORDER directive

This directive adds a border to a font tag (defined by an HTMLFONT), usable with HTMLTEXT. The syntax is:

HTMLBORDER = htmlfont, type, html color, thickness, gap top, gap left, gap right, gap bottom, corner rounding, html color background


[text]="The brown fox (fox) jumps over the lazy dog (dog)."


New FLAGS directive

This directive sets the flags for all the directives in the script. So, for example, if you want to add BE flags in every HTMLTEXT lines, you can use a single FLAGS instead of changing every lines.

The syntax is:

FLAGS = range, directive, flags

If you want to remove a flag instead of adding, use the “-” symbol before it.



htmltext=1-3,"This is a test.",0,0,100%,100%,#FFFFFF,0,,100,default

The result is a plain text in the 1st card, bold and italic in the 2nd, and bold and underlined in the 3rd.

New LINKFILL directive

This directive is used when you have a schema on several rows in a spreadsheet and you want to straighten it in a single row (using the first line to specify the total number of columns that will be filled with the cells); this directive must be used before the LINK command.


LINKFILL = switch


switch: values accepted are:

ON to enable the redistribution of the cells
OFF to disable the redistribution of the cells (the default)

New EXPRESSION directive

This directive specifies the characters used to define expressions to be evaluated in texts in HTMLTEXT and RTFTEXT directives.


EXPRESSION = exp. HTML start, exp. HTML end, exp. RTF start, exp. RTF end


exp. HTML start: character(s) used to define start of expressions in HTMLTEXT directive,

exp. HTML end: character(s) used to define end of expressions in HTMLTEXT directive,

exp. RTF start: character(s) used to define start of expressions in RTFTEXT directive,

exp. RTF end: character(s) used to define end of expressions in RTFTEXT directive,

New CALC function

This function is used to get a result from a specific trigonometric function. The syntax is:

[label] = CALC(flag, value1, value2)

You can choose one of these flags:

C cosine function of value1
S sine function of value1
T tangent function of value1
P pi function (the other parameters are not used)
M the higher between value1 and value2
N the lower between value1 and value2

New FRAMEMAZE function

This function reads a list of edge frames, as 1st parameter (created with a FRAMEPER function), and creates another list of edge frames, arranged as a maze. The 2nd and 3rd parameters are the width and height of the rectangle defined by the edge frames. You can specify the coordinates of the starting cell (as 4th and 5th parameter), otherwise it is randomly selected (this also when set to zero); the ending cell is selected as the farthest from the starting one. The syntax is:

[newframe] = FRAMEMAZE(frames, width, height, X start cell, Y start cell, flags)

You can use these flags in the 6th parameter:

S is created a group of frames for the solution
M is created a group of frames with the sequence used in the creation of the maze
E the exit is along the edge of the maze

At the end of the process other two frames are created, one for the starting cell (with postfix start) and one for the ending cell (with postfix end); if the S flag is used is created also a group of frames for the solution (with postfix solution), i.e. the path from the starting to the ending cell; if the E flag is specified is created also two frames for the edge of the starting cell (with postfix startedge) and for the ending cell (with postfix endedge); if the M flag is specified is created also a group of frames with the sequence used for creating the maze (with postfix map).

This example creates two cards, one with the maze, starting and ending cells, and one that adds the solution:

[x] = 20
[y] = 20
CARDSIZE = [x], [y]
[cell] = FRAMEBOX(0, 0, [x], [y], 1, 1)
[edge] = FRAMEPER(cell, 0.1)
[maze] = FRAMEMAZE(edge, [x], [y], 0, 0, S)
RECTANGLE = 2, <mazesolution>, #FFFF00
ELLIPSE = 1-2, <mazestart>, #FF0000
ELLIPSE = 1-2, <mazeend>, #00FF00
RECTANGLE = 1-2, <maze>, #0000FF
FONT = Arial, 10, T, #000000
TEXT = 2, {°}, <mazesolution>

Added parameter in COOICON for the icon index

If the result of the COOICON function corresponds to multiple icons, you can use the 5th parameter to select one of these.

Added parameters in ORIGIN for the % of the cards

The 4th parameter in ORIGIN sets the value in % for the width of the card (the default is 100), similarly, the 5th parameter is for the height.

Added parameter in SAVE for depth of saved files

The 12th parameter in SAVE sets the depth of the saved image, and can be set equal to:

24 16 millions of colors (the default)
16 65536 colors
8 256 colors
4 16 colors

Added parameter in FONT, FONTRANGE, and TEXTFONT for the spacing of circular text

The default behavior for the circular text is to justified. With this parameter you can specify the actual spacing between characters (zero, or a positive/negative value in cm or the current unit); note that with this parameter is used the horizontal alignment (left/center/right). This parameter is present in FONT (10th), FONTRANGE (11th), or TEXTFONT (19th).

Added J/G flags in HTMLTEXT for enlarging/evening lines of text

The F flag is currently use to shrink a font if text is not contained in the HTMLTEXT rectangle; similarly, a J flag enlarge a font until the text is not contained in the HTMLTEXT rectangle. The G flag reduces the width of the text to obtains lines of the same width.

Added W/V/F flags in HTMLFONT for upper/lower/firstcase of text

W the text is converted to upper case
V the text is converted to lower case
F the first letter of the text is converted to upper case, the others to lower

Added H/V flags in CANVAS for centering the canvas in the cards

The default for the cutting of the canvas images in single cards is to align to the top-left corner, with these flags the images are centered.

And some features in the editor:
F11 on a font name shows you the next one (CTRL+F11 for the previous one),
F12 opens the reference (and download it if the file is not present).

nanDECK guild on BGG:

nanDeck Users

nanDECK Version 1.26.1

Hello everybody, there is a new version of nanDECK, with bugs fixed and these new features:

New PAGESHAPE directive

This directive draws lines, rectangles and ellipses directly in a page (therefore there isn’t a range parameter, and a 100% here refers to the whole page, not to the card). The syntax is:

PAGESHAPE = x, y, width, height, flags, color

You can add several flags (each one is a format or a shape):

A) draw a rectangle
I) draw an ellipse

S) set solid background
M) set empty background

0) set solid edge
1) set dotted edge
2) set dashed edge
3) set dash+dot pattern for edge
4) set dash+dot+dot pattern for edge

T) draw a line in the top side of the rectangle
R) draw a line in the right side of the rectangle
B) draw a line in the bottom side of the rectangle
L) draw a line in the left side of the rectangle
H) draw an horizontal line in the middle of the rectangle
V) draw an vertical line in the middle of the rectangle
D) draw a diagonal line in the rectangle
G) draw a diagonal line (reversed) in the rectangle

E) do not draw the shape on even pages
O) do not draw the shape on odd pages



There is a rectangle at 1cm from the border, and four red circles. Note that MA means: set empty (M), then draw a rectangle (A), the reverse AM would have drawn a filled rectangle.

New DEPTH directive

With this directive you can specify a lower number of colors for the cards (to save RAM occupation), this is the syntax:

DEPTH = range, depth

Where depth can be:
24 = 16 millions colors (the default)
16 = 65,536 colors
8 = 256 colors
4 = 16 colors

New PDFMERGE function

This function is equivalent to the MERGEPDF directive, it was added for use in a loop. For example, this line splits a pdf in single pages:

[pdf]%,(a),1,PDFPAGES(nandeck-manual.pdf) = PDFMERGE(split(a).pdf,nandeck-manual.pdf,(a))

Added parameters in TEXT for stretching text

The 14th and 15th parameters in TEXT can be used for stretching texts horizontally and vertically. Example:

[text]="The brown fox jumps over the lazy dog."

Added X/Y flags in FONT directory for shrinking/stretching texts

These flags do an automatic shrinking/stretching of text. If you add an X flag to FONT, the text is shrinked if too large to fit the rectangle, and if you add an Y flag to FONT, the text is stretched if too small to fit the rectangle. Example:

text=1,"Test Test Test Test",10%,30%,80%,15%

Added parameter in LOADPDF for angle

The 9th parameter of the LOADPDF directive can be used to specify the angle of the rotation of the page loaded from a PDF.

Added parameter in DICE directive for number of rerolls

The 8th parameter specifies how many times the dice are rerolled if is obtained a result marked with “**” (in the list of possible values).

Added T flag in FRAMEHEX function for removing last hexes

This flag removes the last hex from a shifted column (or row) of hexes. Example:


Added “all” button in the interface

This button open all the scripts in a folder, in multiple tabs.

Added hint lines in the preview area

If you put the cursor in the preview area (right top) or the preview window, you see an hint with the line and directive of the element(s) under the cursor.

Added CTRL+click in the preview area

If CTRL+click on an element in the preview area or the preview window, the cursor in the text editor is moved to the correspondent line.

nanDECK Version 1.26

Hello everybody, a new version of nanDECK is available, with bugs fixed and new features:

New CMYK directive

The CMYK command has this syntax:

CMYK = Range, ON/OFF, ICC profile

The ON flag enable the CMYK color profile when saving .jpg images, and optionally you can specify an .icc / .icm color profile (or another .jpg to read its profile).

New TAGS directive

This directive creates a rule that is evaluated in the Simulator (a new feature, albeit still basic). The rule can contain series of letters of numbers, with this syntax:

  • one or more “$” symbol, then letters to define a tag’s value that is present, using the same letter means that the same element is present with that number of copies,
  • one or more “£” symbol, then numbers to define the difference between the values of tag when multiple copies are present (i.e. in a straight); with the !N>M syntax is defined that a tag with value N is treated also like M (i.e. the ace in a straight can be positioned before the 2 or after the King),
  • one or more “=” symbol, then one or more tags that must be present.

You can specify more than one rule for a single directive, all of which will be evaluated at the same time, by separating each rule (and each tag) with the pipe character “|”.

Example (poker probability):

tags=suite|value,$aaaaa|==1011121301,Royal flush
tags=suite|value,$aaaaa|£1111!1>14,Straight flush
tags=value,$aaaab,Four of a kind
tags=value,$aabbb,Full house
tags=value,$aaabc,Three of a kind
tags=value,$aabbc,Two pairs
tags=value,$aabcd,One pair
tags=value,$abcde,No pair

New RANGELABEL function

This function converts a sequence of numbers into a range:

[label] = RANGELABEL([sequence])

New RANGEMERGE function

This function creates a new range mixing the cards from two or more ranges:

[range] = RANGEMERGE(“range1”, “range2″, …”rangeN”)

Added parameters in DISPLAY directive for transparency


DISPLAY = “image file”, first card, last card, width, “range”, transparent color, “mask file”

The last two parameters can be used to save an image file with a transparency, and are used the same way as the parameters in SAVE directive.

Added parameters in SAVEPAGES directive for CMYK format


SAVEPAGES = “filename”, switch, color profile

Switch and color profile are the same as in CMYK directive.

Added V, S, C, and E flags in BATCH directive

The flag added after the batch specifies when the batch is executed, i.e.:

V the batch is executed at the validation step
S the batch is executed at the start of the build step
C the batch is executed at the end of each built card
E the batch is executed at the end of the build step

Added D flag in HTMLIMAGE to disable size adjustment

Usually the images in the HTMLIMAGE directive are drawn rescaled in HTMLTEXT (if using the F flag), with the D flag that behavior is disabled (and the images are drawn with the size specified).

Added H flag in HTMLIMAGE to disable vertical spacing

If the height of an image in HTMLIMAGE directive is higher than a character in HTMLTEXT, the lines are drawn with more space between each other, instead with the H flag the lines are drawn more closer.

nanDECK version 1.25.3

Hello everybody, there is a new version of nanDECK, with bugs fixed and these new features:

New MERGEPDF directive

This directive merges two or more PDF files, the syntax is:

MERGEPDF = “result file”, “source file”, “page range”, page rotation

The 2nd, 3rd and 4th parameters can be sequences.

New IMAGELIMIT directive

This directive detects the limits of an image over a background color, the syntax is:

IMAGELIMIT = “range”, pos x, pos y, width, height, html color, threshold

The limits are loaded in the variables PL (left), PR (right), PT (top) and PB (bottom).

New LINKFONT directive

This directive adds a couple of HTML tag when a different font is read from a cell in a linked spreadsheet, the syntax is:


New LINKSPLIT directive

This directive is used to read each line from a linked file as two different lines, the syntax is:

LINKSPLIT = every row, odd rows, even rows

The parameters can be sequences.

New FRAMEIMAGE function

This function creates a list of frames from a source list and an image, this is a thread about it:

A new function: FRAMEIMAGE

Added A and R flags in BRUSH directive for bitmap positioning

Added C and I flags in REPLACE function for case replacement

Added multiple body parameters in SCHEMA function

Added a sequence as 3rd parameter in EXPAND function

Code your graphics