nanDECK Version 1.28

Hello everyone, a new version of nanDECK is available, with bug fixes and these new features:

New MODULEPDF directive

This directive adds an editable field to a (pre-existing) PDF file, this is the syntax:

MODULEPDF = "pdf result", "pdf source", page, pos x, pos y, width, height, "default", horizontal alignment, multiline ON/OFF, transparent ON/OFF

The font parameters (name, size and colors) are read by the last FONT line. Example:

font=arial,12,,#FF0000,#00FF00
modulepdf="result.pdf","source.pdf",1,1,1,10,2
font=times new roman,20,,#00FF00,#FF0000
modulepdf="result.pdf","source.pdf",1,1,5,10,4,"Two",CENTER,ON
font=arial,12,,#FF0000,#00FF00
modulepdf="result.pdf","source.pdf",2,1,10,10,2,"Three",RIGHT,OFF,ON

New PAGETEXT directive

This directive writes a text directly in a page (therefore there is not a range parameter, and a 100% here refers to the whole page, not to the card). The font can be specified with a PAGEFONT directive. The syntax is:

PAGETEXT = pos x, pos y, width, height, flags, text, angle

New PAGEBREAK directive

This directive indicates a sequence whose values ​​are associated with the cards. Every time the corresponding value changes between one card and another, a page break is added to the printout. The syntax is:

PAGEBREAK = "values"

New SEED directive

By default, random numbers are generated randomly, but using this directive the sequence of random numbers will be fixed, different depending on the number used as a parameter. This seed number can be set with this directive, or from Config -> Main. The syntax is:

SEED = seed number

New SEEDRANGE directive

It works the same way as SEED, but has a parameter for the application range. The syntax is:

SEEDRANGE = "range", seed number

New LINKREP directive

This directive is used to replace a string with another when reading data from a LINKed file (you can use muliple LINKSEPs before the LINK line). The syntax is:

LINKREP = "from", "to"

New LINKCSV directive

This directive modifies the encoding of csv files read with a LINK directive. If not used, the default is ANSI encoding. The syntax is:

LINKCSV = encoding

The encoding parameter can be ANSI, UTF7, UTF8, UTF16, or UTF16BE.

New PDFMODULE function

This function works the same way as the MODULEPDF directive.

New FILEREAD function

This function creates a label by reading the content from a text file on disk, this is the syntax:

[name] = FILEREAD(filename)

New INFOFILE function

This function returns information read from the file indicated among the parameters, the syntax is:

[name] = INFOFILE(flag, filename)

The flag can be one of this:

E the function returns 1 for file present, 0 for file not present
W return the width of the image file
H return the height of the image file

New RANGETRANS function

This function shifts the values contained in a range by a certain offset (positive or negative), this is the syntax:

[range] = RANGETRANS("range", offset)

New RANGEREP function

This function replaces empty values (-1) from range1 with other values from range2, … rangeN, this is the syntax:

[range] = RANGEREP("range1", "range2", ..."rangeN")

Added different types, colors, thicknesses, and corners for HTMLBORDER

For type, html color, thickness, and corner rounding parameters in HTMLBORDER you can now specify a sequence of two, three, or four values, that are used for drawing different edges (type, html color, and thickness) or corners (corner rounding). Example:

[text]="Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."
htmlfont=font_t,arial,8,,#000000,justify,0,0,0,,,0,5%
htmlmargins=font_t,5%,5%,5%,5%,top
htmlborder=font_t,rectangle|dotted,#0000FF|#FF0000,2%|1%,5%,5%,5%,5%
htmlfont=font_c,arial,8,,#000000,justify,0,0,0,,,0,5%
htmlmargins=font_c,5%,5%,5%,5%,center
htmlborder=font_c,rectangle|dashed,#0000FF|#FF0000,2%|1%,5%,5%,5%,5%
htmlfont=font_b,arial,8,,#000000,justify,0,0,0,,,0,5%
htmlmargins=font_b,5%,5%,5%,5%,bottom
htmlborder=font_b,rectangle|double,#0000FF|#FF0000,2%|1%,5%,5%,5%,5%
htmltext=1-{(text)},[text],0,0,100%,100%,#FFFFFF,0,BE,100,font_t
htmltext=1-{(text)},[text],0,0,100%,100%,#FFFFFF,0,BE,100,font_c
htmltext=1-{(text)},[text],0,0,100%,100%,#FFFFFF,0,BE,100,font_b

Added parameters in HTMLFONT/HTMLIMAGE to add CSS styles

Now you can directly insert CSS elements into the HTMLFONT (17th parameter) and HTMLIMAGE (16th parameter) directives.

Added parameter in LINE/LINERECT to set distance for elements

For LINE/LINERECT patterns it is possible to specify the distance between the elements. Example:

line=1,0,0,100%,20%,#FF0000,3%,O
line=1,0,20%,100%,40%,#FF0000,3%,O,0,0,0,0,0.1
line=1,0,40%,100%,60%,#FF0000,3%,O,0,0,0,0,0.5
line=1,0,60%,100%,80%,#FF0000,3%,O,0,0,0,0,1
line=1,0,80%,100%,100%,#FF0000,3%,O,0,0,0,0,1.5

Added parameter in ICONS to specify a frame list for icons

With ICONS you can now indicate the positions where icons should be drawn by specifying a group of frames. Example:

[frames1]=framehex(10%,10%,80%,80%,10%,N)
[frames2]=frameclock(10%,10%,80%,80%,20%,20%,12)
icon=,A,test121_a.png
icon=,B,test121_b.png
icon=,C,test121_c.png
icons=1,AABBCCABCABC,0,0,100%,100%,10%,10%,0,PN,center,center,100,1,100,100,frames1*
icons=2,AABBCCABCABC,0,0,100%,100%,10%,10%,0,PN,center,center,100,1,100,100,frames2*

