You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by "Tilman Hausherr (Jira)" <ji...@apache.org> on 2023/09/17 11:16:00 UTC
[jira] [Assigned] (PDFBOX-5684) Font cache isn't effective on my machine, always rebuilds
[ https://issues.apache.org/jira/browse/PDFBOX-5684?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Tilman Hausherr reassigned PDFBOX-5684:
---------------------------------------
Assignee: Tilman Hausherr
> Font cache isn't effective on my machine, always rebuilds
> ---------------------------------------------------------
>
> Key: PDFBOX-5684
> URL: https://issues.apache.org/jira/browse/PDFBOX-5684
> Project: PDFBox
> Issue Type: Bug
> Components: FontBox
> Affects Versions: 3.0.0 PDFBox
> Environment: macOS 13
> Reporter: Mike Hearn
> Assignee: Tilman Hausherr
> Priority: Major
>
> I see that FontBox has a font caching implementation. Whenever I try to use PDFTextStripped on one specific PDF I have, it triggers the computation of this cache (I'm not sure why it doesn't need to for the others). This is very slow. If the cache really worked I could live with that but every time, it decides the cache isn't valid and rebuilds it.
> The issue is this line here in FileSystemFontProvider.loadDiskCache:
>
> {code:java}
> if (!pending.isEmpty())
> {
> // re-build the entire cache if we encounter un-cached fonts (could be optimised)
> LOG.warn("New fonts found, font cache will be re-built");
> return null;
> }
> {code}
> I don't know why "pending" is never empty as I'm not installing new fonts or changing my font configuration in any way, but my guess is, if some fonts fail to load then they don't enter the cache but this fact isn't recorded. So they are always seen as "new". It's just a guess based on the fact that I see errors related to being unable to load some fonts during this process, e.g.
> {noformat}
> Could not load font file: /System/Library/Fonts/Supplemental/NotoSansBamum-Regular.ttf
> java.io.IOException: Unknown substFormat: 0 @ org.apache.fontbox.ttf.GlyphSubstitutionTable.readSingleLookupSubTable(GlyphSubstitutionTable.java:372){noformat}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: dev-help@pdfbox.apache.org