For the PDF's that does not embed fonts (mostly Adobe Base-14 fonts as they are not required to embed as per PDF specification) in them we have to search for fonts in user's system.
The best way for that should be using fontconfig as xpdf-4.02 has fontconfig support already but disabled in libxpdf.
Why fontconfig support is disabled in libxpdf?
Because goal of libxpdf was to provide static library with minimum dependencies by including them statically. But for fontconfig, including it in a static library is pretty difficult (at least for me) as :
It requires a font.conf configuration file and without it spams the stdout with warnings.
Also the search location for this font.conf file must be hardcoded during build which would make pyxpdf wheels error prone.
Probable solutions:-
Include fontconfig statically in libxpdf and ship pyxpdf with it own custom font.conf which should work in all supported oses.
For the PDF's that does not embed fonts (mostly Adobe Base-14 fonts as they are not required to embed as per PDF specification) in them we have to search for fonts in user's system. The best way for that should be using fontconfig as xpdf-4.02 has fontconfig support already but disabled in libxpdf.
Why fontconfig support is disabled in libxpdf? Because goal of libxpdf was to provide static library with minimum dependencies by including them statically. But for fontconfig, including it in a static library is pretty difficult (at least for me) as :
Probable solutions:-