This is an automated email from the ASF dual-hosted git repository. tilman pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/pdfbox-docs.git
The following commit(s) were added to refs/heads/master by this push: new d7a8a12b PDFBOX-5300: add "Why do external fonts seem corrupt when loaded as a resource" segment d7a8a12b is described below commit d7a8a12b8058995998f057c273dc85d3e5d72c4d Author: Tilman Hausherr <til...@apache.org> AuthorDate: Tue May 14 12:07:15 2024 +0200 PDFBOX-5300: add "Why do external fonts seem corrupt when loaded as a resource" segment --- content/2.0/faq.md | 8 ++++++++ content/3.0/faq.md | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/content/2.0/faq.md b/content/2.0/faq.md index 44bf9462..60703998 100644 --- a/content/2.0/faq.md +++ b/content/2.0/faq.md @@ -113,6 +113,14 @@ To create PDFs with "Standard 14 fonts" only, no extra fonts files are needed (version 2.0.5 or higher), as these are not embedded and PDFBox has all the metrics and no longer needs to access the actual fonts. +### Why do external fonts seem corrupt when loaded as a resource? + +If your program runs properly when the font is loaded from a file but not when loaded from the +resources, check whether +[resource filtering](https://maven.apache.org/plugins/maven-resources-plugin/examples/filter.html) +is activated in the maven-resources-plugin in your maven build script, and disable it for font files. +See [this stackoverflow answer](https://stackoverflow.com/a/25503853/535646) on how to fix this. + ## PDF Creation <a name="layout"></a> diff --git a/content/3.0/faq.md b/content/3.0/faq.md index 8b360e7c..c4cf1caa 100644 --- a/content/3.0/faq.md +++ b/content/3.0/faq.md @@ -125,6 +125,14 @@ To create PDFs with "Standard 14 fonts" only, no extra fonts files are needed (version 2.0.5 or higher), as these are not embedded and PDFBox has all the metrics and no longer needs to access the actual fonts. +### Why do external fonts seem corrupt when loaded as a resource? + +If your program runs properly when the font is loaded from a file but not when loaded from the +resources, check whether +[resource filtering](https://maven.apache.org/plugins/maven-resources-plugin/examples/filter.html) +is activated in the maven-resources-plugin in your maven build script, and disable it for font files. +See [this stackoverflow answer](https://stackoverflow.com/a/25503853/535646) on how to fix this. + ## PDF Creation <a name="layout"></a>