Added 1/2 flags in HTMLFONT to add list format

Flag 1 adds the HTML tags for a bulleted list to a list of paragraphs, flag 2 does the same for a numbered list. Example:

[text]="First element<br>Second element<br>Third element<br>Fourth element<br>Fifth element"
htmlfont=font1,arial,12,1,#FF0000
htmlfont=font2,arial,12,2,#0000FF
htmltext=1,[text],0,0,100%,50%,#FFFFFF,0,BE,100,font1
htmltext=1,[text],0,50%,100%,50%,#FFFFFF,0,BE,100,font2

Added F flag to HTMLKEY to apply font only to replaced text
Added parameters in HTMLKEY to replace strings

The syntax of HTMLKEY now is:

HTMLKEY="range", key, "text", htmlfont, flag CRFZD, "replace", "from", "to"

If the F flag is present in addition to the R flag, the font specified in the fourth parameter is applied only to the replaced text.

In the result found with the R flag, the text specified in the “from” parameter is replaced with the text in the “to” parameter; both can also be a sequence of texts.

Added L flag to ICONS to keep icons in a single line

In ICONS, with the W and H parameters the icons are arranged so as to occupy the entire space, normally on multiple lines (e.g. four icons are arranged in a two by two square); with the L flag this arrangement is forced onto one line.

Added X flag to ICONS to use keys with variable length

In ICONS the X flag must be used when the keys defined with the ICON command do not always have the same length (the 14 parameter is not used). Note that in this case there cannot be keys of different lengths that start with the same letter, e.g. A and AB.

Added U flag in PAGE directive to draw edges over guidelines

Normally, the sections of the page indicated by the edge parameters of the PAGE directive are drawn below the guidelines; adding the U flag causes them to be drawn above.

Added LINE, LINEDOT, LINEDASH types of guidelines in BORDER
Added parameter in BORDER for the thickness of guidelines

Three new styles can be used for the guidelines (LINE, LINEDOT, LINEDASH), also for all the guidelines the thickness can be indicated, and for each guideline a different color can be used (when the ninth parameter has a value greater than 0). Example:

page=21,29.7,portrait,hv
border=none,#000000,0,line,#FF0000#0000FF#FF0000,0.2,0.5,0.5,1,0,0,0.05
gap=0.5,0.5
font=arial,64,,#000000,#FFFF00
text=1-9,{§},0,0,100%,100%

Result (detail):

Added parameters in HTMLTEXT to change text width and height

The fourteenth and fifteenth parameters in HTMLTEXT can be used to change the width and height of the text (100 is the default value). Example:

htmlfont=default,arial,24,,#000000,center
htmlmargins=default,0,0,0,0,center
htmltext=1,"Lorem ipsum",0,0,100%,33%,#FFFFFF,0,BE,100,default
htmltext=1,"Lorem ipsum",0,33%,100%,33%,#FFFFFF,0,BE,100,default,,,150,50
htmltext=1,"Lorem ipsum",0,66%,100%,33%,#FFFFFF,0,BE,100,default,,,50,150

Result:

Added parameter in IMAGEFILTER to draw images with a transparency mask

If a png file is specified in the third parameter of IMAGEFILTER, its transparency layer is applied to all image operations. Example (the mask.png file is transparent at the edges and opaque in the center, in the shape of a rounded rectangle):

htmlfont=default,arial,32,,#FFFFFF,center
htmlmargins=default,0,0,0,0,center
htmltext=1,"Lorem Ipsum",0,0,100%,33%,#0000FF,0,E,100,default
imagefilter=lanczos,solid,"mask.png"
htmltext=1,"Lorem Ipsum",0,33%,100%,33%,#0000FF,0,E,100,default
imagefilter=lanczos,solid,""
htmltext=1,"Lorem Ipsum",0,66%,100%,33%,#0000FF,0,E,100,default

Result:

Note that to return to normal you need to use IMAGEFILTER with an empty parameter

Added I flag in TABLE to draw proportionally the canvas

Normally the canvas is drawn on the entire screen of the virtual table, if the I flag is added instead the proportions between the dimensions are maintained.

Added U/D flags in DECK for specifying if the deck is face up/down

This is used to indicate whether a specific deck should be placed face up or down (the default) on the virtual table.

Added F/B flags in TOKEN to set token in front/back

In the virtual table, tokens created with the TOKEN directive can be placed in front (flag F) or behind (flag B) the cards.

Added 2 flag to HEXGRID for interlaced coordinates
Added 2 flag to FRAMEHEX for interlaced coordinates

Interlaced coordinates, unlike other systems, allow you to always use the same rule to move from one hexagon to another, as you can see in this example:

font=arial,12,,#000000
hexgrid=1,0,0,100%,50%,10%,C.,#000000,empty,0.5%
hexgrid=1,0,50%,100%,50%,10%,2.,#000000,empty,0.5%

Added parameter in CMYK to select the colorspace

the fourth parameter in CMYK allows you to choose one of these colorspaces: AUTO/GRAY/RGB/CMYK/YCBCR/YCBCRK/YCCK (it should be indicated when the image is not displayed correctly).

Added parameter in INDEX function to find other occurrences

The syntax of the INDEX function is now:

[label]=INDEX(substring, string, number)

If the number parameter is 1, the first occurrence of the substring is found, if it is 2, the second, and so on. If it is -1, the first occurrence from left to right, if it is -2, the second, and so on.

Added number option in LINKMULTI directive

In the past, LINKMULTI had to refer to a column in the spreadsheet, now if you want each row to be reproduced multiple times, you can use LINKMULTI=number, where number is 2 to double the rows, 3 to triple them, and so on.

Added parameter in SPECIAL for line division

You can use the character ¶ to write a line of code, which will be split into two (or more) lines at execution. The fourth parameter of the SPECIAL directive allows you to change this special character.

