Use x text skew to position text
This CL fixes b/110225902.
The PDF device was not taking x skew into account when
calculating positions.
Change-Id: I659dfeba0d31c8e1192cd3538b550c48cf5a835c
Reviewed-on: https://skia-review.googlesource.com/135569
Reviewed-by: Hal Canary <halcanary@google.com>
Commit-Queue: Herb Derby <herb@google.com>
diff --git a/src/pdf/SkPDFDevice.cpp b/src/pdf/SkPDFDevice.cpp
index d8160a0..45a9b95 100644
--- a/src/pdf/SkPDFDevice.cpp
+++ b/src/pdf/SkPDFDevice.cpp
@@ -1068,7 +1068,7 @@
SkPoint position = xy - fCurrentMatrixOrigin;
if (position != SkPoint{fXAdvance, 0}) {
this->flush();
- SkPDFUtils::AppendScalar(position.x(), fContent);
+ SkPDFUtils::AppendScalar(position.x() - position.y() * fTextSkewX, fContent);
fContent->writeText(" ");
SkPDFUtils::AppendScalar(-position.y(), fContent);
fContent->writeText(" Td ");