Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions doc/techref/fonts.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Supported Fonts

PyGMT supports the 35 standard PostScript fonts. The table below lists them with their
font numbers and font names. When specifying fonts in PyGMT, you can either give the
font name or just the font number. For example, to use the font "Helvetica", you can use
either `"Helvetica"` or `"0"`. For the special fonts "Symbol" (**12**) and
"ZapfDingbats" (**34**), see the {doc}`/techref/encodings` for the character set.
The image below the table shows a visual sample for each font.

| Font No. | Font Name | Font No. | Font Name |
|----------|------------------------|----------|------------------------------|
| 0 | Helvetica | 17 | Bookman-Demi |
| 1 | Helvetica-Bold | 18 | Bookman-DemiItalic |
| 2 | Helvetica-Oblique | 19 | Bookman-Light |
| 3 | Helvetica-BoldOblique | 20 | Bookman-LightItalic |
| 4 | Times-Roman | 21 | Helvetica-Narrow |
| 5 | Times-Bold | 22 | Helvetica-Narrow-Bold |
| 6 | Times-Italic | 23 | Helvetica-Narrow-Oblique |
| 7 | Times-BoldItalic | 24 | Helvetica-Narrow-BoldOblique |
| 8 | Courier | 25 | NewCenturySchlbk-Roman |
| 9 | Courier-Bold | 26 | NewCenturySchlbk-Italic |
| 10 | Courier-Oblique | 27 | NewCenturySchlbk-Bold |
| 11 | Courier-BoldOblique | 28 | NewCenturySchlbk-BoldItalic |
| 12 | Symbol | 29 | Palatino-Roman |
| 13 | AvantGarde-Book | 30 | Palatino-Italic |
| 14 | AvantGarde-BookOblique | 31 | Palatino-Bold |
| 15 | AvantGarde-Demi | 32 | Palatino-BoldItalic |
| 16 | AvantGarde-DemiOblique | 33 | ZapfChancery-MediumItalic |
| | | 34 | ZapfDingbats |

![Standard PostScript Fonts](https://docs.generic-mapping-tools.org/dev/_images/GMT_App_G.png){width="67.5%"}
1 change: 1 addition & 0 deletions doc/techref/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@ visit the {gmt-docs}`GMT Technical Reference <reference.html>`.
:maxdepth: 1

projections.md
fonts.md
encodings.md
```
28 changes: 12 additions & 16 deletions examples/gallery/symbols/text_symbols.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,18 @@
Text symbols
============

The :meth:`pygmt.Figure.plot` method allows to plot text symbols. Text is
normally placed with the :meth:`pygmt.Figure.text` method but there are times
we wish to treat a character or even a string as a plottable symbol.
A text symbol can be drawn by passing **l**\ *size*\ **+t**\ *string* to
the ``style`` parameter where *size* defines the size of the text symbol
(note: the size is only approximate; no individual scaling is done for
different characters) and *string* can be a letter or a text string
(less than 256 characters). Optionally, you can append
**+f**\ *font,outlinecolor* to select a particular font [Default is
:gmt-term:`FONT_ANNOT_PRIMARY`] and outline color [Default is black] as well
as **+j**\ *justify* to change the justification [Default is CM]. The fill
color of the text symbols can be set with the ``fill`` parameter, and the
outline width can be customized with the ``pen`` parameter.
For all supported octal codes and fonts see the GMT Technical Reference
:gmt-docs:`reference/octal-codes.html` and
:gmt-docs:`reference/postscript-fonts.html`.
Comment on lines -18 to -20
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer to remove this sentence because this gallery example should focus on "Typesetting text like symbols".

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we can reduce the sentence to:

For all supported fonts see :doc:`/techref/fonts`.

and move it up:

(less than 256 characters). Optionally, you can append
**+f**\ *font,outlinecolor* to select a particular font [Default is
:gmt-term:`FONT_ANNOT_PRIMARY`] and outline color [Default is black] as well
as **+j**\ *justify* to change the justification [Default is CM]. For all supported
fonts see :doc:`/techref/fonts`. The fill color of the text symbols can be set with
the ``fill`` parameter, and the outline width can be customized with the ``pen``
parameter.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in 9132a3f.

The :meth:`pygmt.Figure.plot` method allows to plot text symbols. Text is normally
placed with the :meth:`pygmt.Figure.text` method but there are times we wish to treat a
character or even a string as a plottable symbol. A text symbol can be drawn by passing
**l**\ *size*\ **+t**\ *string* to the ``style`` parameter where *size* defines the size
of the text symbol (note: the size is only approximate; no individual scaling is done
for different characters) and *string* can be a letter or a text string (less than 256
characters). Optionally, you can append **+f**\ *font,outlinecolor* to select a
particular font [Default is :gmt-term:`FONT_ANNOT_PRIMARY`] and outline color [Default
is black] as well as **+j**\ *justify* to change the justification [Default is CM]. For
all supported fonts see :doc:`/techref/fonts`. The fill color of the text symbols can be
set with the ``fill`` parameter, and the outline width can be customized with the
``pen`` parameter.
"""

# %%
Expand Down
6 changes: 3 additions & 3 deletions examples/tutorials/basics/text.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@
# There are several optional parameters to adjust the text label:
#
# * ``font``: Sets the size, family/weight, and color of the font for the text.
# A list of all recognized fonts can be found at
# :gmt-docs:`PostScript Fonts Used by GMT <reference/postscript-fonts.html>`,
# including details of how to use non-default fonts.
# A list of all recognized fonts can be found at :doc:`/techref/fonts`.
# For details of how to use non-default fonts, refer to
# :gmt-docs:`PostScript Fonts Used by GMT <reference/postscript-fonts.html>`.
# * ``angle``: Specifies the rotation of the text. It is measured counter-clockwise
# from the horizontal in degrees.
# * ``justify``: Defines the anchor point of the bounding box for the text. It is
Expand Down