aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2023-02-07 22:48:46 +0100
committerMattias Andrée <maandree@kth.se>2023-02-07 22:48:46 +0100
commite7b56841561f9a8bc40d8cebd9dae23b3c5951a2 (patch)
tree87b5e109a7c92fec341ad4096c315929dbb3979d
parentAdd man pages (diff)
downloadlibrifunktionsteckensnittsglyfrasteriseringsprogrambiblioteket-e7b56841561f9a8bc40d8cebd9dae23b3c5951a2.tar.gz
librifunktionsteckensnittsglyfrasteriseringsprogrambiblioteket-e7b56841561f9a8bc40d8cebd9dae23b3c5951a2.tar.bz2
librifunktionsteckensnittsglyfrasteriseringsprogrambiblioteket-e7b56841561f9a8bc40d8cebd9dae23b3c5951a2.tar.xz
Change back the name of rtgrpblib_draw_elliptical_arc to rtgrpblib_draw_circular_arc
Signed-off-by: Mattias Andrée <maandree@kth.se>
-rw-r--r--Makefile4
-rw-r--r--README9
-rw-r--r--librifunktionsteckensnittsglyfrasteriseringsprogrambiblioteket.79
-rw-r--r--librifunktionsteckensnittsglyfrasteriseringsprogrambiblioteket.h26
-rw-r--r--rtgrpblib_draw_circular_arc.c (renamed from rtgrpblib_draw_elliptical_arc.c)4
-rw-r--r--rtgrpblib_draw_linear_bezier.34
-rw-r--r--rtgrpblib_fill_shapes.32
7 files changed, 31 insertions, 27 deletions
diff --git a/Makefile b/Makefile
index 96cd2da..3a8befe 100644
--- a/Makefile
+++ b/Makefile
@@ -25,7 +25,7 @@ OBJ =\
rtgrpblib_set_draftness.o\
draw_linear_bezier_reference.o\
lines.o\
- rtgrpblib_draw_elliptical_arc.o\
+ rtgrpblib_draw_circular_arc.o\
rtgrpblib_draw_linear_bezier.o\
rtgrpblib_draw_quadratic_bezier.o\
rtgrpblib_draw_cubic_bezier.o\
@@ -42,7 +42,7 @@ MAN3 =\
rtgrpblib_create_raster.3\
rtgrpblib_reset_raster.3\
rtgrpblib_set_draftness.3\
- rtgrpblib_draw_elliptical_arc.3\
+ rtgrpblib_draw_circular_arc.3\
rtgrpblib_draw_linear_bezier.3\
rtgrpblib_draw_quadratic_bezier.3\
rtgrpblib_draw_cubic_bezier.3\
diff --git a/README b/README
index 4f8d93a..d297047 100644
--- a/README
+++ b/README
@@ -10,17 +10,14 @@ DESCRIPTION
library only supports curve types that are used for drawing glyphs; specifically
this means that lines and quadratic Bézier curves are supported by cause this
is what is required to draw vectorised bitmap fonts and TrueType fonts, but also
- cubic Bézier curves as this is required for OpenType fonts and elliptical arcs
- (elliptical rather than circular because it may be need required to strech the
- circle to support outputs with different vertical and horizontal dot density
- and to support subpixel antialiasing) as this is commonly used for corners when
- stroking the outline of a glyph.
+ cubic Bézier curves as this is required for OpenType fonts and circular arcs
+ as this is commonly used for corners when stroking the outline of a glyph.
The create an image, first create a buffer using rtgrpblib_create_raster(3)
(if you already have one that is large enough, you can reinitialise it with
rtgrpblib_reset_raster(3)), and than using the drawing functions
(rtgrpblib_draw_linear_bezier(3), rtgrpblib_draw_quadratic_bezier(3),
- rtgrpblib_draw_cubic_bezier(3), and rtgrpblib_draw_elliptical_arc(3)) to
+ rtgrpblib_draw_cubic_bezier(3), and rtgrpblib_draw_circular_arc(3)) to
draw the components of each shape's outline. When done, create an image
using the rtgrpblib_fill_shapes(3) function: you will receive a ink-level
map, where the value 0 means background, and 1 means foreground, and values
diff --git a/librifunktionsteckensnittsglyfrasteriseringsprogrambiblioteket.7 b/librifunktionsteckensnittsglyfrasteriseringsprogrambiblioteket.7
index a0fe3d0..aff9ec4 100644
--- a/librifunktionsteckensnittsglyfrasteriseringsprogrambiblioteket.7
+++ b/librifunktionsteckensnittsglyfrasteriseringsprogrambiblioteket.7
@@ -14,11 +14,8 @@ for drawing glyphs; specifically this means that lines and
quadratic Bézier curves are supported by cause this is what is
required to draw vectorised bitmap fonts and TrueType fonts,
but also cubic Bézier curves as this is required for OpenType
-fonts and elliptical arcs (elliptical rather than circular
-because it may be need required to strech the circle to support
-outputs with different vertical and horizontal dot density and
-to support subpixel antialiasing) as this is commonly used for
-corners when stroking the outline of a glyph.
+fonts and circular arcs as this is commonly used for corners
+when stroking the outline of a glyph.
.PP
The create an image, first create a buffer using
.BR rtgrpblib_create_raster (3)
@@ -30,7 +27,7 @@ and than using the drawing functions
.BR rtgrpblib_draw_quadratic_bezier (3),
.BR rtgrpblib_draw_cubic_bezier (3),
and
-.BR rtgrpblib_draw_elliptical_arc (3))
+.BR rtgrpblib_draw_circular_arc (3))
to draw the components of each shape's outline. When done,
create an image using the
.BR rtgrpblib_fill_shapes (3)
diff --git a/librifunktionsteckensnittsglyfrasteriseringsprogrambiblioteket.h b/librifunktionsteckensnittsglyfrasteriseringsprogrambiblioteket.h
index aa6f4ce..ef53fea 100644
--- a/librifunktionsteckensnittsglyfrasteriseringsprogrambiblioteket.h
+++ b/librifunktionsteckensnittsglyfrasteriseringsprogrambiblioteket.h
@@ -128,19 +128,29 @@ void rtgrpblib_draw_cubic_bezier(RTGRPBLIB_RASTER *restrict raster,
double x4, double y4);
/**
- * Draw a elliptical arc
+ * Draw a circular arc
*
* @param raster The drawing buffer
- * @param x0, y0 The midpoint of the ellipse
- * @param semiwidth Half the width of the ellipse
- * @param semiheight Half the height of the ellipse
+ * @param x0, y0 The midpoint of the circle
+ * @param semiwidth Half the width of the circle
+ * @param semiheight Half the height of the circle
* @param start The angular starting point of the arc, in radians
* @param end The angular end point of the arc, in radians
+ *
+ * Rather than specify a radius, a semimajor and semiminor is
+ * specified, despite this, the shape is called a circular rather
+ * than elliptical, this is because the function is indented to
+ * draw a circular arc on a image with different horizontal
+ * and vertical cell densities; note an elliptical arc on an image
+ * with the same horizontal as vertical cell density. This is
+ * why the function doesn't provide a way to rotate the ellipse:
+ * it's a circle, not an ellipse, and circles are perfectly
+ * symmetrical
*/
-void rtgrpblib_draw_elliptical_arc(RTGRPBLIB_RASTER *restrict raster,
- double x0, double y0,
- double semiwidth, double semiheight,
- double start, double end);
+void rtgrpblib_draw_circular_arc(RTGRPBLIB_RASTER *restrict raster,
+ double x0, double y0,
+ double semiwidth, double semiheight,
+ double start, double end);
#if defined(__clang__)
diff --git a/rtgrpblib_draw_elliptical_arc.c b/rtgrpblib_draw_circular_arc.c
index 514ea14..f30fde7 100644
--- a/rtgrpblib_draw_elliptical_arc.c
+++ b/rtgrpblib_draw_circular_arc.c
@@ -4,8 +4,8 @@
void
-rtgrpblib_draw_elliptical_arc(RASTER *restrict raster, double x0, double y0,
- double semiwidth, double semiheight, double start, double end)
+rtgrpblib_draw_circular_arc(RASTER *restrict raster, double x0, double y0,
+ double semiwidth, double semiheight, double start, double end)
{
double inc, v, x, y, prevX, prevY;
diff --git a/rtgrpblib_draw_linear_bezier.3 b/rtgrpblib_draw_linear_bezier.3
index 7cc67c9..05b12f9 100644
--- a/rtgrpblib_draw_linear_bezier.3
+++ b/rtgrpblib_draw_linear_bezier.3
@@ -20,7 +20,7 @@ The
.BR rtgrpblib_draw_linear_bezier ()
function draws onto
.I raster
-a line segment from
+a line segment, as part a contour, from
.RI ( x1 ,
.IR y1 )
to
@@ -39,4 +39,4 @@ None.
.BR rtgrpblib_fill_shapes (3),
.BR rtgrpblib_draw_quadratic_bezier (3),
.BR rtgrpblib_draw_cubic_bezier (3),
-.BR rtgrpblib_draw_elliptical_arc (3)
+.BR rtgrpblib_draw_circular_arc (3)
diff --git a/rtgrpblib_fill_shapes.3 b/rtgrpblib_fill_shapes.3
index 7bd58b5..8c01995 100644
--- a/rtgrpblib_fill_shapes.3
+++ b/rtgrpblib_fill_shapes.3
@@ -82,4 +82,4 @@ has the index
.BR rtgrpblib_draw_linear_bezier (3),
.BR rtgrpblib_draw_quadratic_bezier (3),
.BR rtgrpblib_draw_cubic_bezier (3),
-.BR rtgrpblib_draw_elliptical_arc (3)
+.BR rtgrpblib_draw_circular_arc (3)