Skip to content

Commit b468769

Browse files
seismanmichaelgrundyvonnefroehlich
authored
Document the supported 35 standard Postscript fonts in the Technical Reference section (#3378)
Co-authored-by: Michael Grund <[email protected]> Co-authored-by: Yvonne Fröhlich <[email protected]>
1 parent acd80db commit b468769

File tree

4 files changed

+47
-19
lines changed

4 files changed

+47
-19
lines changed

doc/techref/fonts.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Supported Fonts
2+
3+
PyGMT supports the 35 standard PostScript fonts. The table below lists them with their
4+
font numbers and font names. When specifying fonts in PyGMT, you can either give the
5+
font name or just the font number. For example, to use the font "Helvetica", you can use
6+
either `"Helvetica"` or `"0"`. For the special fonts "Symbol" (**12**) and
7+
"ZapfDingbats" (**34**), see the {doc}`/techref/encodings` for the character set.
8+
The image below the table shows a visual sample for each font.
9+
10+
| Font No. | Font Name | Font No. | Font Name |
11+
|----------|------------------------|----------|------------------------------|
12+
| 0 | Helvetica | 17 | Bookman-Demi |
13+
| 1 | Helvetica-Bold | 18 | Bookman-DemiItalic |
14+
| 2 | Helvetica-Oblique | 19 | Bookman-Light |
15+
| 3 | Helvetica-BoldOblique | 20 | Bookman-LightItalic |
16+
| 4 | Times-Roman | 21 | Helvetica-Narrow |
17+
| 5 | Times-Bold | 22 | Helvetica-Narrow-Bold |
18+
| 6 | Times-Italic | 23 | Helvetica-Narrow-Oblique |
19+
| 7 | Times-BoldItalic | 24 | Helvetica-Narrow-BoldOblique |
20+
| 8 | Courier | 25 | NewCenturySchlbk-Roman |
21+
| 9 | Courier-Bold | 26 | NewCenturySchlbk-Italic |
22+
| 10 | Courier-Oblique | 27 | NewCenturySchlbk-Bold |
23+
| 11 | Courier-BoldOblique | 28 | NewCenturySchlbk-BoldItalic |
24+
| 12 | Symbol | 29 | Palatino-Roman |
25+
| 13 | AvantGarde-Book | 30 | Palatino-Italic |
26+
| 14 | AvantGarde-BookOblique | 31 | Palatino-Bold |
27+
| 15 | AvantGarde-Demi | 32 | Palatino-BoldItalic |
28+
| 16 | AvantGarde-DemiOblique | 33 | ZapfChancery-MediumItalic |
29+
| | | 34 | ZapfDingbats |
30+
31+
![Standard PostScript Fonts](https://docs.generic-mapping-tools.org/dev/_images/GMT_App_G.png){width="67.5%"}

doc/techref/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,6 @@ visit the {gmt-docs}`GMT Technical Reference <reference.html>`.
99
:maxdepth: 1
1010
1111
projections.md
12+
fonts.md
1213
encodings.md
1314
```

examples/gallery/symbols/text_symbols.py

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,18 @@
22
Text symbols
33
============
44
5-
The :meth:`pygmt.Figure.plot` method allows to plot text symbols. Text is
6-
normally placed with the :meth:`pygmt.Figure.text` method but there are times
7-
we wish to treat a character or even a string as a plottable symbol.
8-
A text symbol can be drawn by passing **l**\ *size*\ **+t**\ *string* to
9-
the ``style`` parameter where *size* defines the size of the text symbol
10-
(note: the size is only approximate; no individual scaling is done for
11-
different characters) and *string* can be a letter or a text string
12-
(less than 256 characters). Optionally, you can append
13-
**+f**\ *font,outlinecolor* to select a particular font [Default is
14-
:gmt-term:`FONT_ANNOT_PRIMARY`] and outline color [Default is black] as well
15-
as **+j**\ *justify* to change the justification [Default is CM]. The fill
16-
color of the text symbols can be set with the ``fill`` parameter, and the
17-
outline width can be customized with the ``pen`` parameter.
18-
For all supported octal codes and fonts see the GMT Technical Reference
19-
:gmt-docs:`reference/octal-codes.html` and
20-
:gmt-docs:`reference/postscript-fonts.html`.
5+
The :meth:`pygmt.Figure.plot` method allows to plot text symbols. Text is normally
6+
placed with the :meth:`pygmt.Figure.text` method but there are times we wish to treat a
7+
character or even a string as a plottable symbol. A text symbol can be drawn by passing
8+
**l**\ *size*\ **+t**\ *string* to the ``style`` parameter where *size* defines the size
9+
of the text symbol (note: the size is only approximate; no individual scaling is done
10+
for different characters) and *string* can be a letter or a text string (less than 256
11+
characters). Optionally, you can append **+f**\ *font,outlinecolor* to select a
12+
particular font [Default is :gmt-term:`FONT_ANNOT_PRIMARY`] and outline color [Default
13+
is black] as well as **+j**\ *justify* to change the justification [Default is CM]. For
14+
all supported fonts see :doc:`/techref/fonts`. The fill color of the text symbols can be
15+
set with the ``fill`` parameter, and the outline width can be customized with the
16+
``pen`` parameter.
2117
"""
2218

2319
# %%

examples/tutorials/basics/text.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@
3131
# There are several optional parameters to adjust the text label:
3232
#
3333
# * ``font``: Sets the size, family/weight, and color of the font for the text.
34-
# A list of all recognized fonts can be found at
35-
# :gmt-docs:`PostScript Fonts Used by GMT <reference/postscript-fonts.html>`,
36-
# including details of how to use non-default fonts.
34+
# A list of all recognized fonts can be found at :doc:`/techref/fonts`.
35+
# For details of how to use non-default fonts, refer to
36+
# :gmt-docs:`PostScript Fonts Used by GMT <reference/postscript-fonts.html>`.
3737
# * ``angle``: Specifies the rotation of the text. It is measured counter-clockwise
3838
# from the horizontal in degrees.
3939
# * ``justify``: Defines the anchor point of the bounding box for the text. It is

0 commit comments

Comments
 (0)