Skip to content

Commit

Permalink
More updates
Browse files Browse the repository at this point in the history
  • Loading branch information
seisman committed Jan 6, 2025
1 parent 0ef4afa commit 8e497a7
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 10 deletions.
23 changes: 14 additions & 9 deletions doc/rst/source/text.rst
Original file line number Diff line number Diff line change
Expand Up @@ -196,24 +196,29 @@ Optional Arguments
at the Upper Left corner of the map.
- **+f** - Set the font ([*size*][,\ *fontname*][,\ *color*]); if no font info
is given then the input file must have this information in one of its columns.
- **+h** - Use the most recent segment header as the text to be plotted.
- **+j** - Set the text justification; if no justification is given then the input
file must have this item as a column.

Normally, the text is read from the data records. Alternative ways to provide text:

- **+h** - Use the most recent segment header as the text to be plotted.
- **+l** - Use the most recent segment label as the text to be plotted.
- **+r** - Use the record number (counting up from *first* [0]) as the text to be plotted.
- **+t** - Use the appended *text* to set a fixed text string (if *text* contains plus
characters then the **+t** modifier must be the last modifier in |-F|).
- **+z** - Format incoming *z* values to a string using the supplied *format*
[if not appended we use :term:`FORMAT_FLOAT_MAP`].

**Notes**: (1) If |-Z| is in effect then the *z* value used for formatting is in the
4th, not 3rd column. If you only want a specific word from the trailing text and
not the whole line, use **-it**\ *word* to indicate which word (0 is the first word)
you want. (2) Items read from the data file should be in the same order as
the modifiers are specified with the |-F| option. Example:
**-F**\ **+f**\ 12p,Helvetica-Bold,red\ **+j+a** selects a 12p red
Helvetica-Bold font and expects to read the justification and angle
from the file, in that order, after *x* *y* and before *text*.
**Notes**: |-F|\ **+h**\|\ **l**\|\ **r**\|\ **t**\| **z** can't be used with |-M|.

**Notes**: (1) If |-Z| is in effect then the *z* value used for formatting is in the
4th, not 3rd column. If you only want a specific word from the trailing text and
not the whole line, use **-it**\ *word* to indicate which word (0 is the first word)
you want. (2) Items read from the data file should be in the same order as
the modifiers are specified with the |-F| option. Example:
**-F**\ **+f**\ 12p,Helvetica-Bold,red\ **+j+a** selects a 12p red
Helvetica-Bold font and expects to read the justification and angle
from the file, in that order, after *x* *y* and before *text*.

.. _-G:

Expand Down
2 changes: 1 addition & 1 deletion src/pstext.c
Original file line number Diff line number Diff line change
Expand Up @@ -713,7 +713,7 @@ static int parse (struct GMT_CTRL *GMT, struct PSTEXT_CTRL *Ctrl, struct GMT_OPT
n_errors += gmt_M_check_condition (GMT, Ctrl->G.mode && Ctrl->M.active, "Option -Gc: Cannot be used with -M.\n");
n_errors += gmt_M_check_condition (GMT, Ctrl->G.mode && Ctrl->W.active, "Option -Gc: Cannot be used with -W.\n");
n_errors += gmt_M_check_condition (GMT, Ctrl->G.mode && Ctrl->D.line, "Option -Gc: Cannot be used with -D...v<pen>.\n");
n_errors += gmt_M_check_condition (GMT, Ctrl->M.active && Ctrl->F.get_text, "Option -M: Cannot be used with -F...+l|h.\n");
n_errors += gmt_M_check_condition (GMT, Ctrl->M.active && Ctrl->F.get_text, "Option -M: Cannot be used with -F...+l|h|r|t|z.\n");
n_errors += gmt_M_check_condition (GMT, Ctrl->S.active && !(Ctrl->G.active && Ctrl->G.mode == 0), "Option -S: Requires -G as well.\n");
n_errors += gmt_M_check_condition (GMT, strchr ("cC", Ctrl->C.mode) && !Ctrl->M.active, "Option -C: Box shape mode +tc|C is only available when -M is selected.\n");

Expand Down

0 comments on commit 8e497a7

Please sign in to comment.