diff --git a/src/UglyToad.PdfPig.Tests/Integration/Documents/test_a.pdf b/src/UglyToad.PdfPig.Tests/Integration/Documents/test_a.pdf new file mode 100644 index 00000000..9691b2fe Binary files /dev/null and b/src/UglyToad.PdfPig.Tests/Integration/Documents/test_a.pdf differ diff --git a/src/UglyToad.PdfPig.Tests/Integration/Documents/test_a.png b/src/UglyToad.PdfPig.Tests/Integration/Documents/test_a.png new file mode 100644 index 00000000..e385f0b6 Binary files /dev/null and b/src/UglyToad.PdfPig.Tests/Integration/Documents/test_a.png differ diff --git a/src/UglyToad.PdfPig.Tests/Integration/VisualVerification/GenerateLetterBoundingBoxImages.cs b/src/UglyToad.PdfPig.Tests/Integration/VisualVerification/GenerateLetterBoundingBoxImages.cs index 0c06771f..7953c946 100644 --- a/src/UglyToad.PdfPig.Tests/Integration/VisualVerification/GenerateLetterBoundingBoxImages.cs +++ b/src/UglyToad.PdfPig.Tests/Integration/VisualVerification/GenerateLetterBoundingBoxImages.cs @@ -147,6 +147,13 @@ Run(Type3FontZeroHeight, 1255); } + [Fact] + public void test_a() + { + // Rendered glyphs are not correct, but we use the grid to assess + Run("test_a", 1584, 1); + } + private static void Run(string file, int imageHeight = 792, int pageNo = 1) { var pdfFileName = GetFilename(file); @@ -246,7 +253,11 @@ pdf = pdf.Replace(".pdf", ".jpg"); - return SKImage.FromEncodedData(pdf); + if (File.Exists(pdf)) + { + return SKImage.FromEncodedData(pdf); + } + return SKImage.FromEncodedData(pdf.Replace(".jpg", ".png")); } } } diff --git a/src/UglyToad.PdfPig/PdfFonts/Simple/Type3Font.cs b/src/UglyToad.PdfPig/PdfFonts/Simple/Type3Font.cs index 811ff951..f9629a6f 100644 --- a/src/UglyToad.PdfPig/PdfFonts/Simple/Type3Font.cs +++ b/src/UglyToad.PdfPig/PdfFonts/Simple/Type3Font.cs @@ -58,7 +58,7 @@ private double ComputeAscent() { - return fontMatrix.TransformY(boundingBox.Height); + return fontMatrix.TransformY(boundingBox.Top); } public int ReadCharacterCode(IInputBytes bytes, out int codeLength)