summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRicardo Wurmus <rekado@elephly.net>2021-01-03 15:45:53 +0100
committerRicardo Wurmus <rekado@elephly.net>2021-01-03 15:45:53 +0100
commit1f50722ac14c7557ec3ea9389aad114c72379600 (patch)
treed70d046e0bfd5510293c6047dfbb35cf3216d291
parent037c3cdc17ab8eb35ae6cc1e92ae1a784a6508c4 (diff)
Document more shapes.
-rw-r--r--Makefile.am4
-rw-r--r--doc/images/circle.svg.scm1
-rw-r--r--doc/images/ellipse.svg.scm1
-rw-r--r--doc/images/octagon.svg.scm1
-rw-r--r--doc/images/rectangle.svg.scm1
-rw-r--r--doc/images/triangle.svg.scm1
-rw-r--r--doc/picture-language.texi153
7 files changed, 158 insertions, 4 deletions
diff --git a/Makefile.am b/Makefile.am
index 4cad904..ff1609e 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -33,7 +33,9 @@ EXTRA_DIST += \
info_TEXINFOS = doc/picture-language.texi
DOC_IMAGES = $(addsuffix .svg.scm, $(addprefix $(top_srcdir)/doc/images/, \
- line hline vline polyline polyline2 polygon boring-triangles modifiers))
+ line hline vline polyline polyline2 polygon \
+ triangle octagon circle ellipse rectangle \
+ boring-triangles modifiers))
infoimagedir = $(infodir)/images
dist_infoimage_DATA = \
diff --git a/doc/images/circle.svg.scm b/doc/images/circle.svg.scm
new file mode 100644
index 0000000..82c9de7
--- /dev/null
+++ b/doc/images/circle.svg.scm
@@ -0,0 +1 @@
+(circle 120 #:border-color "orange" #:border-width 5)
diff --git a/doc/images/ellipse.svg.scm b/doc/images/ellipse.svg.scm
new file mode 100644
index 0000000..151a02f
--- /dev/null
+++ b/doc/images/ellipse.svg.scm
@@ -0,0 +1 @@
+(ellipse 50 100 #:border-color "lime" #:border-width 3)
diff --git a/doc/images/octagon.svg.scm b/doc/images/octagon.svg.scm
new file mode 100644
index 0000000..df97595
--- /dev/null
+++ b/doc/images/octagon.svg.scm
@@ -0,0 +1 @@
+(octagon 100 #:border-color "royalblue")
diff --git a/doc/images/rectangle.svg.scm b/doc/images/rectangle.svg.scm
new file mode 100644
index 0000000..8895c95
--- /dev/null
+++ b/doc/images/rectangle.svg.scm
@@ -0,0 +1 @@
+(rectangle 50 100 #:rx 10 #:ry 20)
diff --git a/doc/images/triangle.svg.scm b/doc/images/triangle.svg.scm
new file mode 100644
index 0000000..6f996f3
--- /dev/null
+++ b/doc/images/triangle.svg.scm
@@ -0,0 +1 @@
+(triangle 45 70 #:border-color "salmon")
diff --git a/doc/picture-language.texi b/doc/picture-language.texi
index d4196f1..069281b 100644
--- a/doc/picture-language.texi
+++ b/doc/picture-language.texi
@@ -253,10 +253,157 @@ Here is a simple polygon:
@image{images/polygon.svg.scm,,,A polygon.}
@end example
+
+@cindex triangle, simple shape
+@deffn {Scheme Procedure} triangle @
+ @var{W} @var{H} @
+ [#:border-color @var{"black"} #:border-width @var{1}]
+
+This procedure draws an isosceles triangle with width @var{W} and
+height @var{H}. The keys @var{BORDER-COLOR} (a string) and
+@var{BORDER-WIDTH} (a number) are accepted to override the line color
+and line thickness.
+@end deffn
+
+@cindex triangle, example
+Here is a simple triangle:
+@example
+@verbatiminclude images/triangle.svg.scm
+@image{images/triangle.svg.scm,,,A triangle.}
+@end example
+
+
+@cindex filled-triangle, simple shape
+@deffn {Scheme Procedure} filled-triangle @
+ @var{W} @var{H} @
+ [#:color @var{"black"}]
+
+This procedure draws a triangle just like the @code{triangle}
+procedure, except that it does not have an outline and is filled with
+the provided @var{COLOR}.
+@end deffn
+
+
+@cindex octagon, simple shape
+@deffn {Scheme Procedure} octagon @
+ @var{SIZE} @
+ [#:border-color @var{"black"} #:border-width @var{1}]
+
+This procedure draws a p8 symmetric isogonal octagon with a maximum
+width of @var{SIZE}. The keys @var{BORDER-COLOR} (a string) and
+@var{BORDER-WIDTH} (a number) are accepted to override the line color
+and line thickness.
+@end deffn
+
+@cindex octagon, example
+Here is a simple octagon:
+@example
+@verbatiminclude images/octagon.svg.scm
+@image{images/octagon.svg.scm,,,An octagon.}
+@end example
+
+
+@cindex filled-octagon, simple shape
+@deffn {Scheme Procedure} filled-octagon @
+ @var{SIZE} @
+ [#:color @var{"black"}]
+
+This procedure draws an octagon just like the @code{octagon}
+procedure, except that it does not have an outline and is filled with
+the provided @var{COLOR}.
+@end deffn
+
+
+@cindex circle, simple shape
+@deffn {Scheme Procedure} circle @
+ @var{SIZE} @
+ [#:border-color @var{"black"} #:border-width @var{1}]
+
+This procedure draws a circle with an outer diameter of @var{SIZE}.
+The keys @var{BORDER-COLOR} (a string) and @var{BORDER-WIDTH} (a
+number) are accepted to override the line color and line thickness.
+@end deffn
+
+@cindex circle, example
+Here is a simple circle:
+@example
+@verbatiminclude images/circle.svg.scm
+@image{images/circle.svg.scm,,,A circle.}
+@end example
+
+
+@cindex disk, simple shape
+@deffn {Scheme Procedure} disk @
+ @var{SIZE} @
+ [#:color @var{"black"}]
+
+A disk is a filled circle. This procedure draws a disk with the outer
+diameter @var{SIZE}. It's just like the output of the @code{circle}
+procedure, except that it does not have an outline and is filled with
+the provided @var{COLOR}.
+@end deffn
+
+
+@cindex ellipse, simple shape
+@deffn {Scheme Procedure} ellipse @
+ @var{W} @var{H} @
+ [#:border-color @var{"black"} #:border-width @var{1}]
+
+This procedure draws an ellipse with width @var{W} and height @var{H}.
+The keys @var{BORDER-COLOR} (a string) and @var{BORDER-WIDTH} (a
+number) are accepted to override the line color and line thickness.
+@end deffn
+
+@cindex ellipse, example
+Here is a simple ellipse:
+@example
+@verbatiminclude images/ellipse.svg.scm
+@image{images/ellipse.svg.scm,,,An ellipse.}
+@end example
+
+
+@cindex filled-ellipse, simple shape
+@deffn {Scheme Procedure} filled-ellipse @
+ @var{W} @var{H} @
+ [#:color @var{"black"}]
+
+This procedure draws a filled ellipse. It's just like the ellipse
+drawn by the @code{ellipse} procedure, except that it does not have an
+outline and is filled with the provided @var{COLOR}.
+@end deffn
+
+
+@cindex rectangle, simple shape
+@deffn {Scheme Procedure} rectangle @
+ @var{W} @var{H} @
+ [#:border-color @var{"black"} #:border-width @var{1} #:rx @var{0} #:ry @var{0}]
+
+This procedure draws a rectangle with width @var{W} and height
+@var{H}. The keys @var{BORDER-COLOR} (a string) and
+@var{BORDER-WIDTH} (a number) are accepted to override the line color
+and line thickness. The keys @var{RX} and @var{RY} (both numbers) can
+be provided to round off the corners.
+@end deffn
+
+@cindex rectangle, example
+Here is a simple rectangle with rounded corners:
+@example
+@verbatiminclude images/rectangle.svg.scm
+@image{images/rectangle.svg.scm,,,A rectangle with rounded corners.}
+@end example
+
+
+@cindex filled-rectangle, simple shape
+@deffn {Scheme Procedure} filled-rectangle @
+ @var{W} @var{H} @
+ [#:color @var{"black"} #:border-color @var{"none"} #:border-width @var{1} #:rx @var{0} #:ry @var{0}]
+
+This procedure draws a filled rectangle. It's just like the rectangle
+drawn by the @code{rectangle} procedure, except that it does not have
+an outline and is filled with the provided @var{COLOR}.
+@end deffn
+
There are more primitive shapes that still need to be documented:
-@code{triangle}, @code{filled-triangle}, @code{octagon},
-@code{filled-octagon}, @code{circle}, @code{disk}, @code{ellipse},
-@code{filled-ellipse}, @code{rectangle}, @code{filled-rectangle}, and
@code{text}.
@c *********************************************************************