From abb32d257655b9a31bb49477d3781a878565f823 Mon Sep 17 00:00:00 2001 From: Maxim Date: Fri, 24 Nov 2023 14:43:52 +0300 Subject: [PATCH] Fix calculateEncodingMapping in PDType1Font --- src/main/java/org/verapdf/pd/font/type1/PDType1Font.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/org/verapdf/pd/font/type1/PDType1Font.java b/src/main/java/org/verapdf/pd/font/type1/PDType1Font.java index b99f73dc..0848b211 100644 --- a/src/main/java/org/verapdf/pd/font/type1/PDType1Font.java +++ b/src/main/java/org/verapdf/pd/font/type1/PDType1Font.java @@ -237,7 +237,7 @@ public Double getWidth(int code) { @Override protected Encoding calculateEncodingMapping() { Encoding encoding = super.calculateEncodingMapping(); - if (encoding.getSize() == 0) { + if (fontMetrics != null && encoding.getSize() == 0) { encoding = new Encoding(fontMetrics.getEncodingScheme(), getDifferences()); } return encoding;