6

Now that the mystery is solved, why the PDF font size is 11.955 when declaring the documentclass as 12pt (see Why does PDFLaTeX and XeLaTeX generates 11.955 font size for 12pt documentclass option?), I stumbled over the next puzzling thing with PDF font sizes:

When combining Arial and Helvetica in the same .tex file like so:

% !TEX TS-program = xelatex
\documentclass[12pt]{article}

\usepackage{fontspec}
\newfontfamily\myArialFont{Arial} % only works on Win/Mac where Arial is installed 
\newfontfamily\myHelveticaFont{Helvetica}

\begin{document}
{\myArialFont This font size its 11.955 in PDF}

{\myHelveticaFont And this one is 11.911 in PDF??}
\end{document}

I am getting two different font sizes in the corresponding PDF code (using xelatex --output-driver="xdvipdfmx -V4 -z0" to compile without PDF compression):

stream
 q 1 0 0 1 72 720 cm BT 
/F1 11.955 Tf 56.41 -65.75 Td
[<0037004b004c0056>-278<0049005200510057>-277<0056004c005d0048>-278<004c00570056>-278<0014>73<00140011001c00180018>-277<004c0051>-278<003300270029>]TJ 
/F2 11.911 Tf 0 -14.45 Td
[<0024>-2<0051>-2<0047>-2<0003>-1<0057>-2<004b>-2<004c0056>-2<0003>-1<0052>-2<0051>-3<0048>-2<0003>-1<004c>-1<0056>-1<0003>-1<0014>70<0014>-1<0011>-1<001c>-2<0014>71<0014>-1<0003>-1<004c>-1<0051>-2<0003>-1<0033>-2<0027>-3<0029>-2<0022>-2<0022>]TJ /F3 11.955 Tf 173.79 -549.94 Td[<0052>]TJ 
ET Q

(I've added a few more line breaks into the stream object to make the PDF commands clearer).

One can see that /F1 11.955 Tf (Arial) and /F2 11.911 Tf (Helvetica) are selected with different sizes. Why?

This might be related to the representation of the text in the following PDF array (I am still learning PDF and don't know why the Arial text uses these long hex numbers while the Helvetica text uses the short numbers.)

closed as off-topic by Paul Gessler, Jesse, Svend Tveskæg, user31729, ChrisS Mar 12 '15 at 8:04

  • This question does not fall within the scope of TeX, LaTeX or related typesetting systems as defined in the help center.
If this question can be reworded to fit the rules in the help center, please edit the question.

  • 2
    Well isn't this difference a natural occurrence? I mean XeLaTex compiler actually let's you use .ttf true type fonts...adjusting each time their size, as best, to your desired output? Are you getting any warnings during compiling....something like "no fonts found"..."Font size x used instead"? – Jean Mentz Sep 19 '14 at 13:20
  • Although Arial was designed as a successor/lookalike/replacement of Helvetica this does mean that Arial is a unique copy of Helvetica! – user31729 Sep 19 '14 at 14:18
  • @ChristianHupfer Of course they are not exactly the same but I wanted to tinker with metric compatible fonts and thought that Arial and Helvetica are... – Linda Sep 19 '14 at 14:38
  • 2
    i haven't checked, so this is speculation, but often "unrelated" fonts were designed with different x-heights, and scaling to make the x-heights uniform is a common (intentional) adjustment for use in tex documents. (computer modern was designed to have built-in height uniformity, so it doesn't happen when you're using cm or derivative fonts.) – barbara beeton Sep 19 '14 at 14:54
  • 4
    I'm voting to close this question as off-topic because the issue no longer occurs with an updated TeX distribution. – Paul Gessler Mar 12 '15 at 3:24
1

I'm not sure how much of an "answer" this is going to turn out to be, but for what it's worth:

As of the time of writing, this no longer happens with an updated TeX Live 2014. So it was fixed at some point.

Compiling your MWE using xelatex --output-driver="xdvipdfmx -V4 -z0" I find the following when inspecting the output PDF with a text editor:

stream
 q 1 0 0 1 72 720 cm BT 
/F1 11.955 Tf 56.41 -65.75 Td[<0037004b004c0056>-278<0049005200510057>-277<0056004c005d0048>-278<004c00570056>-278<0014>73<00140011001c00180018>-277<004c0051>-278<003300270029>]TJ 
/F2 11.955 Tf 0 -14.45 Td[<002400510047>-278<0057004b004c0056>-277<005200510048>-278<004c0056>-278<0014>73<00140011001c0014>73<0014>-276<004c0051>-278<00330027002900220022>]TJ 
/F3 11.955 Tf 173.79 -549.94 Td[<0052>]TJ ET Q

endstream

(Line breaks added by me.)

According to the Document Properties, the three fonts are

  • ArialMT
  • Helvetica
  • LMRoman12-Regular

and as can be seen in the stream object, they all have a point size of 11.955.

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