.. _example_31:

(31) Using non-default fonts in PostScript
--------------------------------------------

This example illustrates several possibilities to create GMT plots
with non-default fonts. As these fonts are not part of the standard
PostScript font collection they have to be embedded in the PS- or
PDF-file with Ghostscript. See also
Cookbook Section :ref:`non-default-fonts` for further information. The script
includes the following steps:

-  create a ``PSL_custom_fonts.txt`` file;

-  set the GMT parameters :term:`MAP_DEGREE_SYMBOL`, :term:`PS_CHAR_ENCODING`, and :term:`FONT`;

The script produces the plot in Figure. All
standard fonts have been substituted by the free OpenType fonts Linux
Libertine (title) and Linux Biolinum (annotations).  Remote files with the locations
and names of the cities are used, with awk providing help in data preparation.

.. literalinclude:: /_verbatim/ex31.txt
   :language: bash

.. figure:: /_images/ex31.*
   :width: 500 px
   :align: center

   Using non-default fonts in PostScript.
