Closed fabio-lilliu closed 10 months ago
The call to FontPropertiesManager.getInstance().loadOrReadSystemFonts() will read all the system's font and persist the list to disk for later retrieval. Once the list is created font substitution is very quick as the list of know fonts is used for subsequent loads. This works very well for most server side and client-side rendering.
It is possible the get an instance of the FontManager and call readFontPackage(). This method can be fed the class path of font files embedded in a jar. This makes it possible distribute the fonts you want with your application and should avoid going to the file system to scan system fonts. But that said once the font list is created it is very quick to find the correct font for substitution.
I've got thousands of invoice PDFs, all with the same four fonts. Since in these files the fonts are not embedded, font substitution will kick off a process to read all the available system fonts. Is it possible to limit this process to the four recurring fonts? Issue related to the stackoverflow question https://stackoverflow.com/questions/77675038/error-reading-font-file-when-using-icepdf Invoice.pdf