Added * in script parameter to NANDECK directive for concurrent execution

Normally the NANDECK directive waits for the end of execution before continuing with the next line of the script; adding the * character to the parameter indicating the script to be executed will cause this to be executed in parallel, and therefore the next line of the current script will be executed immediately.

Added new rules in DECK directive

MAX1->FRAMRfrm if the item is moved in a frame already occupied, the occupying item is moved in the frame named frm; if you specify more than one frame, is used a random one from the list of frames
DRAW->FRAMEfrm when a card is drawn from a deck, is placed in the frame named frm; if you specify more than one frame, is used the first free from the list of frames
DRAW->FRAMRfrm when a card is drawn from a deck, is placed in the frame named frm; if you specify more than one frame, is used a random one from the list

Added option in Insert Label to perform a conversion using SEQUENCE

Added “Convert to SEQUENCE” option when inserting a label (F8), which allows you to select a label and convert its contents into lines of a SEQUENCE..ENDSEQUENCE structure.

nanDECK Version 1.27.3

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

New features for HTMLIMAGE

The syntax now is:

HTMLIMAGE="range", key, "image file", width, height, flags, angle, margin top, margin left, margin right, margin bottom, alpha, htmlfont, pos X, pos Y

In the 12th parameter you can specify the transparency level of the image, from 100 (solid) to 0 (full transparent).

With the G flag you can add a text to be drawn over the image, for example if you have specified (deer) as tag, the tag (deerText) writes the word “Text” over the image.

With the U flag the text is draw under the image.

In the 13th parameter you can specify a different font (defined with HTMLFONT) to be used for the text.

In the 14th and 15th parameters you can specify the position of the text relative to the image (50,50 is the default, i.e. the center of the image).

Example:

htmlfont=font1,arial,16,,#000000
htmlfont=font2,arial,16,,#FF0000
htmlimage=,(d1),deer.png,20%,20%,P
htmlimage=,(d2),deer.png,20%,20%,P,0,0,0,0,0,50
htmlimage=,(d3),deer.png,20%,20%,PG
htmlimage=,(d4),deer.png,20%,20%,PG,0,0,0,0,0,100,font2
htmlimage=,(d5),deer.png,20%,20%,PGU
htmltext=1,"Alpha (d1)(d2).",0,0,100%,20%,#FFFFFF,0,BE,100,font1
htmltext=1,"Text (d3One)(d4Two)(d5Three).",0,20%,100%,20%,#FFFFFF,0,BE,100,font1

From gallery of n_and

New BACKGROUND directive

This directive draws an image using gradients created from colors read from rectangular or circular areas (specified by frames, see page 45). For this directive you can use frames defined with the standard syntax, or use this special syntax:

<frame> = x, y, width, height, special

The special parameter can be composed of one or more colors, defined with one of these syntaxes:
#000000 is a color,
#000000%A is a color where A is the % distance from the original frame,
#000000%A$B is a color where A is the % distance from the original frame and B is a factor used to calculate the weight of this color.
If you add a @ symbol to the end of the special parameter the color changes will be made from a circular shape rather than a rectangular one. If you add a ! symbol to the start of the special parameter the background is drawn also inside this shape.

Syntax:

BACKGROUND = "range", pos x, pos y, width, height, frames, flags, width, red, green, blue

“range”: a set of cards

pos x: horizontal position (in cm)

pos y: vertical position (in cm)

width: width of the rectangle (in cm)

height: height of the rectangle (in cm)

frames: the name of the frame(s) used for reading the colors

flags: one or more of the following flags:

And the distances are measured using an “Euclidean” formula (square root and powers), this is the default
M the distances are measured using a “Manhattan” formula (absolutes differences)
S the variation specified with red/green/blue parameters is applied when there are more than half distances between the frames that are greater than the parameter distance
I the color variation specified with red/green/blue parameters is applied when there are less than half distances between the frames that are greater than the parameter distance
N the color variation specified with red/green/blue parameters is applied when the number of distances between the frames that are greater than the parameter distance is an even number
O the color variation specified with red/green/blue parameters is applied when the number of distances between the frames that are greater than the parameter distance is an even number

distance: the distance used with flags S, I, N, and O

red: the variation (positive or negative) of the red component used with flags S, I, N, and O

green: the variation (positive or negative) of the green component used with flags S, I, N, and O

blue: the variation (positive or negative) of the blue component used with flags S, I, N, and O

Example:

rectangle=1,0.5,0.5,5,2,#FFFF00
rectangle=1,0.5,3,5,4,#00FF00
rectangle=1,0.5,7.5,1,1,#FF0000
rectangle=1,2,7.5,2,1,#FF0000
rectangle=1,4.5,7.5,1,1,#FF0000
<a0>=0,0,6,9,!#FFFFFF
<a1>=0.5,0.5,5,2,#000000%2#FFFF00%5
<a2>=0.5,3,5,4,#000000%2#00FF00%5
<a3>=0.5,7.5,1,1,@#000000%2@#FF0000%5@
<a4>=2,7.5,2,1,@#000000%2@#FF0000%5@
<a5>=4.5,7.5,1,1,@#000000%2@#FF0000%5@
background=1,0,0,6,9,a*

Result:

From gallery of n_and

New PNGCOMP directive

This directive sets the compression level for png images saved with a SAVE directive. The syntax is:

PNGCOMP = "range", compression, filter

Where compression is a number from 0 (no compression) to 9 (maximum compression), and filter is the method used to evaluate the difference when applying compression (can be chosen from NONE, SUB, UP, AVERAGE, and PAETH).

New TRIMSTRING function

This function removes the spaces at the start or at the end (or both) of a string/sequence, this is the syntax:

[label] = TRIMSTRING(string, flag)

Flags can be L (removes the spaces at the start of the string) and/or R (removes the spaces at the end of the string).

