GeneralEmbed fonts in pdf

LaTeX specific issues not fitting into one of the other forums of this category.
rensv
Posts: 6
Joined: Sat May 24, 2008 12:41 pm

Embed fonts in pdf

Post by rensv »

Hello,

I am creating my PhD thesis using MikTex and TexnicCenter. I created a PDF from my dvi file using dvips and ghostscript, but when I sent this pdf-file to the print-shop they said that not all fonts were embedded which could give trouble when they print it. Can somebody tell me how I can embed the fonts?

Thanks,
Rens

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Re: Embed fonts in pdf

Post by localghost »

You have to give a bit more detailed information. Embedding fonts is normally no problem. To figure out what could be going wrong, please post the complete preamble of the affected document.


Best regards
Thorsten
rensv
Posts: 6
Joined: Sat May 24, 2008 12:41 pm

Re: Embed fonts in pdf

Post by rensv »

Thanks for your reply.

Here is my main tex file, and some extra style files I used. Does that help?
Attachments
macros.sty
(1.58 KiB) Downloaded 494 times
thesis.sty
(6.95 KiB) Downloaded 478 times
thesis.tex
(1.91 KiB) Downloaded 575 times
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Embed fonts in pdf

Post by localghost »

OK, that's something I can deal with. At first sight, there's the activation of Type 1 fonts missing (Cork Encoding).

Code: Select all

\usepackage[T1]{fontenc}
This already could be enough to get the desired result. Furthermore I noticed that you are loading the mathptmx package as one single additional postscript font. That means that for other font families (sans serif, typewriter) there are possibly no Type 1 fonts provided. And if you are using commands like \textsf{...} or \texttt{...} (or switches like \sffamily or \ttfamily), these font families can't be provided in the demanded quality hence they can't be embedded in the resulting PDF document.

Now there are two possible solutions. Load the mathptmx package in combination with two other postscript font packages.

Code: Select all

\usepackage{mathptmx}
\usepackage[scaled]{helvet}    % for sans serif fonts (\textsf{...} or \sffamiliy)
\usepackage{luximono}          % for monospaced fonts (\texttt{...} or \ttfamily)
Since your standard font style is Times, you may take a look at the txfonts. You then only have to load one single package with a complete set for all families, series and shapes with Times style.

Code: Select all

\usepackage{txfonts}
All the mentioned packages and their documentations can be found in the CTAN Catalogue. In case of further problems, feel free to ask.
rensv
Posts: 6
Joined: Sat May 24, 2008 12:41 pm

Re: Embed fonts in pdf

Post by rensv »

Thank you very much, however I cannot get this txfonts package working.
I used the command: \usepackage{txfonts}

and when I compiled, TexnicCenter asked to download this missing package, but it did not succeed. So, alternatively, I downloaded it manually from the CTAN page you referred to. But after following the setup instructions I still get the error message:

the required file: tex\latex\txfonts\txfonts.sty is missing. ...etc

which is not strange because I put txfonts.sty in tex\latex\txr as suggested in the installation guide. But even if I rename the directory to txfonts I still get the same error message. What's wrong?

Thanks,
Rens
User avatar
Stefan Kottwitz
Site Admin
Posts: 10345
Joined: Mon Mar 10, 2008 9:44 pm

Embed fonts in pdf

Post by Stefan Kottwitz »

Hi Rens,

go to the MiKTeX Options and click the Refresh FNDB button to update the package database.

Stefan
LaTeX.org admin
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Embed fonts in pdf

Post by localghost »

Instruct MiKTeX to use a server in your home country. Open the MiKTeX Package Manager (Start > Programs > MiKTeX > Browse Packages) and select via the Repository menu "Change Package Repository". There you can choose the new server from a list. Make sure that you use MiKTeX 2.6 or higher.

Now that you have already copied the STY file into the texmf tree, you have to refresh the file name database. You can do that with the MikTeX Options (Start > Programs > MiKTeX > Settings) or in the command prompt.

Code: Select all

texhash
Additionally you should put the documentation into the texmf tree.
rensv
Posts: 6
Joined: Sat May 24, 2008 12:41 pm

Re: Embed fonts in pdf

Post by rensv »

Ok, thanks.
I managed to install the packages, but unfortunately it didn't solve my original problem. When I open my pdf and look at document properties -> fonts then most fonts are embedded, but still some fonts (Helvetica, Symbol, Times-Bold, Times-BoldItalic, Times-Italic, Times-Roman) are not embedded and for these fonts it also states that the actual font is something else. For example TimesNewRomanPSMT for Times-Roman etc.

Maybe there is something wrong with my ghostscript, because when I build a postscript file everything is fine, but when I use ghostscript to make a pdf out of my ps file i get errormessages in texniccenter like these:
Can't find (or can't open) font file C:\program files\gs\gs8.54\Resource/Font/TimesNewRomanPSMT
Can't find (or can't open) font file TimesNewRomanPSMT
Didn't find this font on the system!
Substituting Times-Roman for TimesNewRomanPSMT

etc.

I would really appreciate help on this subject.

Rens
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Embed fonts in pdf

Post by localghost »

rensv wrote:[...] Maybe there is something wrong with my ghostscript, because when I build a postscript file everything is fine, but when I use ghostscript to make a pdf out of my ps file i get errormessages in texniccenter like these:
Can't find (or can't open) font file C:\program files\gs\gs8.54\Resource/Font/TimesNewRomanPSMT
Can't find (or can't open) font file TimesNewRomanPSMT
Didn't find this font on the system!
Substituting Times-Roman for TimesNewRomanPSMT
[...]
Perhaps an upgrade to the newest version of Ghostscript will do. For Windows the current version is 8.61, because version 8.62 is not yet available for this operating system.

Another possible solution could be that you did not install the fonts for Ghostscript. But as far as I remember, this is done automatically but can be unchecked during installation process. So, make sure that the fonts are properly installed when upgrading.
rensv
Posts: 6
Joined: Sat May 24, 2008 12:41 pm

Re: Embed fonts in pdf

Post by rensv »

Nope, that didn't work, but still thanks for the help. any other suggestions?
I am not really attached to these fonts so if someone can tell me how to replace them, maybe that would do the trick.

Rens
Post Reply