# Why is LaTeX causing this font to misalign on one glyph?

I was playing around with the PF Goudy Pro Initials font on LaTeX, having recently purchased it. This font is a layered initials font, in which six iterations of the same character, typeset in six different "faces" (in fact, layers), can be stacked atop one another to form a nice initial. The

documentation for the font has more information on how this process works.

I used \llap to "stack" these glyphs, and it has worked excellently for every character I've tried (all of Latin A-Z, as well as several Greek and Cyrillic characters) except the Latin letter C, and the Cyrillic letter С. In this case, not only have the fifth and sixth layers been misaligned, but characters next to these glyphs also have alignment issues. It seems apparent that these alignment issues have something to do with \llap, but I don't know why specifically for C and its homoglyphs.

My first thought, naturally, was that there was a defect in the font itself. However, when I "stacked" the layers of C in Adobe Illustrator, and in Adobe InDesign,, the result came out perfectly, with all the layers aligning as intended. Thus, it seems that the issue is not with a defective character.

My MWE is below (I renamed the fonts so I could call them more easily; the native names are not PFx):

\documentclass[12pt]{article}
\usepackage{fontspec}
\newfontface\firstlayer{PF1.otf}[Scale=10]
\newfontface\secondlayer{PF2.otf}[Scale=10]
\newfontface\thirdlayer{PF3.otf}[Scale=10]
\newfontface\fourthlayer{PF4.otf}[Scale=10]
\newfontface\fifthlayer{PF5.otf}[Scale=10]
\newfontface\sixthlayer{PF6.otf}[Scale=10]
\usepackage[usenames,dvipsnames,svgnames,table]{xcolor}
\newlength\tindent
\setlength{\tindent}{\parindent}
\setlength{\parindent}{0pt}
\renewcommand{\indent}{\hspace*{\tindent}}

