Skip to content

Commit 279206f

Browse files
Get rid of the pre-check for the font file path
It failed early in case there are no such file in local file system, even if the String specified vaild resource available by other means. Suggested by Richard Cohn.
1 parent ee59fd1 commit 279206f

File tree

3 files changed

+1
-4
lines changed

3 files changed

+1
-4
lines changed

io/src/main/java/com/itextpdf/io/font/FontProgram.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,7 @@ protected void setFontName(String psFontName) {
279279
fontNames.setFontName(psFontName);
280280
}
281281

282+
@Deprecated
282283
protected void checkFilePath(String path) {
283284
if (path != null && !FontConstants.BUILTIN_FONTS_14.contains(path) && !FileUtil.fileExists(path)) {
284285
throw new IOException(IOException.FontFile1NotFound).setMessageParams(path);

io/src/main/java/com/itextpdf/io/font/TrueTypeFont.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,6 @@ protected TrueTypeFont() {
8888
}
8989

9090
public TrueTypeFont(String path) throws java.io.IOException {
91-
checkFilePath(path);
9291
fontParser = new OpenTypeParser(path);
9392
fontParser.loadTables(true);
9493
initializeFontProperties();
@@ -101,7 +100,6 @@ public TrueTypeFont(byte[] ttf) throws java.io.IOException {
101100
}
102101

103102
TrueTypeFont(String ttcPath, int ttcIndex) throws java.io.IOException {
104-
checkFilePath(ttcPath);
105103
fontParser = new OpenTypeParser(ttcPath, ttcIndex);
106104
fontParser.loadTables(true);
107105
initializeFontProperties();

io/src/main/java/com/itextpdf/io/font/Type1Font.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,6 @@ protected Type1Font() {
9090

9191
protected Type1Font(String metricsPath, String binaryPath, byte[] afm, byte[] pfb) throws java.io.IOException {
9292
this();
93-
checkFilePath(metricsPath);
94-
checkFilePath(binaryPath);
9593

9694
fontParser = new Type1Parser(metricsPath, binaryPath, afm, pfb);
9795
process();

0 commit comments

Comments
 (0)