mirror of
https://github.com/UglyToad/PdfPig.git
synced 2026-03-10 00:23:29 +08:00
Set Type 3 font ascent to Top instead of Height, see #1164
Some checks failed
Build, test and publish draft / build (push) Has been cancelled
Build and test [MacOS] / build (push) Has been cancelled
Run Common Crawl Tests / build (0000-0001) (push) Has been cancelled
Run Common Crawl Tests / build (0002-0003) (push) Has been cancelled
Run Common Crawl Tests / build (0004-0005) (push) Has been cancelled
Run Common Crawl Tests / build (0006-0007) (push) Has been cancelled
Run Integration Tests / build (push) Has been cancelled
Nightly Release / Check if this commit has already been published (push) Has been cancelled
Nightly Release / tests (push) Has been cancelled
Nightly Release / build_and_publish_nightly (push) Has been cancelled
Some checks failed
Build, test and publish draft / build (push) Has been cancelled
Build and test [MacOS] / build (push) Has been cancelled
Run Common Crawl Tests / build (0000-0001) (push) Has been cancelled
Run Common Crawl Tests / build (0002-0003) (push) Has been cancelled
Run Common Crawl Tests / build (0004-0005) (push) Has been cancelled
Run Common Crawl Tests / build (0006-0007) (push) Has been cancelled
Run Integration Tests / build (push) Has been cancelled
Nightly Release / Check if this commit has already been published (push) Has been cancelled
Nightly Release / tests (push) Has been cancelled
Nightly Release / build_and_publish_nightly (push) Has been cancelled
This commit is contained in:
BIN
src/UglyToad.PdfPig.Tests/Integration/Documents/test_a.pdf
Normal file
BIN
src/UglyToad.PdfPig.Tests/Integration/Documents/test_a.pdf
Normal file
Binary file not shown.
BIN
src/UglyToad.PdfPig.Tests/Integration/Documents/test_a.png
Normal file
BIN
src/UglyToad.PdfPig.Tests/Integration/Documents/test_a.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 196 KiB |
@@ -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"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user