\newcommand{\initialmaker}[1]{\firstlayer{#1}\llap{\textcolor{Goldenrod}{\secondlayer{#1}}}\llap{\textcolor{blue}{\thirdlayer{#1}}}\llap{\textcolor{Goldenrod}{\fourthlayer{#1}}}\llap{\textcolor{Goldenrod}{\fifthlayer{#1}}}\llap{\textcolor{Goldenrod}{\sixthlayer{#1}}}}

\begin{document}
\initialmaker{C}

\initialmaker{ABCBA}

\initialmaker{DEF}

\end{document}

• It must have something to do with the metrics of the chars. But without access to the font it is not possible to investigate. You could try to compile with lualatex and then check the metrics in the lua-font cache. – Ulrike Fischer Jun 1 '17 at 17:30
• I can confirm the problem, with both xetex and luatex. This is one font purchase I regret: shortly after I bought it, P22 released its new digitization of the Goudy Initials (p22.com/family-Goudy_Initials), and although P22’s version has fewer layers, it has as many layers as I’d use, and they’re much better drawn. – Thérèse Jun 1 '17 at 20:07

This is less an answer than information (too long for a comment) that may help someone without the fonts to see what’s going on.

Here’s a simplification of the example, with a ghastly colors scheme so that each layer shows up distinctly: it’s layers four and six that are misaligned.

\RequirePackage{luatex85}
\documentclass{standalone}
\usepackage{xcolor,fontspec}
\newfontface\firstlayer{PFGoudyInitialsPro-Layer1.otf}[Color=darkgray]
\newfontface\secondlayer{PFGoudyInitialsPro-Layer2.otf}[Color=cyan]
\newfontface\thirdlayer{PFGoudyInitialsPro-Layer3.otf}[Color=green]
\newfontface\fourthlayer{PFGoudyInitialsPro-Layer4.otf}[Color=red]
\newfontface\fifthlayer{PFGoudyInitialsPro-Layer5.otf}[Color=brown]
\newfontface\sixthlayer{PFGoudyInitialsPro-Layer6.otf}[Color=yellow]

\newcommand{\initialmaker}[1]{%
\firstlayer{#1}%
\llap{\secondlayer{#1}}%
\llap{\thirdlayer{#1}}%
\llap{\fourthlayer{#1}}%
\llap{\fifthlayer{#1}}%
\llap{\sixthlayer{#1}}%
}

\begin{document}
\fontsize{132}{0}\selectfont
\initialmaker{C}
\end{document}


I don’t know how to interpret the information in the cache, but it’s on Dropbox.

\documentclass{article}
\usepackage{xcolor,fontspec}
\newfontface\firstlayer{PFGoudyInitialsPro-Layer1.otf}[Color=gray]
\newfontface\secondlayer{PFGoudyInitialsPro-Layer2.otf}[Color=cyan]
\newfontface\thirdlayer{PFGoudyInitialsPro-Layer3.otf}[Color=green]
\newfontface\fourthlayer{PFGoudyInitialsPro-Layer4.otf}[Color=red]
\newfontface\fifthlayer{PFGoudyInitialsPro-Layer5.otf}[Color=brown]
\newfontface\sixthlayer{PFGoudyInitialsPro-Layer6.otf}[Color=orange]
% egreg’s code at https://tex.stackexchange.com/a/57860:
\makeatletter
\def\showboxes#1{%
\begingroup\fboxrule=.1pt \fboxsep=-\fboxrule
\@showboxes#1\@showboxes\@empty
\endgroup}
\def\@showboxes#1#2{%
\ifx#2\@showboxes
\fbox{\color{gray}#1}\expandafter\@gobble
\else
\setbox0=\hbox{#1\kern0pt#2}\setbox2=\hbox{#1#2}%
\fbox{\color{gray}#1}\kern-\dimen0
\expandafter\@showboxes
\fi#2}
\begin{document}
\fontsize{132}{0}\selectfont
\firstlayer\showboxes{C}

\secondlayer\showboxes{C}

\thirdlayer\showboxes{C}

\fourthlayer\showboxes{C}

\fifthlayer\showboxes{C}

\sixthlayer\showboxes{C}
\end{document}


A fix for anyone who really wants to use this font

The mistake can be fixed manually, like this, but there’s probably a more intelligent solution than trial-and-error and eyeballing things:

\RequirePackage{luatex85}
\documentclass{standalone}
\usepackage{xcolor,fontspec}
\newfontface\firstlayer{PFGoudyInitialsPro-Layer1.otf}[Color=darkgray]
\newfontface\secondlayer{PFGoudyInitialsPro-Layer2.otf}[Color=cyan]
\newfontface\thirdlayer{PFGoudyInitialsPro-Layer3.otf}[Color=green]
\newfontface\fourthlayer{PFGoudyInitialsPro-Layer4.otf}[Color=red]
\newfontface\fifthlayer{PFGoudyInitialsPro-Layer5.otf}[Color=brown]
\newfontface\sixthlayer{PFGoudyInitialsPro-Layer6.otf}[Color=yellow]
\newcommand{\Cinit}[1]{%
\firstlayer{#1}%
\llap{\secondlayer{#1}}%
\llap{\thirdlayer{#1}}%
\llap{\fourthlayer{#1}\hspace*{6.5pt}}% seems right at 132 points
\llap{\fifthlayer{#1}}%
\llap{\sixthlayer{#1}\hspace*{6.5pt}}%
}
\newcommand{\initialmaker}[1]{%
\firstlayer{#1}%
\llap{\secondlayer{#1}}%
\llap{\thirdlayer{#1}}%
\llap{\fourthlayer{#1}}%
\llap{\fifthlayer{#1}}%
\llap{\sixthlayer{#1}}%
}
\begin{document}
\fontsize{132}{0}\selectfont
\initialmaker{A}\Cinit{C}\initialmaker{T}
\end{document}


• Could you make an image where the six layers are above each other, possibly showing the width of each box? – egreg Jun 1 '17 at 21:34
• @egreg Like this? – Thérèse Jun 1 '17 at 22:00
• Yes: you clearly see the fourth and sixth boxes are different from the others – egreg Jun 1 '17 at 22:06