# How can I verify that the fonts are all embedded in my LuaLatex document?

I am working with a manufacturer who is typically used to getting pdfs from more traditional Adobe tools, read: not LuaLatex. They are telling me to "make sure" that my fonts are embedded in the .pdf files I give them.

This particular link says that "lualatex always embeds fonts", but as glyphs. It also talks about editing the pdftex.map to force the embedding of the entire font. I had some trouble finding where that file even exists. In /etc? [Does lualatex embed fonts for compatibility?

At the end of the day, I am a Linux guy running lualatex on an Ubuntu machine. I want to be able to tell my manufacturer "yes, file contains embedded fonts". There is a little bit of a language barrier, so the more I can do on my end, the better.

Help?

How can I:

1. Make sure the pdf file contains the full embedded fonts? Is there an inspection tool that shows this?
2. (or) What do I need to do to make this happen if lualatex isn't doing the right thing

Thanks in advance.

• You can always use the pdffonts tool to see whether or not a font has been embedded into the pdf or is just being referred to. I think it might just be best to create a sample document and have them check the pdf, explaining that you do not have access to the Adobe tools being a Linux user. – daleif Apr 20 at 16:52
• you could use some validation tools like verapdf to perform checks and most viewers give basic feedback e.g evince and ocular viewers should give some info via file properties – user170109 Apr 20 at 17:50
• If there’s a language barrier, you might want to clarify what the requirement is, and what isn’t working on their end. – Davislor Apr 20 at 23:14

## 2 Answers

Your system most likely has pdffonts (or you could obtain it) running pdffonts on a typical luatex output produces

name                                 type              encoding         emb sub uni object ID
------------------------------------ ----------------- ---------------- --- --- --- ---------
SJYSYS+TeXGyreTermes-Regular-Identity-H CID Type 0C       Identity-H    yes yes yes     5  0
LOMGHQ+TeXGyreTermesMath-Regular-Identity-H CID Type 0C   Identity-H    yes yes yes     7  0


Note the yes in the emb column denoting embedded fonts.

• Doesn't the yes in the sub column indicate that only a subset is included whereas the OP seems to want full embedding? – TeXnician Apr 20 at 21:53

To embed complete fonts you have to set the embedding mode to full rather than the default subset. You can do this in the patch_font callback of luaotfload. Be aware that most commercial fonts do not allow full embedding but only subset embedding in their license.

\documentclass{article}
\usepackage{fontspec}
\usepackage{luacode}
\begin{luacode}
local function embedfull(tfmdata)
tfmdata.embedding = "full"
end

luatexbase.add_to_callback("luaotfload.patch_font", embedfull, "embedfull")
\end{luacode}
\setmainfont{Latin Modern Roman}
\begin{document}

Hello World!

\end{document}

\$ pdffonts test.pdf
name                                 type              encoding         emb sub uni object ID
------------------------------------ ----------------- ---------------- --- --- --- ---------
LMRoman10-Regular                    CID Type 0C       Identity-H       yes no  yes      4  0