Added parameters in POLYGON for curved sides

The syntax now is:

POLYGON="range"Range, pos x, pos y, width, height, num sides, angle, html colorHTML color, html colorHTML color, thickness, start side, end side, zoom, factor start, factor end, radius start, radius end

The new parameters are:

factor start: if specified, each edge is drawn as a bezier curve, using this parameter as the offset factor along the tangent of the start point handle
factor end: if specified, each edge is drawn as a bezier curve, using this parameter as the offset factor along the tangent of the end point handle
radius start: if specified, each edge is drawn as a bezier curve, using this parameter as the offset factor along the radius of the start point handle
radius end: if specified, each edge is drawn as a bezier curve, using this parameter as the offset factor along the radius of the end point handle

Example:

polygon=1,20%,20%,60%,60%,5,0,#FF0000,#0000FF,2%,,,100,1,1,0.5,-0.5

Result:

From gallery of n_and

Added parameters in TEXTLIMIT to define standard behaviours

The syntax now is:

TEXTLIMIT="range", text ON/OFF, HTML ON/OFF

If you set one of the flags, from that moment on all TEXT or HTMLTEXT instructions will automatically activate the TEXTLIMIT command.

Added parameters in DISPLAY to read only a partial area

DISPLAY = "image file", first card, last card, width, "range", transparent color, "mask file", bitplanes, pos x, pos y, width, height

With these parameters, instead of composing the image using the entire surface of the cards, you can read only a part of it.

Added parameter in COLORCHANGE for rounded corners

The syntax now is:

COLORCHANGE = "range", pos x, pos y, width, height, html color source, html color destination, level, flags, "mask file", schema, corner rounding

The last parameter specify the corner rounding (in cm) of the COLORCHANGE area.

Added parameters in FRAMEHEX for set the scale of the grid

The syntax now is:

[label]=FRAMEHEX(pos x, pos y, width, height, hex size, flags, zoom x, zoom y, scale x, scale y)

The scale parameters (x and y) specify the distance between frames as a percentage (100 is the default). Note that the zoom parameters instead specify the scale of the frame dimensions.

Added parameter in FRAMEBEZIER to move the frames along the curve

The syntax now is:

[label]=FRAMEBEZIER(pos x1, pos y1, handle x1, handle y1, handle x2, handle y2, pos x2, pos y2, frame width, frame height, number, zoom, schema)

The last parameter allows you to move the frame positions along the curve, for example, for six equally spaced points the pattern will be 0-20-40-60-80-100. Example:

[a]=framebezier(1,1,5,1,1,8,5,8,0.5,0.5,6,100,0-25-35-65-75-100)
ellipse=1,<a*>,#FF0000
bezier=1-3,1,1,5,1,1,8,5,8,#000000,0.1

From gallery of n_and

Added parameters in LINK to specify fields to keep

In the parameters following the file name in the LINK directive you can indicate the fields that will be created; if they are not present in the file they will be filled with empty elements; this option is useful if you always want to maintain the same structure on different sheets (where columns can be missing in one and present in another).

Added A/K flags in HTMLTEXT to use other engines

In HTMLTEXT now you can use the A flag (an alternative internal engine, that also works on Linux) and the K flag (that uses Chrome instead of Explorer).

Added C flag in ICONS to crop images

The C flag in ICONS now works like the one in IMAGE, images retain the aspect ratio but are enlarged (unlike the P flag where the aspect ratio is maintained by reducing the image).

Added O flag in IMAGE to crop source image

With the O flag in IMAGE, the 10th to 13th parameters, instead of being used for their original purpose, serve to read only a part of the source image (the parameters correspond to x, y, width and height).

Added A flag in HTMLIMAGE to adjust also margins

When the contents of an HTMLTEXT directive are resized with the F flag, adding the A flag in HTMLIMAGE also resizes the image margins.

Added P flag in HTMLFONT for proportional font scaling with F in HTMLTEXT

When the content of an HTMLTEXT directive is resized with the F flag, if there are multiple fonts they are resized by the same value; by adding the P flag the scaling of the secondary fonts occurs proportionally with respect to the main font (indicated as the 11th parameter in HTMLTEXT).

Added P flag in BRUSH for proportional custom images

If in the BRUSH directive (with the CUSTOM option) is used the P flag, the image is drawn using the original aspect ratio.

Added F flag in SAVE to delete the file at the end

You can add the F flag to the SAVE directive if, at the end of the script execution, you don’t want to keep the image saved with it (for example for temporary images that have already been reloaded).

Added R/T/L flags in SAVE to rotate the saved image

You can rotate the image saved with the SAVE directive with the R (90°), T (180°), or L (270°) flag.

Added tags in DISPLAY to rotate the saved image

If you specify the keywords (R90), (R180), or (R270) at the start of the filename of a DISPLAY line, the resulting image is rotated accordingly.

Added ability to read WebP files

Now you can use images in the webp format with the IMAGE directive.

Added a syntax in LINKMULTI to split a text field

Instead of a number the field parameter specified by LINKMULTI can be another text field, to be divided into multiple segments, with one of these syntaxes:

field/num divides the contents of the field into segments, each of num characters
field\num divides the contents of the field into segments, each composed of num characters, and the words are not divided
field\num\char divides the contents of the field into segments, each composed of num characters, and words (strings separated by char) are not divided

With this special syntax you can also use three counters:

§ indicates the number of the current segment
§§ indicates the total number of segments
§§§ reports these two numbers separated by a slash (note: 1/1 is not displayed)

nanDECK Version 1.27.2

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

New POLY directive

With this directive you can draw an irregular poygon, adding one point with each line, then close it by specifying the last point and the color. Syntax:

POLY="range", pos x1, pos y1, html color | html gradient, html color | EMPTY, thickness

Example:

