# TTF font not displaying lowercase letters

I'm trying to use an OCR-A font in a LaTeX document to embed a short code.

I've finally got it reading a system font that I've installed (I think from ocr-a-font), which works well in any other application that I've tried it in, including GIMP, Inkscape, and Synfig.

When I try to use it in my LaTeX document, I'm only seeing the uppercase and numeral characters.

{\fontfamily{ocra}\fontseries{m}\fontshape{n}\selectfont [xxxx-xxxx] }


The document is an article, with hyperref, enumitem, and tikz, and I'm compiling with pdflatex.

MWE (requires font to be installed, so I don't know how useful it will be)

% mwe.tex
\documentclass{article}
\begin{document}
{\fontfamily{ocra}\fontseries{m}\fontshape{n}\selectfont aBcD-0123 }
\end{document}


When compiled with pdflatex mwe.tex, I only see BD-0123.

Might anyone know what is causing this, and how it could be remedied?

-
The ocra font has only uppercase letters. –  egreg Sep 22 '13 at 16:34
@egreg the font that I'm using has both uppercase and lowercase letters, how can I tell which font is being used? imgur.com/gN3F7yI –  Ryan Leonard Sep 22 '13 at 16:42
Not the font you're choosing with the \fontfamily{ocra} declaration, which probably is the legacy font found on CTAN. –  egreg Sep 22 '13 at 18:04

I have obtained a (not very satisfying) result by downloading OCRA.pfa and OCRA.afm from that site; I then modified the entry in OCRA.afm for z, changing enc-122 into z.

Running afm2tfm OCRA.afm and preparing in the same directory the file

\documentclass{article}
\usepackage{fonttable}

% make the pfa file known to pdftex
\pdfmapline{+OCRA < OCRA.pfa}
% create a new font family
\DeclareFontFamily{U}{OCRA}{}
\DeclareFontShape{U}{OCRA}{m}{n}{<->OCRA}{}

\begin{document}
\xfonttable{U}{OCRA}{m}{n}
\end{document}


produces the following output.

\documentclass{article}

% make the pfa file known to pdftex
\pdfmapline{+OCRA < OCRA.pfa}
% create a new font family
\DeclareFontFamily{U}{OCRA}{}
\DeclareFontShape{U}{OCRA}{m}{n}{<->OCRA}{}

\begin{document}
{\usefont{U}{OCRA}{m}{n}aBcD-0123}
\end{document}


The .tfm, and .pfa files can be moved in a directory known by the TeX system, for instance

/usr/local/texlive/texmf-local/fonts/tfm/ocra/ocra.tfm
/usr/local/texlive/texmf-local/fonts/type1/ocra/ocra.pfa


(note the case change) and you can make a small package:

\ProvidesPackage{ocra}

\pdfmapline{+ocra < OCRA.pfa}

\DeclareFontFamily{U}{ocra}{}
\DeclareFontShape{U}{ocra}{m}{n}{<->ocra}{}

\DeclareRobustCommand{\ocratext}{\usefont{U}{ocra}{m}{n}}
\DeclareTextFontCommand{\textocra}{\ocratext}


to be saved as /usr/local/texlive/texmf-local/tex/latex/ocra/ocra.sty.

Run mktexlsr as super user and then your document can be

\documentclass{article}