d.text(1)

πŸ’– d.text β€” bestie, it's giving TEXT ON YOUR SCREEN πŸ’–

okay so this is a page from the GRASS GIS User's Manual (that's the manual name, mwah) and it's all about d.text, a lil program that ✨draws text✨ in the active display frame on your graphics monitor, using whatever font is currently loaded. cartography girlies, this one's for you πŸŽ€

🏷️ KEYWORDS

display, 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 (and heads up: [0,0] is the top left, not the bottom left, we're doing screen coords here bestie)
  • -g β€” screen position in geographic coordinates
  • -b β€” use bold text πŸ’ͺ
  • -r β€” use radians instead of degrees for rotation
  • -s β€” font size is height in pixels
  • --help β€” print usage summary
  • --verbose β€” verbose module output
  • --quiet β€” quiet module output
  • --ui β€” force launching GUI dialog

πŸŽ€ Parameters

  • text=string β€” text to display
  • input=name β€” input file
  • color=name β€” text color. either a standard color name or an R:G:B triplet. default: gray
  • bgcolor=name β€” text background color. either a standard color name, an 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, and [0,0] is lower left here, yes it's different from -p, don't @ me). options: 0-100
  • 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, fyi)

πŸ’… DESCRIPTION πŸ’…

so d.text draws text in the active display frame on the graphics monitor. that's the whole job, and it ate πŸ”₯

you can feed it text through standard input, or redirect it from a file (classic UNIX redirection mechanism, iykyk). and here's the cute part: on top of all the command line options, you can also adjust colors, text size, font type, rotation angle, and boldness with commands inside the standard input. like, if you invoke d.text with no options on the command line and then just assign values to these options on lines within the standard input. main character energy honestly.

πŸ“ Commands:

  • .C color β€” (where color is one of the available colors) causes text appearing on subsequent lines to be drawn in that color.
  • .G color β€” (where color is one of the available colors) causes the background of text appearing on subsequent lines to be drawn in that color.
  • .S size β€” (where size is a percentage within the range 0 to 100) adjusts text size. and bestie, note this: a size of 10 would allow 10 lines to 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 mathing πŸ“
  • .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) to rotate the text.
  • .B 1 β€” stipulates that following text be printed in bold. this command means bold on.
  • .B 0 β€” turns bold off of all text appearing on lines beneath it. (bold off is used by default, if unspecified by the user.)

🌈 EXAMPLE 🌈

this 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 πŸ¦‹


⚠️ NOTES ⚠️

  • note that the GRASS command d.title creates map TITLEs in a format suitable for input to d.text. slay, compatible.
  • d.text needs escape sequences that can be used within lines to change colors, boldness, and perhaps size.
no cap, that second one is a real note in the original and it's just out here stating a need. we love a mysterious queen. πŸ‘‘

πŸ‘€ 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)

Accessed: Saturday Jan 17 05:40:37 2026

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


and that's the whole page, bestie 🫢 this was the GRASS 8.4.2 Reference Manual for d.text(1), Β© 2003-2025 GRASS Development Team, GRASS GIS 8.4.2 β€” accessorized and documented with love πŸ’–βœ¨ go draw some text, periodt πŸ’…

πŸ“¦ where this page comes from