d.text(1grass)

✨ d.text ✨ (the GRASS text-drawing icon)

okay bestie, gather round πŸ’– this is d.text from the GRASS User's Manual β€” it draws text in the active display frame on your graphics monitor, using the current font. that's it, that's the whole vibe. also it's d.text(1grass) if you're being formal, and its keywords are display and cartography. πŸŽ€


🌸 SYNOPSIS 🌸

d.text
d.text --help
d.text [-pgbrs]  [text=string]   [input=name]   [color=name]
[bgcolor=name]   [rotation=float]   [linespacing=float]   [at=x,y]
[line=integer]   [align=string]   [font=string]   [size=float]
[path=name]   [charset=string]   [--help]  [--verbose]  [--quiet]
[--ui]

🚩 Flags

  • -p β€” screen position, in pixels ([0,0] is the top left, so like, screen coords, not map coords)
  • -g β€” screen position in geographic coordinates (map brain mode πŸ—ΊοΈ)
  • -b β€” use bold text, yes queen
  • -r β€” rotation is in radians instead of degrees
  • -s β€” font size means height in pixels
  • --help β€” print usage summary
  • --verbose β€” verbose module output (chatty mode)
  • --quiet β€” quiet module output (shh mode)
  • --ui β€” force launching the GUI dialog

πŸŽ€ Parameters

  • text=string β€” Text to display
  • input=name β€” Input file
  • color=name β€” Text color. Either a standard color name or R:G:B triplet. Default: gray
  • bgcolor=name β€” Text background color. Either a standard color name, R:G:B triplet, or "none". Default: none
  • rotation=float β€” Rotation angle in degrees (counter-clockwise). Default: 0
  • linespacing=float β€” Line spacing. Default: 1.25
  • at=x,y β€” Screen position at which text will begin to be drawn (percentage, [0,0] is lower left)
  • line=integer β€” The screen line number on which text will begin to be drawn. Options: 1-1000
  • align=string β€” Text alignment. Options: ll, lc, lr, cl, cc, cr, ul, uc, ur. Default: ll
  • font=string β€” Font name
  • size=float β€” Height of letters in percentage of available frame height. Options: 0-100. Default: 5
  • path=name β€” Path to font file
  • charset=string β€” Text encoding (only applicable to TrueType fonts)

πŸ’… DESCRIPTION πŸ’…

so d.text draws text in the active display frame on the graphics monitor. periodt.

You can feed it text through standard input, or redirect it from a file (you know, the classic UNIX redirection mechanism 🐚). And here's the fun part: on top of all the command-line options, you can also tweak colors, text size, font type, rotation angle, and boldness with commands inside standard input. like, if you run d.text with no options on the command line and then assign values to those options on lines within the standard input β€” yeah, that works. main character behavior fr fr.

πŸ“œ Commands

  • .C color β€” where color is one of the available colors. Makes text on all the subsequent lines get drawn in that color. πŸ’–
  • .G color β€” where color is one of the available colors. Makes the background of text on subsequent lines get drawn in that color.
  • .S size β€” where size is a percentage in the range 0 to 100. Adjusts text size. Heads up bestie: a size of 10 would let 10 lines be drawn in the active display frame, 5 would allow the drawing of 20 lines, and 50 would allow the drawing of 2 lines. math is math. ✨
  • .F font β€” where font is one of the fonts known by the GRASS program d.font. Manipulates the font type. Available fonts are listed in the GRASS manual entry for d.font. The default font type used (if unspecified by the user) is romans.
  • .R rotation β€” where rotation is an angle in degrees, counter-clockwise. Rotates the text. πŸŒ€
  • .B 1 β€” stipulates that following text be printed in bold. This command means bold on.
  • .B 0 β€” turns bold off for all text appearing on lines beneath it. (Bold off is used by default, if unspecified by the user.)

🌈 EXAMPLE 🌈

the following command will print the short phrase "This is a test of d.text" in the active display frame using the color yellow, in bold, and using 4/100'ths (4%) of the active frame's vertical space per line:

d.text text="This is a test of d.text" color=yellow bgcolor=gray size=4
Displayed Text

(and yes, Displayed Text is literally the caption of that render β€” she's labeled, your honor πŸ’€)


πŸ¦‹ NOTES πŸ¦‹

  • note that the GRASS command d.title creates map TITLEs in a format suitable for input to d.text. cute crossover episode 🫢
  • d.text needs escape sequences that can be used within lines to change colors, boldness, and perhaps size. (yes, "perhaps" β€” that's what the manual says, not me, I don't make the rules πŸ™ˆ)

πŸ‘‘ SEE ALSO πŸ‘‘

  • d.font
  • d.title
  • d.labels

πŸ’œ AUTHORS πŸ’œ

  • James Westervelt, U.S. Army Construction Engineering Research Laboratory
  • Updates by Huidae Cho

πŸ”₯ SOURCE CODE πŸ”₯

Available at: d.text source code (history)

Latest change: Monday Nov 03 07:16:48 2025 in commit: c96796774942e46bbababcd652d3986d4e295665

Main index | Display index | Topics index | Keywords index | Graphical index | Full index

Β© 2003-2026 GRASS Development Team, GRASS 8.5.0 Reference Manual


okay that's the whole page, no notes left behind, every flag accounted for πŸ’– this was d.text(1grass) from GRASS 8.5.0 β€” and the footer tells us it's GRASS 8.5.0 all the way down, so go draw some pretty words on your monitor and slay βœ¨πŸŽ€

πŸ“¦ where this page comes from