# How can I use my OTF signature font in LaTeX?

I have managed to create an OTF font for my signature using the FontForge font editor. The signature is mapped to a single printable character on the keyboard. I am aware that I need to rely on the package fontspec in order to use the signature font in a LaTeX document. However, I am not able to figure out the command that I should use to insert the signature in a LaTeX document.

Could someone help we figure out what I should do, given that the signature font is different from the main font that I could use in any document.

Kind regards to the TeX/LaTeX Stack Exchange community.

• Please tell us (a lot) more about the structure of the font file. E.g., does it contain just one entry (your signature)? If so, in which slot is it located? – Mico Apr 25 '17 at 17:12
• Thanks for your quick response @Mico. The file contains only one entry in slot O. (The idea of creating fonts is new to me. I hope I understand what you mean by slot.) I need to add that I am able to use the signature font successfully in LibreOffice documents where the size of the font is allowed to range from 6 to 96. – user24098 Apr 25 '17 at 17:22
• Then everybody will be able to take a PDF file with your signature, extract the font and pretend being you. – egreg Apr 25 '17 at 17:27
• Thanks for the word of caution, @egreg. I will heed your advice. But, as a matter of academic interest, how can the problem be solved? – user24098 Apr 25 '17 at 17:31
• if you install the font in your operating system then xelatex or lualatex should be able to use it directly, but inputting it as a font just complicates things and makes it unavailable to pdftex. It would be far simpler just to save it as a pdf from (say) libreoffice and then you can include it at any size in tex by \includegraphics[height=50pt]{sig.pdf} – David Carlisle Apr 25 '17 at 18:57

If my understanding is correct, you have a custom .otf file that contains just 1 glyph -- your signature -- and, moreover, this glyph is stored in slot "0". If this understanding is correct, you may proceed as in the following example. (Since I don't have access to your font file, the example works with the Zapfino font and uses the Apple logo, which happens to be in slot F8FF, in lieu of your actual signature.)

\documentclass{article}
\usepackage{fontspec}
\newfontfamily\mysigfont{Zapfino.ttf} % substitute real filename here
\newcommand{\mysig}{{\mysigfont\char"F8FF}} % use "0000 in your doc
\begin{document}
\tiny\mysig \normalsize\mysig \Huge\mysig \fontsize{90}{108}\selectfont\mysig
\end{document}

• That's more useful than my earlier reply, which I have now deleted. One further note: In some cases (not sure about TeX) a font must have something in the x and X slots, so that software can calculate its x and X heights. Ordinary rectangles suffice. – user103221 Apr 25 '17 at 20:05
• Thanks @RobtA. I have tried your solution which I believe should work for me. Let me clarify that when I responded to @Mico I meant that my entry is in the slot for letter O (capitol O for O(swald)) rather than the digit 0. The actual slot's spec is 79 (0x4F) U+004F "O" Basic Latin. I have tried your solution. What comes up when I compile with LuaLaTex is the letter "O" and not the signature. I am still figuring out why this is the case. Thanks: I am still exploring the application of your suggestion. – user24098 Apr 26 '17 at 13:40
• @Mico I have discovered the cause of the problem and the solution to my problem. The definition on line 3 of the above latex causes an error. The LaTeX given below solved my problem. – user24098 Apr 26 '17 at 15:33
• @Mico, I wrote the above response in a hurry. Sorry for using "latex" instead of "latex code" and "LaTeX" instead of "LaTeX code". – user24098 Apr 26 '17 at 16:04

The following adaptation of @Mico's solution works for me:

\documentclass{article}
\usepackage{fontspec}
\newfontfamily\mySigFF{Sigfont}[
Path = /home/myDir/texmf/fonts/,
Extension = .otf
]
\newcommand{\mysig}{{\mySigFF\char"004F}}
\begin{document}
\Huge\mysig
\end{document}