mirror of
https://github.com/UglyToad/PdfPig.git
synced 2025-10-15 03:34:52 +08:00
fix a bug with t* operator due to incorrect specification. add generic name to type 3 fonts.
This commit is contained in:
@@ -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);
|
||||
// }
|
||||
//}
|
||||
}
|
||||
|
@@ -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);
|
||||
}
|
||||
|
||||
|
@@ -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;
|
||||
|
@@ -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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user