title: Adding Times New Roman to Ghostscript in Ubuntu
body: <p>Using Ghostscript 8.71 in Ubuntu, but having trouble reading a PDF file that has the times new roman font on all its pages.</p>
  
  <p>I downloaded the msttcorefonts package and created a Fontmap file for Ghostscript, but this just doesnt seem to work.</p>
  
  <p>My Fontmap file looks like this:</p>
  
  <pre><code>/Times (/usr/share/fonts/truetype/msttcorefonts/times.ttf);
  /Times-Roman (/usr/share/fonts/truetype/msttcorefonts/times.ttf);
  /Times-Bold (/usr/share/fonts/truetype/msttcorefonts/timesbd.ttf);
  /Times-BoldItalic (/usr/share/fonts/truetype/msttcorefonts/timesbi.ttf);
  /Times-Italic (/usr/share/fonts/truetype/msttcorefonts/timesi.ttf);
  </code></pre>
  
  <p>The Ghostscript command I use:</p>
  
  <pre><code>gs -sFONTMAP=/usr/share/ghostscript/8.71/Fontmap bad.pdf -o good.pdf
  </code></pre>
  
  <p>And this is the error I get:</p>
  
  <pre><code>GPL Ghostscript 8.71 (2010-02-10)
  Copyright (C) 2010 Artifex Software, Inc.  All rights reserved.
  This software comes with NO WARRANTY: see the file PUBLIC for details.
  Processing pages 1 through 3.
  Page 1
  Error: /undefined in --run--
  Operand stack:
     --dict:5/14(L)--   F2   11.0   FontObject   --dict:8/8(L)--   --dict:8/8(L)--   397   --dict:8/8(L)--
  Execution stack:
     %interp_exit   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--   --nostringval--   --nostringval--   false   1   %stopped_push   1878   1   3   %oparray_pop   1877   1   3   %oparray_pop   1861   1   3   %oparray_pop   --nostringval--   --nostringval--   2   1   3   --nostringval--   %for_pos_int_continue   --nostringval--   --nostringval--   --nostringval--   --nostringval--   %array_continue   --nostringval--   false   1   %stopped_push   --nostringval--   %loop_continue   --nostringval--   --nostringval--   --nostringval--   --nostringval--   --nostringval--   --nostringval--   --nostringval--
  Dictionary stack:
     --dict:1151/1684(ro)(G)--   --dict:1/20(G)--   --dict:75/200(L)--   --dict:75/200(L)--   --dict:108/127(ro)(G)--   --dict:288/300(ro)(G)--   --dict:22/25(L)--   --dict:6/8(L)--   --dict:25/40(L)--   --dict:1151/1684(ro)(G)--   --dict:10/10(L)--
  Current allocation mode is local
  Last OS error: 2
  GPL Ghostscript 8.71: Unrecoverable error, exit code 1
  </code></pre>
  
  <p>Could anyone please help me on this? I feel like I've exhausted all possibilities that I can think of.</p>
  
  <p>Here is the PDF file I'm trying to run through Ghostscript: <a href="http://www.asmeengineering.co.uk/bad.pdf" rel="nofollow">bad.pdf</a></p>
  
  <p>If I load all fonts like so:</p>
  
  <pre><code>gs -c 'loadallfonts quit'
  </code></pre>
  
  <p>Then the only references to the Times New Roman font is:</p>
  
  <pre><code>Loading TimesNewRomanPS-BoldItalicMT font from /usr/share/fonts/truetype/msttcorefonts/timesbi.ttf... 4310316 2923512 4001304 2206507 1 done.
  </code></pre>
  
  <p>Reading the properties of the attached PDF, I can see the font it actually wants is <strong>TimesNewRomainPSMT</strong>. Why is gs not loading all fonts in the msttcorefonts folder?</p>