poly=1,1,1
poly=1,5,1
poly=1,4,4.5
poly=1,5,8
poly=1,1,8
poly=1,2,4.5,#404040#D0D0D0#404040@0,#0000FF#00FFFF@90,0.3

New BOOKMARK directive

This directive adds the referred bookmark (from 0 to 9) to the current line in the editor (or another, if the offset parameter is specified, positive toward the end, negative toward the start). Note that you can go to a bookmark line with CTRL+(0..9).

Syntax:

BOOKMARK=number, offset

Parameters:

number: the number of the bookmark, from 0 to 9

offset: this value is added to the current line in the editor

These bookmarks are automatically added in the validation step at the 1st istance of each directive:

#1 PAGE
#2 CARDSIZE
#3 LINK
#4 VISUAL

New LOOKUP function

This function creates a label/sequence with the position of a label/sequence in a sequence, the syntax is:

[name] = LOOKUP(value, list)

For example:

[sequence] = LOOKUP(alpha|gamma|delta, alpha|beta|gamma|delta)

Result:

[sequence] = 1|3|4

New COLRGB function

This function creates a label containing a color, providing values from 0 to 255 for the three components, this is the syntax:

[name] = COLRGB(red, green, blue)

New RANGEINT function

This function returns the intersection between two or more ranges. Example:

[int1]="1-4,6,8,12"
[int2]="4-8,12"
[int3]=rangeint([int1],[int2])

[int3] is equal to “4,6,8,12”.

Undo/Redo in Visual Editor

In the visual editor you can undo/redo changes with CTRL+Z, CTRL+SHIFT+Z (or the two buttons in the top-left of the window).

Added star shaped gradients

An angle between 401 and 500 in a gradient draws a star gradient with 1-100 points. Example:

rectangle=1,0,0,100%,100%,#FF0000#FFFFFF#00FFFF#FFFFFF#0000FF@410

Added parameters in GRADIENTS for star shaped gradients

You can specify in a GRADIENTS line the parameters for compression, rotation, point factor, twist and scatter for star gradients. Example:

gradients=1,1.2,90,,0,0,,4,0.3,5
rectangle=1,0,0,100%,100%,#FF0000#FFFFFF#00FFFF#FFFFFF#0000FF@410

Note: the parametes for rotation and scatter in GRADIENTS are also used in conic gradients.

Added parameter in HTMLTEXT to specify the paragraph separator

The 12th parameters in HTMLTEXT contains the font applied to each paragraph, by default the paragraphs are divided by <br>, with the new 13th parameter you can specify what is used as separator between paragraphs.

Added parameters in HTMLMARGIN for vertical stretch and rotation

The 11th and 12th parameters in HTMLMARGINS allow text to be stretched vertically and rotated in HTMLTEXT. The syntax is:

HTMLMARGINS=htmlfont, margin top, margin left, margin right, margin bottom, paragraph alignment, line spacing, cell width, cell height, stretch h, stretch v, angle

Added parameters in ORIGIN to modify cm for % values

The 6th and 7th parameters in ORIGIN specify the measures corresponding to 100% (horizontally and vertically) in the following lines.

Added parameter in STAR for inner skewing

The 12th parameter in STAR rotate the inner part of the shape. Example:

star=1,0,0,100%,100%,8,0,50,#FF0000,#00FF00,5%,20

Added parameter in VORONOI to specify separation between zones

The 8th parameter in VORONOI specifies the width of an empty space between the shapes. Example:

<voro1> = 2, 2, 0, 0, #FF0000
<voro2> = 4, 2, 0, 0, #00FF00
<voro3> = 2, 7, 0, 0, #0000FF
<voro4> = 4, 7, 0, 0, #00FFFF
<voro5> = 3, 4.5, 0, 0, #FFFF00
<bord1> = 2, 2, 0, 0, #800000
<bord2> = 4, 2, 0, 0, #008000
<bord3> = 2, 7, 0, 0, #000080
<bord4> = 4, 7, 0, 0, #008080
<bord5> = 3, 4.5, 0, 0, #808000
VORONOI = 1, 0.5, 0.5, 5, 8, voro*, E, 0.5

Added I flag in COLORCHANGE to invert colors

The I flag inverts the colors in the area specified in COLORCHANGE.

Added A flag in COLORCHANGE to specify more than one change

The A flag in COLORCHANGE means that instead of a single couple, a sequence of colors are changed in the correspondent colors in another sequence.

Added & parameter in alpha gradients to specify compression

In an gradients used in alpha parameter you can specify the compression factor with a & symbol and a number.

Added X flag in HTMLIMAGE to not smooth the image

As a default, images shown in HTMLTEXT using an HTMLIMAGE are smooth, but if you add the X flag in HTMLIMAGE, the smooth is removed (i.e. the image is pixelated).

Added D flag in HTMLKEY to delete a key

The D flag in HTMLKEY deletes a key already defined (i.e. the text is shown as not replaced).

Added E flag in FRAMEPER to select outer frames

Instead of adding all the frames, the FRAMEPER function with the E flag creates only the outer frames (that is, the frames in the perimeter).

Added K flag in SAVE to saved shrinked areas

With this flag, the saved images are reduced by eliminating the area with the color located in the upper left pixel of the area indicated as a parameter.

Added flag in INFO for deck size and date/time

You can use these flags in the INFO function:

N the number of cards in the deck
Y year (date)
M month (date)
A day (date)
O hour (time)
I minute (time)
E second (time)
X epoch

nanDECK Version 1.27.1

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

New MANDALA directive

This directive draws a random image. Syntax:

MANDALA = "range", pos x, pos y, width, height, glyphs, angles, segments, min width, max width, min length, max length, html color, red, green, blue

– glyphs is the number of images created and superimposed
– angles is the max number of radial symmetries
– segments is the number of connected segments
– min width, max width is the width of segments
– min length, max length is the length of segments
– color is one or more color used in the process (random if not specified)
– red, green, blue are the variances of each component

