Skip to content

Commit eba8eef

Browse files
yulian-gaponenkoitext-teamcity
authored andcommitted
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. Autoported commit. Original commit hash: [279206fa1]
1 parent 8e21f98 commit eba8eef

File tree

4 files changed

+2
-5
lines changed

4 files changed

+2
-5
lines changed

itext/itext.io/itext/io/font/FontProgram.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,7 @@ protected internal virtual void SetFontName(String psFontName) {
288288
fontNames.SetFontName(psFontName);
289289
}
290290

291+
[Obsolete]
291292
protected internal virtual void CheckFilePath(String path) {
292293
if (path != null && !FontConstants.BUILTIN_FONTS_14.Contains(path) && !FileUtil.FileExists(path)) {
293294
throw new iText.IO.IOException(iText.IO.IOException.FontFile1NotFound).SetMessageParams(path);

itext/itext.io/itext/io/font/TrueTypeFont.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,6 @@ protected internal TrueTypeFont() {
7979

8080
/// <exception cref="System.IO.IOException"/>
8181
public TrueTypeFont(String path) {
82-
CheckFilePath(path);
8382
fontParser = new OpenTypeParser(path);
8483
fontParser.LoadTables(true);
8584
InitializeFontProperties();
@@ -94,7 +93,6 @@ public TrueTypeFont(byte[] ttf) {
9493

9594
/// <exception cref="System.IO.IOException"/>
9695
internal TrueTypeFont(String ttcPath, int ttcIndex) {
97-
CheckFilePath(ttcPath);
9896
fontParser = new OpenTypeParser(ttcPath, ttcIndex);
9997
fontParser.LoadTables(true);
10098
InitializeFontProperties();

itext/itext.io/itext/io/font/Type1Font.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,6 @@ protected internal Type1Font() {
8787
/// <exception cref="System.IO.IOException"/>
8888
protected internal Type1Font(String metricsPath, String binaryPath, byte[] afm, byte[] pfb)
8989
: this() {
90-
CheckFilePath(metricsPath);
91-
CheckFilePath(binaryPath);
9290
fontParser = new Type1Parser(metricsPath, binaryPath, afm, pfb);
9391
Process();
9492
}

port-hash

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
ee59fd1829db16ee00c53ec4ec74caceba6643b4
1+
279206fa18dd49a50a5d93060de59c61697e51ce

0 commit comments

Comments
 (0)