mirror of
https://github.com/UglyToad/PdfPig.git
synced 2026-03-10 00:23:29 +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]
|
//[Fact]
|
||||||
//public void localFileTest()
|
//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);
|
lastCharacter, widths, toUnicodeCMap);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -19,6 +19,9 @@
|
|||||||
private readonly decimal[] widths;
|
private readonly decimal[] widths;
|
||||||
private readonly ToUnicodeCMap toUnicodeCMap;
|
private readonly ToUnicodeCMap toUnicodeCMap;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Type 3 fonts are usually unnamed.
|
||||||
|
/// </summary>
|
||||||
public CosName Name { get; }
|
public CosName Name { get; }
|
||||||
|
|
||||||
public bool IsVertical { get; } = false;
|
public bool IsVertical { get; } = false;
|
||||||
|
|||||||
@@ -6,7 +6,8 @@
|
|||||||
/// Move to the start of the next line.
|
/// Move to the start of the next line.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <remarks>
|
/// <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>
|
/// </remarks>
|
||||||
internal class MoveToNextLine : IGraphicsStateOperation
|
internal class MoveToNextLine : IGraphicsStateOperation
|
||||||
{
|
{
|
||||||
@@ -21,7 +22,7 @@
|
|||||||
|
|
||||||
public void Run(IOperationContext operationContext, IResourceStore resourceStore)
|
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);
|
tdOperation.Run(operationContext, resourceStore);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user