Example:

mandala = 1, 0, 0, 100%, 100%

Result:

New TRANSFORM directive

This directive applies a projection to images loaded with IMAGE of in a layer structure. Syntax:

TRANSFORM = "range", x1, y1, x2, y2, x3, y3, x4, y4

The four couples of % are the coordinates of the projection quadrilateral (use only the range paramter to reset the projection). Example:

cardsize=18,10
oversample=2
imagefilter=spline
rectangle=1,0,0,100%,100%,#808080#FFFFFF#808080@90
transform=1,24,40,54,24,75,36,42,65
image=1,puerto rico.jpg,0,0,100%,100%,90
transform=1,24,40,42,65,43,94,26,62
image=1,puerto rico.jpg,0,0,100%,100%
transform=1,42,65,75,36,73,59,43,94
image=1,puerto rico.jpg,0,0,100%,100%,90

Result:

From gallery of n_and

New LINKCACHE directive

Syntax:

LINKCACHE = ON/OFF

With the ON parameter, a linked Google Sheet is saved locally to speed up subsequent executions.

New LINKADO directive

Syntax:

LINKADO=ON/OFF

With the ON parameter, instead of the internal library, the ADO libraries are used to load a spreadsheet.

New RANGEINS function

Syntax:

[range] = RANGEINS("range", position, "range", times)

This function takes a range (1st parameter) and add every Nth position (2nd parameter) another range (3rd parameter), optionally the 4th parameter specifies how many times.

Added X/Y flags it VISUAL to set global snap and size to grid

These flags set the snap and position flag on for all the objects in the visual editor (indipendently to the snap and position settings of individual objects).

Added parameters in HTMLIMAGE for margins

Now you can specify a border around an image in HTMLIMAGE, to be used in HTMLTEXT. Syntax:

HTMLIMAGE = "range", key, "image file", width, height, flags, angle, margin top, margin left, margin right, margin bottom

Added R flag in HTMLKEY to use regular expressions

Useful for replacing or adding a format to similar words, example:

htmlfont=default,arial,16,,#000000
htmlfont=underline,arial,16,U,#000000
htmlkey=1,"\w*summon\w*",*,underline,R,*
htmltext=1,"Summon, Summoner, Summoned, and Desummoned.",0,0,100%,100%,#FFFFFF,0,BE,100,default

Added Z flag in HTMLKEY to write all in a single line

Useful to be sure that multiple words (or images and words) stay on the same line in HTMLTEXT.

Added T flag in BRUSH to set a color as transparent in a custom brush

Useful when you want to fill a shape with a pattern with holes.

Added B flag in COLORCHANGE to blur images and a parameter to make changes only in certain areas

Syntax:

COLORCHANGE="range", pos x, pos y, width, height, html color, html color | html gradient, level, flag, "mask file", schema

The B flag blurs the image in the specified area (there is no need to specify color parameters); the level parameter specifies the number of blur passages (1 if not present), the 11th is used as a 5×5 matrix of blur weight for each pixel.

The 10th parameter can be used as a png mask to specify the area to blur or the area where to apply the color change; for this is used the transparency level of this png file.

Added N/S flags in LINKCOLOR to read font name and size

As with colors in a cell, you can use the flag N to create a sequence with the name of the fonts in a spreadsheet column; and the flag S to create a sequence with the font sizes.

Added a syntax in DISPLAY parameter to specify the number of rows

In the width parameter of the rectangle you can also specify a height with the syntax widthxheight, in this case multiple files can be created (replacing a § symbol with a counter).

Added multiple ranges in DUPLEX/FOLD directives

Example:

DUPLEX = 1-3|4-6, 7|8

This means that cards 1-3 are printed with 7th as back, and cards 4-6 with 8th as back.

Added NULL parameter to CHROMAKEY to disable transparency

The NULL value can be used in CHROMAKEY when you want that a layer can be applied whole, instead of treating one of its color as transparent.

Added parameter in FRAMEMAZE function for non-rectangular mazes

Syntax:

[label]=FRAMEMAZE(frames, width, height, start x, start y, flags SME, frames)

The 7th parameter can be used to specify the frames used to draw the maze in a non-rectangular shape.

Example:

cardsize=20,20
[all]=framebox(0,0,20,20,0.5,0.5,E)
[inner]=framedisk(allt20,allt3)
[out]=framesub(all*,inner)
[edge]=frameper(all*,0.1)
[maze]=framemaze(edge,40,40,0,0,,inner)
ellipse=1,<mazestart>,#FF0000
ellipse=1,<mazeend>,#00FF00
rectangle=1,<maze>,#0000FF
rectangle=1,<out>,#FFFFFF

Result:

nanDECK Version 1.27

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

New RANGE directive

Syntax:

RANGE = offset

The parameter specifies a number of cards that is added to all subsequent ranges. This directive is useful to merge two scripts that draws cards in the same range, without having to rewrite all the ranges of the 2nd script.

New GRADIENTS directive

This directive can be used to specify additional parameters used in drawing gradients, or to add other gradients color; it works on every directive that uses gradients, and you can use more than one GRADIENTS directive.

Syntax:

GRADIENTS = "range", compression, rotation, flags, pos x, pos y, html color

Parameters:

“range”: a set of cards

compression: a factor used to draw gradient bands narrowly (greater than 1) or broadly (less than 1)

rotation: each axis is rotated of this angle (in degrees)

flags: you can use the following flags:

N – each pixel is drawn in the color of the closest axis between the two that define the sector in which it resides
F – each pixel is drawn in the color of the farthest axis between the two that define the sector in which it resides
M – each pixel is drawn in the average color of the two axis that defines the sector in which it resides
A – each pixel is drawn in the average color of all axis
P – each pixel is drawn in the average color of all axis, proportionally to the distance from the point specified with 5th and 6th parameters
D – delete all current gradients

