3

This question is essentially about the opposite of this question combined with this question.

I am using Latex to create a PDF for printing, which I would ideally like to be in Arial. I've currently got it in Helvetica, but I can't persuade the uarial package to work. I wondered whether, given that PDF readers might replace Helvetica with Arial if the Helvetica is not embedded, this might be a work-around for getting my document into Arial.

Does this work, and if so how is it achieved?

I tried telling ps2pdf not to embed all fonts, but I seemed to end up with an alternative font embedded instead of nothing.

  • 5
    Instead of trying some convoluted work-around where you can't know if the pdf driver used by the printer will use it you should better get uarial working. That's not so difficult. – Ulrike Fischer Aug 28 '15 at 11:37
  • @UlrikeFischer A lot of things become difficult when the person with the admin password to your machine doesn't believe in anything that isn't Microsoft. – Jessica B Aug 28 '15 at 20:16
  • You can put all files in the folder of your document. And you can load the map-file with \pdfmapfile. – Ulrike Fischer Aug 28 '15 at 20:22
4

I wondered whether, given that PDF readers might replace Helvetica with Arial if the Helvetica is not embedded, this might be a work-around for getting my document into Arial.

If a font is not embedded, then the behaviour depends on the PDF viewer, user settings, OS, available fonts, and system and user font configuration.

That is, if the font is not embedded, all bets are off: you cannot know what will happen. For example, the viewer might first see if the font is available (e.g. Helvetica is installed), then read a font-substitution list to see if it has instructions regarding Helvetica specifically, then try to figure out what kind of font might be a reasonable fall-back. Or it might ask the system's font configuration tools for Helvetica. Those tools might then see if Helvetica is covered by its substitution rules or otherwise try to find an alternative.

The font used might or might not be Helvetica. If not, it might, if you are lucky, at least be a sans somewhat like Helvetica (hopefully, but not necessarily, with the same metrics). It might or might not recognise, for example, ligatures correctly. If it doesn't, it might just leave gaps or it might use empty boxes. (It probably won't use e.g. 2 'f's - at least, I've never seen this relatively happy substitution for 'ff'.)

It is therefore a much better idea to:

  1. get uarial working, if you can, if that's what you want to use;
  2. embed another font, if you can't, even if it is not your first choice.

uarial

The uarial package should work fine:

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Uncomment the map line if you are in either of the following 2 situations:
% uarial is installed, but the font map files for the system have not been correctly updated
% uarial is not installed at all, but you have put all the files from the package in your working directory (*.sty, *.fd, *.map, *.pfb, *.tfm, *.vf)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%\pdfmapfile{+ua1.map}
\usepackage{uarial,kantlipsum}

\begin{document}
\sffamily
\kant[1-3]
\end{document}

<code>uarial</code>

The above is the font A030, installed with the get-non-free-fonts script (getnonfreefonts-sys variety).

To actually get a font called Arial, I can compile the following with LuaLaTeX or XeLaTeX, provided a font with this name is installed for my system (e.g. in /usr/share/fonts):

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage{fontspec}
\usepackage{kantlipsum}
\setmainfont{Arial}

\begin{document}
  \kant[1-3]
\end{document}

Arial

I am guessing that when you say that you are using Helvetica, you are actually using NimbusSanL. This is what you would get using the above code with helvet in place of uarial.

NimbusSansL

Another option would be TeX Gyre Heros, which is supported by the tgheros package:

TeX Gyre Heros

Here, for the record, is a font which is actually called HelveticaNeue:

HelveticaNeue

Embedding

Whether fonts are embedded or not depends on a range of factors:

  1. TeX distribution and version;
  2. kind of font;
  3. compilation engine;
  4. system-wide and, possibly, user-specific configuration;
  5. more....

For a current (2015) installation of TeX Live from upstream, embedding is configured in updmap.cfg. System-wide defaults are in $(kpsewhich -var TEXMFDIST)/web2c/updmap.cfg. Instructions at the top of the file explain how to override settings system-wide and/or (in some cases) on a user-by-user basis.

