add test for type 1 cff glyph locations and add missing doc comments

This commit is contained in:
Eliot Jones 2018-11-19 21:43:22 +00:00
parent 8cd05807ca
commit 3a025052c9
4 changed files with 19 additions and 2 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 199 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 235 KiB

View File

@ -12,6 +12,7 @@
private const string SinglePageFormattedType0Content = "Type0 Font";
private const string SinglePageType1Content = "ICML03-081";
private const string SingleInkscapePage = "Single Page Simple - from inkscape";
private const string PigProduction = "Pig Production Handbook";
private static string GetFilename(string name)
{
@ -61,6 +62,12 @@
Run(@"Rotated Text Libre Office", 841);
}
[Fact]
public void PigProductionCompactFontFormat()
{
Run(PigProduction);
}
private static void Run(string file, int imageHeight = 792)
{
var pdfFileName = GetFilename(file);

View File

@ -13,7 +13,7 @@
/// <summary>
/// The origin of the coordinates system.
/// </summary>
public static PdfPoint Origin = new PdfPoint(0m, 0m);
public static PdfPoint Origin { get; } = new PdfPoint(0m, 0m);
/// <summary>
/// The X coordinate for this point. (Horizontal axis).
@ -52,11 +52,21 @@
Y = (decimal)y;
}
/// <summary>
/// Creates a new <see cref="PdfPoint"/> which is the current point moved in the x direction relative to its current position by a value.
/// </summary>
/// <param name="dx">The distance to move the point in the x direction relative to its current location.</param>
/// <returns>A new point shifted on the x axis by the given delta value.</returns>
public PdfPoint MoveX(decimal dx)
{
return new PdfPoint(X + dx, Y);
}
/// <summary>
/// Creates a new <see cref="PdfPoint"/> which is the current point moved in the y direction relative to its current position by a value.
/// </summary>
/// <param name="dy">The distance to move the point in the y direction relative to its current location.</param>
/// <returns>A new point shifted on the y axis by the given delta value.</returns>
public PdfPoint MoveY(decimal dy)
{
return new PdfPoint(X, Y + dy);