mirror of
https://github.com/UglyToad/PdfPig.git
synced 2025-10-15 11:44:51 +08:00
handle case where no unicode value is found for type 1 fonts.
This commit is contained in:
15
src/UglyToad.Pdf.Tests/Integration/LocalTests.cs
Normal file
15
src/UglyToad.Pdf.Tests/Integration/LocalTests.cs
Normal 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()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
@@ -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.");
|
||||
}
|
||||
|
||||
|
@@ -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;
|
||||
}
|
||||
|
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user