add tests for another type 1 font file

This commit is contained in:
Eliot Jones
2018-11-15 21:36:52 +00:00
parent 099f270986
commit d8bf977842
5 changed files with 20 additions and 5 deletions

Binary file not shown.

View File

@@ -15,8 +15,8 @@
public void CanReadHexEncryptedPortion()
{
var bytes = GetFileBytes("AdobeUtopia.pfa");
parser.Parse(new ByteArrayInputBytes(bytes),0, 0);
parser.Parse(new ByteArrayInputBytes(bytes), 0, 0);
}
[Fact]
@@ -24,7 +24,7 @@
{
// TODO: support reading in these pfb files
var bytes = GetFileBytes("Raleway-Black.pfb");
parser.Parse(new ByteArrayInputBytes(bytes), 0, 0);
}
@@ -52,6 +52,14 @@
parser.Parse(new ByteArrayInputBytes(bytes), 0, 0);
}
[Fact]
public void CanReadFontWithCommentsInOtherSubrs()
{
var bytes = GetFileBytes("CMR10");
parser.Parse(new ByteArrayInputBytes(bytes), 0, 0);
}
private static byte[] GetFileBytes(string name)
{
var documentFolder = Path.GetFullPath(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "..", "..", "..", "Fonts", "Type1"));

View File

@@ -46,7 +46,7 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.5.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.9.0" />
<PackageReference Include="System.Drawing.Common" Version="4.5.0-preview2-26406-04" />
<PackageReference Include="xunit" Version="2.3.1" />
<PackageReference Include="xunit.extensibility.execution" Version="2.3.1" />

View File

@@ -540,6 +540,13 @@
break;
}
if (token.Type == Type1Token.TokenType.StartArray)
{
var array = ReadArrayValues<T>(tokenizer, converter, true, false);
results.AddRange(array);
}
try
{
var result = converter(token);

View File

@@ -363,7 +363,7 @@
var c = (char)bytes.CurrentByte;
if (ReadHelper.IsEndOfLine(c))
{
continue;
break;
}
commentBuffer.Append(c);