diff options
| author | Eli Zaretskii | 2018-09-11 10:30:25 +0300 |
|---|---|---|
| committer | Eli Zaretskii | 2018-09-11 10:30:25 +0300 |
| commit | ff374e4491c7b9ba2c3c2838865facf129444a7e (patch) | |
| tree | 2039e26c7a60a459b74db606b6b2997f5de47287 | |
| parent | 3a0caf6b7df3c0646f96db1d033cb0404658f2c0 (diff) | |
| download | emacs-ff374e4491c7b9ba2c3c2838865facf129444a7e.tar.gz emacs-ff374e4491c7b9ba2c3c2838865facf129444a7e.zip | |
* doc/lispref/display.texi (SVG Images): Improve wording.
| -rw-r--r-- | doc/lispref/display.texi | 46 |
1 files changed, 27 insertions, 19 deletions
diff --git a/doc/lispref/display.texi b/doc/lispref/display.texi index d6f35276e9f..deabd31d776 100644 --- a/doc/lispref/display.texi +++ b/doc/lispref/display.texi | |||
| @@ -5401,7 +5401,8 @@ Specifies a rotation angle in degrees. | |||
| 5401 | 5401 | ||
| 5402 | SVG (Scalable Vector Graphics) is an XML format for specifying images. | 5402 | SVG (Scalable Vector Graphics) is an XML format for specifying images. |
| 5403 | If your Emacs build has SVG support, you can create and manipulate | 5403 | If your Emacs build has SVG support, you can create and manipulate |
| 5404 | these images with the following functions. | 5404 | these images with the following functions from the @file{svg.el} |
| 5405 | library. | ||
| 5405 | 5406 | ||
| 5406 | @defun svg-create width height &rest args | 5407 | @defun svg-create width height &rest args |
| 5407 | Create a new, empty SVG image with the specified dimensions. | 5408 | Create a new, empty SVG image with the specified dimensions. |
| @@ -5415,8 +5416,11 @@ The default width (in pixels) of any lines created. | |||
| 5415 | The default stroke color on any lines created. | 5416 | The default stroke color on any lines created. |
| 5416 | @end table | 5417 | @end table |
| 5417 | 5418 | ||
| 5418 | This function returns an SVG structure, and all the following functions | 5419 | @cindex SVG object |
| 5419 | work on that structure. | 5420 | This function returns an @dfn{SVG object}, a Lisp data structure that |
| 5421 | specifies an SVG image, and all the following functions work on that | ||
| 5422 | structure. The argument @var{svg} in the following functions | ||
| 5423 | specifies such an SVG object. | ||
| 5420 | @end defun | 5424 | @end defun |
| 5421 | 5425 | ||
| 5422 | @defun svg-gradient svg id type stops | 5426 | @defun svg-gradient svg id type stops |
| @@ -5460,8 +5464,8 @@ gradient object. | |||
| 5460 | @end table | 5464 | @end table |
| 5461 | 5465 | ||
| 5462 | @defun svg-rectangle svg x y width height &rest args | 5466 | @defun svg-rectangle svg x y width height &rest args |
| 5463 | Add a rectangle to @var{svg} where the upper left corner is at | 5467 | Add to @var{svg} a rectangle whose upper left corner is at |
| 5464 | position @var{x}/@var{y} and is of size @var{width}/@var{height}. | 5468 | position @var{x}/@var{y} and whose size is @var{width}/@var{height}. |
| 5465 | 5469 | ||
| 5466 | @lisp | 5470 | @lisp |
| 5467 | (svg-rectangle svg 100 100 500 500 :gradient "gradient1") | 5471 | (svg-rectangle svg 100 100 500 500 :gradient "gradient1") |
| @@ -5469,24 +5473,24 @@ position @var{x}/@var{y} and is of size @var{width}/@var{height}. | |||
| 5469 | @end defun | 5473 | @end defun |
| 5470 | 5474 | ||
| 5471 | @defun svg-circle svg x y radius &rest args | 5475 | @defun svg-circle svg x y radius &rest args |
| 5472 | Add a circle to @var{svg} where the center is at @var{x}/@var{y} | 5476 | Add to @var{svg} a circle whose center is at @var{x}/@var{y} and whose |
| 5473 | and the radius is @var{radius}. | 5477 | radius is @var{radius}. |
| 5474 | @end defun | 5478 | @end defun |
| 5475 | 5479 | ||
| 5476 | @defun svg-ellipse svg x y x-radius y-radius &rest args | 5480 | @defun svg-ellipse svg x y x-radius y-radius &rest args |
| 5477 | Add a circle to @var{svg} where the center is at @var{x}/@var{y} and | 5481 | Add to @var{svg} an ellipse whose center is at @var{x}/@var{y}, and |
| 5478 | the horizontal radius is @var{x-radius} and the vertical radius is | 5482 | whose horizontal radius is @var{x-radius} and the vertical radius is |
| 5479 | @var{y-radius}. | 5483 | @var{y-radius}. |
| 5480 | @end defun | 5484 | @end defun |
| 5481 | 5485 | ||
| 5482 | @defun svg-line svg x1 y1 x2 y2 &rest args | 5486 | @defun svg-line svg x1 y1 x2 y2 &rest args |
| 5483 | Add a line to @var{svg} that starts at @var{x1}/@var{y1} and extends | 5487 | Add to @var{svg} a line that starts at @var{x1}/@var{y1} and extends |
| 5484 | to @var{x2}/@var{y2}. | 5488 | to @var{x2}/@var{y2}. |
| 5485 | @end defun | 5489 | @end defun |
| 5486 | 5490 | ||
| 5487 | @defun svg-polyline svg points &rest args | 5491 | @defun svg-polyline svg points &rest args |
| 5488 | Add a multiple segment line to @var{svg} that goes through | 5492 | Add to @var{svg} a multiple-segment line (a.k.a.@: ``polyline'') that |
| 5489 | @var{points}, which is a list of X/Y position pairs. | 5493 | goes through @var{points}, which is a list of X/Y position pairs. |
| 5490 | 5494 | ||
| 5491 | @lisp | 5495 | @lisp |
| 5492 | (svg-polyline svg '((200 . 100) (500 . 450) (80 . 100)) | 5496 | (svg-polyline svg '((200 . 100) (500 . 450) (80 . 100)) |
| @@ -5505,7 +5509,7 @@ that describe the outer circumference of the polygon. | |||
| 5505 | @end defun | 5509 | @end defun |
| 5506 | 5510 | ||
| 5507 | @defun svg-text svg text &rest args | 5511 | @defun svg-text svg text &rest args |
| 5508 | Add a text to @var{svg}. | 5512 | Add the specified @var{text} to @var{svg}. |
| 5509 | 5513 | ||
| 5510 | @lisp | 5514 | @lisp |
| 5511 | (svg-text | 5515 | (svg-text |
| @@ -5524,9 +5528,9 @@ Add a text to @var{svg}. | |||
| 5524 | 5528 | ||
| 5525 | @defun svg-embed svg image image-type datap &rest args | 5529 | @defun svg-embed svg image image-type datap &rest args |
| 5526 | Add an embedded (raster) image to @var{svg}. If @var{datap} is | 5530 | Add an embedded (raster) image to @var{svg}. If @var{datap} is |
| 5527 | @code{nil}, @var{IMAGE} should be a file name; if not, it should be a | 5531 | @code{nil}, @var{image} should be a file name; otherwise it should be a |
| 5528 | binary string containing the image data. @var{image-type} should be a | 5532 | string containing the image data as raw bytes. @var{image-type} should be a |
| 5529 | @acronym{MIME} image type, for instance @samp{"image/jpeg"}. | 5533 | @acronym{MIME} image type, for instance @code{"image/jpeg"}. |
| 5530 | 5534 | ||
| 5531 | @lisp | 5535 | @lisp |
| 5532 | (svg-embed svg "~/rms.jpg" "image/jpeg" nil | 5536 | (svg-embed svg "~/rms.jpg" "image/jpeg" nil |
| @@ -5539,10 +5543,14 @@ binary string containing the image data. @var{image-type} should be a | |||
| 5539 | Remove the element with identifier @code{id} from the @code{svg}. | 5543 | Remove the element with identifier @code{id} from the @code{svg}. |
| 5540 | @end defun | 5544 | @end defun |
| 5541 | 5545 | ||
| 5542 | Finally, the @code{svg-image} takes an SVG object as its parameter and | 5546 | @defun svg-image svg |
| 5547 | Finally, the @code{svg-image} takes an SVG object as its argument and | ||
| 5543 | returns an image object suitable for use in functions like | 5548 | returns an image object suitable for use in functions like |
| 5544 | @code{insert-image}. Here's a complete example that creates and | 5549 | @code{insert-image}. |
| 5545 | inserts an image with a circle: | 5550 | @end defun |
| 5551 | |||
| 5552 | Here's a complete example that creates and inserts an image with a | ||
| 5553 | circle: | ||
| 5546 | 5554 | ||
| 5547 | @lisp | 5555 | @lisp |
| 5548 | (let ((svg (svg-create 400 400 :stroke-width 10))) | 5556 | (let ((svg (svg-create 400 400 :stroke-width 10))) |