diff options
author | fvogel <fvogelnew1@free.fr> | 2018-12-03 19:06:39 (GMT) |
---|---|---|
committer | fvogel <fvogelnew1@free.fr> | 2018-12-03 19:06:39 (GMT) |
commit | 70faead3ab7c265f9117593c313450f0f8eb4497 (patch) | |
tree | 33901ef3de5d6f77b403d233ac30125a48f65eab | |
parent | a6e11187e0005e79278bcc7f9192f11062dee7b0 (diff) | |
download | tk-70faead3ab7c265f9117593c313450f0f8eb4497.zip tk-70faead3ab7c265f9117593c313450f0f8eb4497.tar.gz tk-70faead3ab7c265f9117593c313450f0f8eb4497.tar.bz2 |
New files from René Zaumseil
-rw-r--r-- | doc/photo.n | 45 | ||||
-rw-r--r-- | generic/tkImgSVGnano.c | 20 |
2 files changed, 43 insertions, 22 deletions
diff --git a/doc/photo.n b/doc/photo.n index a904f6a..a2601bd 100644 --- a/doc/photo.n +++ b/doc/photo.n @@ -552,7 +552,7 @@ background on which the image is displayed to show through. This usually also has the effect of desaturating the image. The \fIalphaValue\fR must be between 0.0 and 1.0. .TP -\fBsvgnano \-dpi\fI dpiValue\fB \-scale\fI scaleValue\fB \-unit\fI unitValue\fB \-x\fI xValue\fB \-y\fI yValue\fR +\fBsvg \-dpi\fI dpiValue\fB \-scale\fI scaleValue\fB \-unit\fI unitValue\fR . \fIdpiValue\fR is used in conversion between given coordinates and screen resolution. The value must be greater than 0 and the default @@ -562,13 +562,44 @@ be greater than 0 and the default value is 1. \fIunitValue\fR is the unit of all coordinates in the SVG data. Available units are px (default, coordinates in pixel), pt (1/72 inch), pc (12 pt), mm , cm and in. -\fIxValue\fR and \fIyValue\fR are used to move the created image -respectively in x-direction and y-direction. The default value is 0 -for both. -. -The svgnano format supports a wide range of SVG features, but the +The svg format supports a wide range of SVG features, but the full SVG standard is not available, for instance the 'text' feature -is missing. +is missing and silently ignores when reading the SVG data. +The supported SVG features are: +. +.RS +\fB elements:\fR g, path, rect, circle, ellipse, line, polyline, polygon, +linearGradient, radialGradient, stop, defs, svg, style \fR +. +\fB attributes:\fR width, height, viewBox, +preserveAspectRatio with none, xMin, xMid, xMax, yMin, yMid, yMax, slice +. +\fB gradient attributes:\fR gradientUnits with objectBoundingBox, +gradientTransform, cx, cy, r fx, fy x1, y1, x2, y2 +spreadMethod with pad, reflect or repeat, +xlink:href +. +\fB poly attibutes: \fR points +. +\fB line attibutes: \fR x1, y1, x2, y2 +. +\fB ellipse attibutes: \fR cx, cy, rx, ry +. +\fB circle attibutes: \fR cx, cy, r +. +\fB rectangle attibutes: \fR x, y, width, height, rx, ry +. +\fB path attibutes: \fR d with m, M, l, L, h, H, v, V, c, C, s, S, q, Q, t, T, a, A, z, Z +. +\fB style attibutes: \fR display with none, visibility, hidden, visible, +fill with nonzero and evenodd, opacity, fill-opacity, +stroke, stroke-width, stroke-dasharray, stroke-dashoffset, stroke-opacity, +stroke-linecap with butt, round and square, +stroke-linejoin with miter, round and bevel, stroke-miterlimit +fill-rule, font-size, +transform with matrix, translate, scale, rotate, skewX and skewY, +stop-color, stop-opacity, offset, id, class +.RE . Currently only SVG images reading and conversion into (pixel-based format) photos is supported: Tk does not (yet) support bundling photo diff --git a/generic/tkImgSVGnano.c b/generic/tkImgSVGnano.c index d27016c..f86c45e 100644 --- a/generic/tkImgSVGnano.c +++ b/generic/tkImgSVGnano.c @@ -82,7 +82,7 @@ static void FreeCache(ClientData clientData, Tcl_Interp *interp); */ Tk_PhotoImageFormat tkImgFmtSVGnano = { - "svgnano", /* name */ + "svg", /* name */ FileMatchSVG, /* fileMatchProc */ StringMatchSVG, /* stringMatchProc */ FileReadSVG, /* fileReadProc */ @@ -328,10 +328,10 @@ ParseSVGWithOptions( char *inputCopy = NULL; NSVGimage *nsvgImage; static const char *const fmtOptions[] = { - "-dpi", "-scale", "-unit", "-x", "-y", NULL + "-dpi", "-scale", "-unit", NULL }; enum fmtOptions { - OPT_DPI, OPT_SCALE, OPT_UNIT, OPT_X, OPT_Y + OPT_DPI, OPT_SCALE, OPT_UNIT }; /* @@ -363,10 +363,10 @@ ParseSVGWithOptions( int optIndex; /* - * Ignore the "svgnano" part of the format specification. + * Ignore the "svg" part of the format specification. */ - if (!strcasecmp(Tcl_GetString(objv[0]), "svgnano")) { + if (!strcasecmp(Tcl_GetString(objv[0]), "svg")) { continue; } @@ -418,16 +418,6 @@ ParseSVGWithOptions( unit[2] = '\0'; } break; - case OPT_X: - if (Tcl_GetDoubleFromObj(interp, objv[0], &ropts->x) == TCL_ERROR) { - goto error; - } - break; - case OPT_Y: - if (Tcl_GetDoubleFromObj(interp, objv[0], &ropts->y) == TCL_ERROR) { - goto error; - } - break; } } |