# Psconvert PDF - Custom font

**URL:** <https://forum.generic-mapping-tools.org/t/psconvert-pdf-custom-font/1013>\
**Category:** Q&A\
**Tags:** gmt, font\
**Created:** [November 5, 2020, 9:07pm UTC](https://forum.generic-mapping-tools.org/t/psconvert-pdf-custom-font/1013 "2020-11-05T21:07:37Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![lavanya](https://avatars.discourse-cdn.com/v4/letter/l/df788c/32.png) [@lavanya](https://forum.generic-mapping-tools.org/u/lavanya)\
**Post date:** [November 5, 2020, 9:07pm UTC](https://forum.generic-mapping-tools.org/t/psconvert-pdf-custom-font/1013/1 "2020-11-05T21:07:37Z")

</div>

Hello all,

I am trying to convert my .ps file to pdf. I would like to use a custom font ‘Optima’. I managed to install this font in the GMT, and it works in the .ps file. However, when I am converting the .ps to .pdf, the font does not appear in the PDF. How can I resolve this font issue. Do I have to install the custom font in GhostScript or Adobe

I use the command psconvert outfile.ps -A -Tf

---

<div class="post-metadata">

**Author:** ![pwessel](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/pwessel/32/30_2.png) [@pwessel](https://forum.generic-mapping-tools.org/u/pwessel)\
**Post date:** [November 5, 2020, 9:23pm UTC](https://forum.generic-mapping-tools.org/t/psconvert-pdf-custom-font/1013/2 "2020-11-05T21:23:52Z")

</div>

I assume ghostscript needs to be told where those fonts of yours are hiding. Try to export the directory with your fonts via export **GS\_FONTPATH** =_yourfullpath_.

---

<div class="post-metadata">

**Author:** ![lavanya](https://avatars.discourse-cdn.com/v4/letter/l/df788c/32.png) [@lavanya](https://forum.generic-mapping-tools.org/u/lavanya)\
**Post date:** [November 8, 2020, 4:50am UTC](https://forum.generic-mapping-tools.org/t/psconvert-pdf-custom-font/1013/3 "2020-11-08T04:50:13Z")

</div>

Thanks for the suggestion. I copied the Optima font (.pfb, .afm and .pfm) in the $home/ghostscript/9.53.3/share/ghostscript/fonts and set the path to the directory. But, during the psconvert, I find that the GMT is unable to use this font. Please can you suggest how I get GMT to use Optima font in the final pdf.

Thank you.

---

<div class="post-metadata">

**Author:** ![pwessel](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/pwessel/32/30_2.png) [@pwessel](https://forum.generic-mapping-tools.org/u/pwessel)\
**Post date:** [November 8, 2020, 7:50pm UTC](https://forum.generic-mapping-tools.org/t/psconvert-pdf-custom-font/1013/4 "2020-11-08T19:50:25Z")

</div>

You need to tell us what the error messages are. Run the psconvert command with -Vd and post the result. See example 31 for a successful use of custom-supplied fonts.

---

<div class="post-metadata">

**Author:** ![lavanya](https://avatars.discourse-cdn.com/v4/letter/l/df788c/32.png) [@lavanya](https://forum.generic-mapping-tools.org/u/lavanya)\
**Post date:** [November 10, 2020, 6:56am UTC](https://forum.generic-mapping-tools.org/t/psconvert-pdf-custom-font/1013/5 "2020-11-10T06:56:27Z")

</div>

Many thanks for the suggestion. The command worked.  
gmt psconvert outfile.ps -A -C-sFONTPATH=\usr\font\custom-dir -Tf

---

<div class="post-metadata">

**Author:** ![listwanites](https://yyz1.discourse-cdn.com/flex047/user_avatar/forum.generic-mapping-tools.org/listwanites/32/4289_2.png) [@listwanites](https://forum.generic-mapping-tools.org/u/listwanites)\
**Post date:** [January 28, 2023, 3:27pm UTC](https://forum.generic-mapping-tools.org/t/psconvert-pdf-custom-font/1013/6 "2023-01-28T15:27:23Z")

</div>

This worked for me, although I’ve used the custom font (Roboto) for different commands (text and legend). Also, error messages still haunted me (“Representation of font type not recognized. Using default.”) but everything worked well. Even used custom color and background color for the text.
