[Tex/LaTex] How to modify postscript file to use the same font as the main document

fontspostscript

I have to include a Postscript picture in a latex document. The ps file is generated by another program.
I would like to modify the font within the ps so that it correspond to the same main font of the document. ( modifying the font from inside the program that generated the ps file is not an option)

How could I achieve that for the following MWE (lualatex with opentype )?
How would it work with standard latex font (such latin modern, as an example)?

MWE:

\documentclass[]{article}
\usepackage{graphicx}
%lualatex setup
\usepackage{fontspec}
\setmainfont{MinionPro}%Or whatever
\setsansfont{Iwona}
%\usepackage{lmodern} %if using pdflatex

\begin{document}
\begin{figure}
\includegraphics[width=\textwidth,angle=270]{test.eps}
\end{figure}

\end{document}

From my limited knowledge of PostScript only these lines are involved with the font choice in the file:

%!PS-Adobe-2.0 EPSF-2.0
%%BoundingBox: 18 72 594 720
%%HiResBoundingBox: 18.000000 72.000000 594.000000 720.000000
%%Creator: TECPLOT
%%DocumentFonts: Helvetica Helvetica-Bold Symbol Times-Roman Times-Bold Times-Italic Times-BoldItalic Courier Courier-Bold
%%EndComments
% EPSF created by ps2eps 1.68
%%BeginProlog
1 1 translate
save
countdictstack
mark
newpath
/showpage {} def
/setpagedevice {pop} def
%%EndProlog
%%Page 1 1
/tecplotdict 120 dict def
tecplotdict begin
/ed  {exch def} def
/ftl {findfont exch scalefont setfont} def
/ftr {/ISOLatin1-Times-Roman ftl} def
/ftb {/ISOLatin1-Times-Bold ftl} def
/fti {/ISOLatin1-Times-Italic ftl} def
/ftib {/ISOLatin1-Times-BoldItalic ftl} def
/fcr {/ISOLatin1-Courier ftl} def
/fcb {/ISOLatin1-Courier-Bold ftl} def
/fhn {/ISOLatin1-Helvetica ftl} def
/fhb {/ISOLatin1-Helvetica-Bold ftl} def

Link to complete postscript example: https://gist.github.com/anonymous/323645a6884adfc56ea9

For the record, I tried to use inkscape to convert the file, but in the translation newlines and some formatting is lost.

I expect that it is be necessary to convert the font to a postscript compatible format, but possibly latex might have something built in (or some font might just work out of the box,don't know.)

Best Answer

Lorehead is right. You can change lines 297 and 298 of your PostScript file to:

/MinionPro-Regular getisofont /ISOLatin1-Helvetica       exch definefont pop
/MinionPro-Bold    getisofont /ISOLatin1-Helvetica-Bold  exch definefont pop

It seems to work with a variety of fonts installed on my system. You need to give the PostScript name of the font. otfinfo -i <filename> will return this.