pos x: horizontal position (in cm) of point used with P flag

pos y: vertical position (in cm) of point used with P flag

html color: in the same format used for HTML, you can also specify a gradient

Example:

CARDSIZE=5,5
GRADIENTS=1,1.33,0,A,0,0,#0000FF#FFFFFF#FF0000#FFFFFF#0000FF@0
GRADIENTS=1,1.33,90,A
RECTANGLE=1,0,0,100%,100%,#0000FF#FFFFFF#FF0000#FFFFFF#0000FF@0

Result:

From gallery of n_and

Added multiple angles for a gradient

You can specify more than one angle for a gradient. Example:

CARDSIZE=5,5
CIRCLE=1,0,0,100%,100%,#FF0000#FFFFFF#0000FF@0@90

Result:

From gallery of n_and

Added conic gradients

Using the 364 angle you can draw conic gradients. Example:

CARDSIZE=5,5
RECTANGLE=1,0,0,100%,100%,#FF0000#0000FF@364

Result:

From gallery of n_and

New LINKAUTO directive

Syntax:

LINKAUTO = ON/OFF

If you add a LINKAUTO = ON before a LINK directive, when you save the linked spreadsheet the deck is automatically validated and build.

New LINKTAB directive

In this version every tabulation present in a spreadsheet is removed. If you instead want that to be converted to something else, use a LINKTAB=string line.

New MEASURE function

This function measures the distance from a point until the color changes, in a specific direction, the syntax is:

MEASURE(x, y, direction)

The direction can be one between:

UP
DOWN
LEFT
RIGHT

Added parameter in HTMLMARGINS for font stretching

The 10th parameter can be used to change the horizontal size of the text, less than 100 shrinks the font, more than 100 stretches the font.

Added parameter in IMAGEFILTER for blending options

The 2nd parameter specifies a different algorithm used to draw all the images, can be chosen between these options (the standard is SOLID):

SOLID
ADD
SUB
MOD
DIV
DARKEN
LIGHTEN
SCREEN
DODGE
BURN
DIFFERENCE
EXCLUSION
AVERAGE
SCALE
BLENDADD
BLENDMOD

Added S flag in SAVE for shrinking the image

If you specify an S flag in the 13th parameter in SAVE directive, the images saved is reduced in the four edges until a different color is found (taking as reference color the one of the top-left pixel). In the 14th parameter you can specify a level of likeness for that color (zero is the same color).

Added I/E flags in LOADPDF for internal/external engine

If you specify an E flag in the 10th parameter in LOADPDF directive, instead of the internal engine you can use Ghostscript to transform a PDF into an image (the path to the Ghostscript executable must be set with the “Config” button).

Added C flag in SAVEPDF for convert PDF in CMYK using Ghostscript

If you add a C flag in SAVEPDF and you have set a path for Ghostscript executable in Setup, the resulting PDF is converted to CMYK color space, optionally using the ICC color profile specified as a file in the 3rd parameter

Added S/V flags in COLORCHANGE for variations in resulting color

With S (the default behavior) the replaced color is the one specified in the parameter, with V the replaced color changes depending from the original color.

Added parameter in RENDER for using a range of cards

The 4th parameter in RANGE directive can be used to create cards only within a range (with the usual range syntax), instead that only from a card (1st parameter) to another (2nd parameter).

Added parameter in POLYGON for zoom

The 13th parameter in the POLYGON directive sets the zoom for it (100 = standard size).

Added MULTI keyword in SEQUENCE..ENDSEQUENCE structure

If you add a MULTI=N line in a SEQUENCE..ENDSEQUENCE structure, subsequent lines are replicated N times, example:

SEQUENCE=
text|one
MULTI=2
text|two
MULTI=1
text|three
ENDSEQUENCE

The result is the sequence one|two|two|three.

Added parameter in LINKFILL for setting a number of columns

For correct LINKFILL operation, the number of starting columns can be indicated as the second parameter (in case of empty cells at the end of the row, the program is not able to understand exactly how many columns the row is made up of).

Added ranges of results in combinatoric engine

After the number of elements you can specify one or more filters, to keep only a subset of the results, with this syntax:

C[name]number;char1:min1-max1;char2:min2-max2... = ...

In the resulting sequence are added only the results that have char1 in a number of occurrences between min1 and max1, char 2 between min2 and max2, and so on.

Added Library button in the main window

This button shows a list of example scripts that can be selected and shown in the main edit window. The “Update” button can be used to download a new copy of these scripts (I want to add other script in the future).

nanDECK Version 1.26.3

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

New REPEAT function

This functions is used to build strings with repetitions of characters, the syntax is:

[label]=REPEAT("string", number)

Added parameters in LINE/LINERECT/BEZIER/BEZIERS for arrow angle

The standard arrow has the tip drawn with two lines at 45°, with these parameters you can change this angle:

LINE="range", pos x1, pos y1, pos x2, pos y2, html color | html gradient, thickness, pattern O/D/S, end arrow, start arrow, end angle, start angle

LINERECT="range", pos x, pos y, width, height, html color | html gradient, thickness, pattern O/D/S, end arrow, start arrow, flag TRBLDG, end angle, start angle

BEZIER="range", pos x1, pos y1, handle x1, handle y1, handle x2, handle y2, pos x2, pos y2, html color | html gradient, thickness, end arrow, start arrow, end angle, start angle

BEZIERS="range", pos x, pos y, handle x, handle y, html color | html gradient, thickness, end arrow, start arrow, end angle, start angle

And a negative angle draws the arrows with three lines.

Example:

line=1,1,1,5,1,#000000,0.1,,1
line=1,1,3,5,3,#000000,0.1,,1,,20
line=1,1,5,5,5,#000000,0.1,,1,,60
line=1,1,7,5,7,#000000,0.1,,1,,-20

