#6 improve organisation of cff related classes. add failing font test for cff font file. fix bugs with cff parsing

This commit is contained in:
Eliot Jones
2018-11-18 13:53:43 +00:00
parent 8cd2faeb8b
commit 530410c996
19 changed files with 477 additions and 133 deletions

View File

@@ -8,10 +8,15 @@
public class IntegrationDocumentTests
{
private static readonly Lazy<string> DocumentFolder = new Lazy<string>(() => Path.GetFullPath(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "..", "..", "..", "Integration", "Documents")));
[Theory]
[MemberData(nameof(GetAllDocuments))]
public void CanReadAllPages(string documentName)
{
// Add the full path back on, we removed it so we could see it in the test explorer.
documentName = Path.Combine(DocumentFolder.Value, documentName);
using (var document = PdfDocument.Open(documentName, new ParsingOptions{ UseLenientParsing = false}))
{
for (var i = 0; i < document.NumberOfPages; i++)
@@ -25,11 +30,10 @@
{
get
{
var documentFolder = Path.GetFullPath(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "..", "..", "..", "Integration", "Documents"));
var files = Directory.GetFiles(DocumentFolder.Value, "*.pdf");
var files = Directory.GetFiles(documentFolder, "*.pdf");
return files.Select(x => new object[] {x});
// Return the shortname so we can see it in the test explorer.
return files.Select(x => new object[] {Path.GetFileName(x)});
}
}
}

View File

@@ -37,7 +37,6 @@
{
var page = document.GetPage(9);
// TODO: This page requires a CFF font parser for Type 1 fonts, see 5.5.1
Assert.Contains("BreedsNative breeds of pig can be found throughout the country. They are a small body size compared to other exotic and crosses pig types. There name varies from region to region, for example", page.Text);
}
}