For example, the line

LW35 URWkb

determines which fonts TeX Live uses when I load helvet. In this case (as I've not overridden this anywhere), it is using URW versions named according to the Karl Berry font-name scheme.

dvipsDownloadBase35 true

tells dvips to embed the 35 standard PS fonts.

pdftexDownloadBase14 true

tells pdftex to embed the 14 base PDF fonts while

dvipdfmDownloadBase14 true

tells dvipdfm(x) to do the same. Finally

kanjiEmbed noEmbed

tells dvipdfmx not to embed the Kanji fonts.

Beyond this, lines in individual .map files determine the lines which end up in the system-wide .map files, and these, too, can affect embedding e.g. by embedding subsets rather than entire fonts in certain cases.

On my system, I can override the settings from updmap.cfg above in a corresponding file in TEXMFLOCAL. I can also override them, I think, using a similar file in TEXMFHOME. However, the way in which updmap and updmap-sys work has changed more than once in recent editions of TeX Live. What is true for TL 2015, therefore, may or may not be true for TL 2013 or TL 2011 etc.

This all also depends, ultimately, on settings in texmf.cnf which determine which TEXMF trees are recognised, in which order they are searched and how they are to be searched. Again, this depends on TeX distribution, version and packaging, and on whether the default configuration has been altered by the system administrator.

If you are using Red Hat's packages, for example, the default configuration will be different, and, obviously, your system administrator may have made further changes.

EDIT

Here's a comparison of 4 fonts on my machine (font names on the right).

comparison

  • 1
    Please could you explain how this is supposed to answer the question? I've already said that the package doesn't work in my case. Saying that it should doesn't help me at all. – Jessica B Aug 28 '15 at 20:07
  • 1
    @JessicaB You haven't said (1) what you've done i.e. the code you are using, or (2) what 'doesn't work' means. We're not mind readers ;). For all you've said, this might well help because you might be attempting to use the font using different code. It isn't possible to diagnose any problem without information about that problem. So any attempt to help is inevitably a shot in the dark. Of course, that makes it unlikely it will help: such is the intrinsic nature of such shots. I wrote this to check the package worked and posted it in case it helped. I'm sorry, but unsurprised, it doesn't. – cfr Aug 28 '15 at 21:09
  • @JessicaB Also, you only need to add the .map, as Ulrike Fischer explained. I've added some comments to the code about this. – cfr Aug 28 '15 at 21:20
  • 1
    @JessicaB I'm sorry, by the way, that you felt this was impolite. It is not. It is just that you have essentially asked what is known as an 'XY problem'. Typically XY problems do not reveal Y: they just ask how to X, where X is something of an odd thing to want to do. In this case, the reason for asking X is clear: you think X will achieve Y. But, in fact, X is not a good way to achieve Y at all. Moreover, there are better ways to achieve Y and achieving X would neither achieve Y nor be itself an easy thing to achieve. Hence, my initial answer. But my edits should help clarify the problem. – cfr Aug 29 '15 at 23:57
  • 1
    @DanielWeissman See additional image above. On my machine, ua1 is more like ArialMT and uhv is more like HelveticaNeue. Note that there is generally, by now, no saying what Arial or Helvetica will actually be on any system - unless, maybe, you get commercial fonts and you can at least say that this is Adobe's Helvetica or whatever. But somebody else may say Adobe have it wrong. So anybody told they must use one as opposed to the other needs to know what the Powers that Be think each font should look like. But ua1 'G', 'R' and 'Q' are more ArialMT-like than HelveticaNeue-like here. – cfr Aug 9 '17 at 23:28
0

Here's a summary of the key points that directly address the question:

Changing the font of Latex-generated text is generally unsuccessful because of the ligatures.

It is difficult to deliberately avoid embedding a font in the PDF because this is not controlled directly from Latex.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.