Added parameter in HTMLBORDER for inner background transparency
Added parameters in HTMLBORDER for min/max height

These parameters let you draw the inner area of an HTMLTEXT using a HTMLBORDER line with a partial transparency and a min/max height. Syntax:

HTMLBORDER=htmlfont, type RECTANGLE / DOTTED / DASHED / DOUBLE / GROOVE / RIDGE / INSET / OUTSET / NONE, html color, thickness, gap top, gap left, gap right, gap bottom, corner rounding, html color, alpha, min. height, max. height

Added parameter in HTMLFONT for rotation of characters

Syntax:

HTMLFONT=tag, "font name", font size, style B/I/U/S/O/N/R/C/T/A/M/D/L/G/E/J/H/Y/Z/K/W/V/F, html color, alignment, shadow x, shadow y, shadow blur, shadow color, outline color, outline width, indent, highlight color, char. spacing, angle

Example:

htmlfont=default,arial,24,,#000000,center
htmlfont=rotated,arial,24,,#FF0000,,0,0,0,,,0,0,,0,-45
htmltext=1,"nanD<rotated>E</rotated>CK",0,0,100%,100%,#FFFFFF,0,BE,100,default

Added parameter in HTMLIMAGE for rotation of image

Syntax:

HTMLIMAGE="range", key, "image file", width, height, flag PTMBLREICDH, angle

Example:

htmlfont=default,arial,24,,#000000,center
htmlimage=1,(d),shieldcomb.png,0.8,0.8,PM,-90
htmltext=1,"nan(d)ECK",0,0,100%,100%,#FFFFFF,0,BE,100,default

Added parameter in HTMLTEXT for specifying a font used for paragraphs
Added U flag in HTMLTEXT for using font on multiple paragraphs

The 12th parameter specifies to use a font tag in each paragraph of the text. Note also that with the U flag a sequence in this parameter is applied sequentially in each paragraph.

Added parameter in EDGE for INSIDE borders
Added parameter in EDGE to change tips
Added parameter in EDGE to change corners

Syntax:

EDGE="range", type SOLID / INSIDE / DOT / DASH / DASHDOT / DASHDOTDOT / NULL / CUSTOM, pattern O/D/S, tip ROUND / SQUARE / FLAT, join ROUND / BEVEL / MITER

Some examples in this thread:

New parameters for EDGE

Added W/H flags in ICONS to distribute icons

Instead of grouping them, these flags distribute the icons horizontally (W) and/or vertically (H) in ICONS directive.

Added J flag in IMAGE for using alternate jpeg library
Added A flag in SAVE for using alternate jpeg library

I’ve added an alternative engine for jpeg images, that can be used in IMAGE (for showing a jpeg) and in SAVE (for saving a jpeg).

Added C flag in LAYER for using layers with the canvas

The C flag specifies that the LAYER is used with the canvas instead of in a card.

Added M/S flags in REPLACE for multiple/single replacements

The default behavior (now selected with the M flag) is to pair every from/to texts to every element of the 1st parameter, instead with the S flag the Nth pair of from/to texts are applied only to the Nth element of the 1st parameter.

Added F flag in COPYCARD for rotate cards upside down

The default with COPYCARD directive is to copy the card as-is. With the F flag the card is rotated upside-down.

Added W/H/D/U flags in INFO function

Results:

W - card width (in current units)
H - card height (in current units)
D - card dpi
U - name of the current units (cm/mm/inch)

nanDECK guild on BGG:

nanDeck Users

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

Example:

[text]="The brown fox (fox) jumps over the lazy dog (dog)."
[all]=1-{(text)}

htmlimage=[all],(fox),fox.png,0.5,0.5,PB
htmlimage=[all],(dog),sitting-dog.png,0.5,0.5,PB
htmlfont=default,arial,10,,#000000,justify
htmlmargins=default,0.3,0.3,0.3,0.3
htmlborder=default,double,#808080,0.1,0.2,0.5,0.5,0.2,0.25
htmltext=[all],[text],0,0,100%,100%,#FFFFFF,0,BE,100,default

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.

Example:

flags=1,htmlfont,-I
flags=2,htmlfont,B
flags=3,htmlfont,U

htmlfont=default,arial,16,I,#000000
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.

Syntax:

LINKFILL = switch

Parameter:

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.

Syntax:

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

Parameters:

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

Example:

page=21,29.7,portrait,HV
font=arial,128,,#HHHHHH,#HHHHHH
text=1-9,{§},0,0,100%,100%
pageshape=1,1,19,27.7,MA,#0000FF
pageshape=0.25,0.25,0.5,0.5,SI,#FF0000
pageshape=20.25,0.25,0.5,0.5,SI,#FF0000
pageshape=0.25,28.95,0.5,0.5,SI,#FF0000
pageshape=20.25,28.95,0.5,0.5,SI,#FF0000

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."
font=arial,16,,#000000,#FFFF00
text=1,[text],0,0,100%,33%,center,wwcenter
text=1,[text],0,33%,100%,33%,center,wwcenter,0,100,,,,120,50
text=1,[text],0,66%,100%,33%,center,wwcenter,0,100,,,,50,120

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:

font=arial,32,X,#000000,#FFFF00
text=1,"Test",10%,10%,80%,15%
text=1,"Test Test Test Test",10%,30%,80%,15%
font=arial,32,Y,#000000,#FFFF00
text=1,"Test",10%,50%,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:

[one]=framehex(0,0,6,4,1,S)
polygon=1,<one>,6,30,#CFE2EE,#E7F1F7,0.1
[two]=framehex(0,5,6,4,1,ST)
polygon=1,<two>,6,30,#CFE2EE,#E7F1F7,0.1

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.

Code your graphics