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
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:
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:
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
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)