Software: Apache. PHP/8.1.30 uname -a: Linux server1.tuhinhossain.com 5.15.0-151-generic #161-Ubuntu SMP Tue Jul 22 14:25:40 UTC uid=1002(picotech) gid=1003(picotech) groups=1003(picotech),0(root) Safe-mode: OFF (not secure) /usr/share/doc/groff-base/html/mom/ drwxr-xr-x |
Viewing file: Select action/file-type:
Graphical objectsIntroduction to graphical objects
Groff has a number of
inline escapes
for drawing rules, polygons, ellipses and splines. All begin with
\D (presumably for “Draw”) and are documented
in the groff info manual:
Experience shows that the most common graphical elements typesetters need are rules (horizontal and vertical), boxes, and circles (or ellipses). For this reason, mom provides macros to draw these objects in an easy-to-understand way; the results are predictable, and mom’s syntax makes fixes or tweaks painless.
For example, if you want to draw a 2-inch square outline box at the left
margin using groff’s \D escapes, it looks like this:
Here’s the same box, drawn with mom’s box drawing
macro
DBX:
Mom’s graphical object macros allow—in fact, require—giving the rule weight (“thickness”) for the object (or saying that you want it filled), an indent from the left margin where the object begins, the dimensions of the object, and optionally a colour for the object. There are no defaults for the arguments to mom'a graphical object macros, which means you must supply the arguments every time you invoke them. Note: As stated above, mom only provides macros for commonly-used graphical objects (rules, boxes, circles). More complex objects (polygons, non-straight lines, splines) must be drawn using groff’s \D escapes. Graphical object behaviourMom’s graphical object macros all behave in the following, carved-in-stone ways:
The consistency means that once you've mastered the very simple order of arguments that applies to invoking graphical object macros, you can draw objects with full confidence that you know exactly where they’re placed and how much room they occupy. Furthermore, because all return to their point of origin, you’ll know exactly where you are on the page. Order of argumentsThe order of arguments to the graphical object macros is the same for every macro:
A simple mnemonic for the order of arguments is “WILD Card”. If you fix the mnemonic in your brain and apply a little judicious reasoning, you’ll always remember how to draw graphical objects. The “judicious reasoning” means that, for example, horizontal rules don’t require a depth and vertical rules don’t require a length. Thus, in the case of drawing a horizontal rule, you supply the macro DRH with only the arguments (from the mnemonic) that apply: W-I-L (and possibly C). Graphical objects macrosDrawing horizontal rules
Macro: DRH <none> | <weight> <indent> <length> [<colour>]
•
the argument to <weight> is in
points,
but do NOT append the
unit of measure,
p
If all you want is to draw a rule from your current left margin to your current right margin (in other words, a "full measure" rule), you may invoke .DRH without any arguments. Note: DRH is the only graphical object macro that may be invoked without arguments. The weight (“thickness”) of the rule is determined by the argument you last gave the macro RULE_WEIGHT. DRH, used this way, is exactly equivalent to entering the inline escape, \*[RULE]. To draw horizontal rules of a specified length, you must, at a minimum, supply DRH with the arguments weight, indent (measured from the current left margin) and length. Optionally, you may give a colour argument. The colour may be either one defined with NEWCOLOR, or a named X-colour inititialized with XCOLOR, or an X-colour alias (again, initialized with XCOLOR).
Say, for example, you want to draw a 1-1/4 point horizontal rule
that starts 2 picas from the current left margin and runs for 3
inches. To do so, you'd invoke .DRH like this:
If, in addition, you want the rule blue:
How mom handles the positioning of horizontal rulesHorizontal rules are drawn from left to right, and from the baseline down. “From the baseline down” means that if you request a rule with a weight of four points, the four points of rule fall entirely below the baseline. Furthermore, after the rule is drawn, mom returns you to the current left margin, at the same vertical position on the page as when DRH was invoked. In other words, DRH causes no movement on the page, either horizontal or vertical. Drawing vertical rules
Macro: DRV <weight> <indent> <depth> [<colour>]
•
the argument to <weight> is in
points,
but do NOT append the
unit of measure,
p
To draw vertical rules of a specified length, you must, at a minimum, supply DRV with the arguments weight, indent (measured from the current left margin) and depth. Optionally, you may give a colour argument. The colour may be either one defined with NEWCOLOR, or a named X-colour inititialized with XCOLOR, or an X-colour alias (again, initialized with XCOLOR).
Say, for example, you want to draw a 3/4-point vertical rule that
starts 19-1/2 picas from the current left margin and has a depth of
6 centimeters. To do so, you'd invoke .DRV like this:
If, in addition, you want the rule red:
How mom handles the positioning of vertical rulesVertical rules are drawn from the baseline down, and from left to right. "Left to right" means that if you request a rule with a weight of four points, the four points of rule fall entirely to the left of the indent given to DRV. Furthermore, after the rule is drawn, mom returns you to the current left margin, at the same vertical position on the page as when DRV was invoked. In other words, DRV causes no movement on the page, either horizontal or vertical. Drawing boxes
Macro: DBX < <weight> | SOLID > <indent> <length> <depth> [<colour>]
•
the argument to <weight> is in
points,
but do NOT append the
unit of measure
p
To draw boxes of specified dimensions, you must, at a minimum, supply DBX with the arguments weight or SOLID, indent (measured from the current left margin), length and depth. Optionally, you may give a colour argument. The colour may be either one defined with NEWCOLOR, or a named X-colour inititialized with XCOLOR, or an X-colour alias (again, initialized with XCOLOR).
Say, for example, you want to draw a 1/2 point outline box that
starts one inch from the current left margin and has the dimensions
12 picas x 6 picas. To do so, you'd invoke .DBX like this:
If you want the same box, but solid (“filled”) rather
than drawn as an outline:
How mom handles the positioning of boxesBoxes are drawn from the baseline down, from left to right, and from the perimeter inward. “From the perimeter inward” means that if you request a box weight of six points, the 6-point rules used to draw the outline of the box fall entirely within the dimensions of the box. Furthermore, after the box is drawn, mom returns you to the current left margin, at the same vertical position on the page as when DBX was invoked. In other words, DBX causes no movement on the page, either horizontal or vertical. Drawing circles (ellipses)
Macro: DCL < <weight> | SOLID > <indent> <length> <depth> [<colour>]
• the argument to <weight> is in
points,
but do NOT append the
unit of measure,
p
To draw circles of specified dimensions, you must, at a minimum, supply DCL with the arguments weight or SOLID, indent (measured from the current left margin), length and depth. Optionally, you may give a colour argument. The colour may be either one defined with NEWCOLOR, or a named X-colour inititialized with XCOLOR, or an X-colour alias (again, initialized with XCOLOR).
Say, for example, you want to draw a 1/2 point outline circle
(ellipse, actually, in this case) that starts one inch from the
current left margin and has the dimensions 6 centimeters x 3
centimeters. To do so, you'd invoke .DCL like this:
If you want the same box, but solid (“filled”) rather
than drawn as an outline:
How mom handles the positioning of circles (ellipses)Circles (ellipses) are drawn from the baseline down, from left to right, and from the perimeter inward. “From the perimeter inward” means that if you request a circle weight of six points, the 6-point rule used to draw the outline of the circle or ellipse falls entirely within the dimensions of the circle or ellipse. Furthermore, after the circle is drawn, mom returns you to the current left margin, at the same vertical position on the page as when DCL was invoked. In other words, DCL causes no movement on the page, either horizontal or vertical.
|
:: Command execute :: | |
--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.005 ]-- |