summaryrefslogtreecommitdiff
path: root/fpdfsdk/fpdf_edit_embeddertest.cpp
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2018-06-19 15:45:42 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-06-19 15:45:42 +0000
commitc765d2ac867611935cff6b5c5a2ff8575fe85162 (patch)
tree607fbc0d819dfb4101b7b03210f0545d9b1eb754 /fpdfsdk/fpdf_edit_embeddertest.cpp
parenta700b851c31a67ce4034731e8c06808498a9903b (diff)
downloadpdfium-c765d2ac867611935cff6b5c5a2ff8575fe85162.tar.xz
Add FPDFText_GetMatrix() API
This is similar to FPDFPath_GetMatrix(), but works on text, not path objects. Change-Id: If268362b7fa4398124b953e0e2225074523f5f65 Reviewed-on: https://pdfium-review.googlesource.com/35434 Reviewed-by: dsinclair <dsinclair@chromium.org> Reviewed-by: Nicolás Peña Moreno <npm@chromium.org> Commit-Queue: Nicolás Peña Moreno <npm@chromium.org>
Diffstat (limited to 'fpdfsdk/fpdf_edit_embeddertest.cpp')
-rw-r--r--fpdfsdk/fpdf_edit_embeddertest.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/fpdfsdk/fpdf_edit_embeddertest.cpp b/fpdfsdk/fpdf_edit_embeddertest.cpp
index 07879c5054..c78700ea67 100644
--- a/fpdfsdk/fpdf_edit_embeddertest.cpp
+++ b/fpdfsdk/fpdf_edit_embeddertest.cpp
@@ -1122,6 +1122,23 @@ TEST_F(FPDFEditEmbeddertest, AddStandardFontText) {
CompareBitmap(page_bitmap.get(), 612, 792, md5_3);
}
+ double matrix_a = 0;
+ double matrix_b = 0;
+ double matrix_c = 0;
+ double matrix_d = 0;
+ double matrix_e = 0;
+ double matrix_f = 0;
+ EXPECT_FALSE(FPDFText_GetMatrix(nullptr, &matrix_a, &matrix_b, &matrix_c,
+ &matrix_d, &matrix_e, &matrix_f));
+ EXPECT_TRUE(FPDFText_GetMatrix(text_object3, &matrix_a, &matrix_b, &matrix_c,
+ &matrix_d, &matrix_e, &matrix_f));
+ EXPECT_EQ(1., matrix_a);
+ EXPECT_EQ(1.5, matrix_b);
+ EXPECT_EQ(2., matrix_c);
+ EXPECT_EQ(0.5, matrix_d);
+ EXPECT_EQ(200., matrix_e);
+ EXPECT_EQ(200., matrix_f);
+
// TODO(npm): Why are there issues with text rotated by 90 degrees?
// TODO(npm): FPDF_SaveAsCopy not giving the desired result after this.
FPDF_ClosePage(page);