From d89bf2d171bb17bc49b55bcd68a0fbbc29f94427 Mon Sep 17 00:00:00 2001 From: Volker Kunert <39316085+vk-github18@users.noreply.github.com> Date: Tue, 20 Aug 2024 20:13:13 +0200 Subject: [PATCH] Update LayoutProcessor.java/ See #1159 Load only TrueTypeFontUnicode fonts See #1159 --- .../src/main/java/com/lowagie/text/pdf/LayoutProcessor.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/openpdf/src/main/java/com/lowagie/text/pdf/LayoutProcessor.java b/openpdf/src/main/java/com/lowagie/text/pdf/LayoutProcessor.java index 7b7d90240..d65091169 100644 --- a/openpdf/src/main/java/com/lowagie/text/pdf/LayoutProcessor.java +++ b/openpdf/src/main/java/com/lowagie/text/pdf/LayoutProcessor.java @@ -270,6 +270,8 @@ public static boolean supportsFont(BaseFont baseFont) { /** * Loads the AWT font needed for layout + *

+ * If baseFont is not instanceof TrueTypeFontUnicode *no* font is loaded. * * @param baseFont OpenPdf base font * @param filename of the font file @@ -279,7 +281,9 @@ public static void loadFont(BaseFont baseFont, String filename) { if (!enabled || awtFontMap.get(baseFont) != null) { return; } - + if (!(baseFont instanceof TrueTypeFontUnicode)) { + return; + } java.awt.Font awtFont; InputStream inputStream = null; try {