handle case where no unicode value is found for type 1 fonts.

This commit is contained in:
Eliot Jones
2018-01-09 22:32:18 +00:00
parent b2936660d7
commit 674945206c
5 changed files with 37 additions and 5 deletions

View File

@@ -0,0 +1,15 @@
namespace UglyToad.Pdf.Tests.Integration
{
using Xunit;
/// <summary>
/// A class for testing files which are not checked in to source control.
/// </summary>
public class LocalTests
{
[Fact]
public void Tests()
{
}
}
}

View File

@@ -95,6 +95,8 @@
return new CharacterIdentifierSystemInfo(SystemInfoBuilder.Registry, SystemInfoBuilder.Ordering, SystemInfoBuilder.Supplement);
}
return CharacterIdentifierSystemInfo;
throw new InvalidOperationException("The Character Identifier System Information was never set.");
}

View File

@@ -68,7 +68,14 @@
var encodedCharacterName = encoding.GetName(characterCode);
// Look up the character name in the Adobe Glyph List.
value = GlyphList.AdobeGlyphList.NameToUnicode(encodedCharacterName);
try
{
value = GlyphList.AdobeGlyphList.NameToUnicode(encodedCharacterName);
}
catch
{
return false;
}
return true;
}

View File

@@ -1,5 +1,6 @@
namespace UglyToad.Pdf.Fonts.Simple
{
using System;
using Cmap;
using Composite;
using Core;
@@ -58,7 +59,14 @@
var name = encoding.GetName(characterCode);
value = GlyphList.AdobeGlyphList.NameToUnicode(name);
try
{
value = GlyphList.AdobeGlyphList.NameToUnicode(name);
}
catch
{
return false;
}
return true;
}