I use XeLaTeX, TikZ and standalone to create a figure, e.g. a flowchart.
When I use includegraphics{} to include that figure into another document which uses the same font, then that font will be embedded into the pdf once for the main document and then again for each figure.
To reproduce the problem, here is the code for a simple flowchart and another document that includes the flow chart pdf using \includegraphics.
The font XITS will be included twice.
% !TEX program = XeLaTeX
\documentclass[tikz=true]{standalone}
\usepackage{fontspec}
\setmainfont{XITS}
\usepackage{tikz}
\usetikzlibrary{shapes,arrows}
\usepackage{pgfplots}
\pgfplotsset{compat=newest}
%% ===================================================
\begin{document}
\tikzstyle{block} = [draw, rectangle, fill=blue!20, text width=9.5em, node distance=14em, text centered, minimum height=4em]
\tikzstyle{line} = [draw, -latex']
%
\begin{tikzpicture}[node distance = 2cm, auto]
\node [block] (Create) {create flowchart with TikZ and standalone};
\node [block, right of=Create] (Include) {include flowchart into main document};
\node [block, right of=Include] (CheckFont) {check which fonts have been embedded};
\path [line] (Create) -- (Include);
\path [line] (Include) -- (CheckFont);
\end{tikzpicture}
\end{document}
and the main document
% !TEX program = XeLaTeX
\documentclass[]{article}
\usepackage{graphicx}
\usepackage{fontspec}
\setmainfont{XITS}
% ===============
\begin{document}
Text before the figure.
\begin{figure}
\centering
\includegraphics{tikz_flowchart.pdf}
\caption{Some figure}
\label{fig:flowchart}
\end{figure}
Some more text.
\end{document}
In the document properties Adobe Reader shows XITS twice:

If I include the Tikz flowchart directly into the main document, the font is emnbedded only once, but I don't want to compile it every time and sometimes I use other tools (e.g. Inkscape) to create figures (but they all use the same font).
In order to have a smaller pdf file (and because I think this behavior is strange) I would like to have each font included only once. I am aware of the tool pdfsizeopt, as described in the question How to create small PDF files for the Internet, but while it does decrease the file size, it does not help with the issue of fonts being included multiple times.
XeLaTeX,TikZ, orstandalone; I’ve seen the same thing inLuaLaTeXwhen using thearticleclass and atabularenvironment to produce a letterhead, which I then include in letters with thewallpaperpackage. IIRC the same thing happened inpdfLaTeXtoo. In the case of letterhead it’s not surprising, since that’s where one tends to use titling caps and ligatures which don’t appear in the body of a letter, so the subsets aren’t the same. – Thérèse Jul 04 '13 at 22:32store the pdf once in temporary box to trigger the font optimization.https://tex.stackexchange.com/a/562670/221200 – Santhosh Sep 14 '20 at 18:33