fix a bug with t* operator due to incorrect specification. add generic name to type 3 fonts.

This commit is contained in:
Eliot Jones
2018-01-07 15:38:43 +00:00
parent 70361973b3
commit 59c36a7ddd
4 changed files with 9 additions and 5 deletions

View File

@@ -65,9 +65,9 @@
//[Fact]
//public void localFileTest()
//{
// //using (var document = PdfDocument.Open(@"C:\Users\eliot\Downloads\Document (1).pdf"))
// using (var document = PdfDocument.Open(@"C:\Users\eliot\Downloads\Document (1).pdf"))
// {
// //var page = document.GetPage(1);
// var page = document.GetPage(1);
// }
//}
}

View File

@@ -54,7 +54,7 @@
}
}
return new Type3Font(CosName.UNCHANGED, boundingBox, fontMatrix, encoding, firstCharacter,
return new Type3Font(CosName.TYPE3, boundingBox, fontMatrix, encoding, firstCharacter,
lastCharacter, widths, toUnicodeCMap);
}

View File

@@ -19,6 +19,9 @@
private readonly decimal[] widths;
private readonly ToUnicodeCMap toUnicodeCMap;
/// <summary>
/// Type 3 fonts are usually unnamed.
/// </summary>
public CosName Name { get; }
public bool IsVertical { get; } = false;

View File

@@ -6,7 +6,8 @@
/// Move to the start of the next line.
/// </summary>
/// <remarks>
/// This performs this operation: 0 Tl Td
/// This performs this operation: 0 -Tl Td
/// The offset is negative leading text (Tl) value, this is incorrect in the specification.
/// </remarks>
internal class MoveToNextLine : IGraphicsStateOperation
{
@@ -21,7 +22,7 @@
public void Run(IOperationContext operationContext, IResourceStore resourceStore)
{
var tdOperation = new MoveToNextLineWithOffset(0, operationContext.GetCurrentState().FontState.Leading);
var tdOperation = new MoveToNextLineWithOffset(0, -1 * operationContext.GetCurrentState().FontState.Leading);
tdOperation.Run(operationContext, resourceStore);
}