# 3D font in LaTeX

This is an unusual question regarding rendering of a font with a specific 3D-esque style in LaTeX, XeLaTex, or any other TeX flavor.

I was looking at some fonts the other day and I came across one of which I am very fond:

There are many beautiful examples of this font, such as:

However, each of these examples has a 3D quality to it. The font is both shaded and colored, which make it look tolerable. In regular, two dimensions it looks like this: Which is hardly anything to write home about. My question is simple: how can I get LaTeX, XeLaTeX, or any other flavor, to render a font with a 3D effect like the one in the pictures above? Is it possible or would it have to be done in an image editor?

Unfortunately, Googling has yielded poor results and I have began to think that it may be hopeless, though documents like this one make me think it may be possible.

[EDIT]

For further clarification, the 3D effect that is of interest is the shading on the characters of the font. In the first image, this effect can be observed on the letters of the word "Octant", which shades each character on the right side, as though there is a light source to the left. Another example of the effect is the words "Griffin & Quayle" in the second image.

works only with latex->dvips->ps2pdf:

\documentclass[landscape]{article}
\usepackage{geometry}
\usepackage{pst-light3d}
\DeclareFixedFont{\Bf}{T1}{ptm}{b}{n}{3cm}
\begin{document}
\psframebox[fillstyle=solid,fillcolor=blue!20!black!40,framesep=20pt]{%
\PstLightThreeDText[fillstyle=solid,fillcolor=white!90]%
{\Bf 3D font in L\kern-35pt\raisebox{0.7ex}{A}\kern-15pt\TeX}}
\end{document}

• That certainly looks 3D, but does not come close to the particular 3D effect I was hoping to emulate. In particular, there is no shading on the characters themselves, only on the added '3D' part. – Tikzsplosion Feb 27 '14 at 15:15

I did some additional research into layered fonts (thanks Thérèse) and discovered that they are exactly what I need. Switching gears to XeLaTex, I found a free layered font and started playing around.

The font is called Tribbon, and while it looks nothing like the font I was interested in, it can mostly achieve the same effect. I downloaded, installed the font, and from there it was simple to make it overlay in different colors at different opacities. Here is a nice example I whipped up:

\documentclass{article}
\usepackage{xcolor}%for color change
\usepackage{pgf}%must have for the transparency
\usepackage{fontspec}%for font specification

\definecolor{mysilver}{RGB}{208,208,208}

\begin{document}
Tribbon is a layered font.\\
{\fontspec{Tribbon A}Tribbon A}\\
{\fontspec{Tribbon B}Tribbon B}\\
{\fontspec{Tribbon C}Tribbon C}\\
\\
By combing the layers using different colors and opacities, using \rlap to overlay the text, we can achieve a shading effect on the characters in the font. For example, combining the following:\\
{\color{mysilver}\fontspec{Tribbon B}\huge THIS IS A SAMPLE} \\ {\pgfsetfillopacity{0.3}\color{black}\fontspec{Tribbon C}\huge THIS IS A SAMPLE} \\ {\pgfsetfillopacity{0.4}\color{mysilver}\fontspec{Tribbon A}\huge THIS IS A SAMPLE}\\
\\becomes\\
\\
\rlap{\pgfsetfillopacity{1}\color{mysilver}\fontspec{Tribbon B}\huge THIS IS A SAMPLE}{\pgfsetfillopacity{0.3}\color{black}\fontspec{Tribbon C}\huge THIS IS A SAMPLE}\llap{\pgfsetfillopacity{0.4}\color{mysilver}\fontspec{Tribbon A}\huge THIS IS A SAMPLE}\\

\end{document}

Which produces:

This method would require fine tuning for each font and may require additional tuning based on color and need. That said, converting this to a macro that takes text and a color as inputs, and outputs shaded text in a layered, 3D-esque font should be trivial. The only difficulty is finding the right layered font.