am 398703a1: Vertically writing characetrs even if the carrier emoji is available on the device.
* commit '398703a12520dd1a7c2bdbd99d56fe024f761717':
Vertically writing characetrs even if the carrier emoji is available on the device.
diff --git a/Source/WebCore/platform/graphics/android/fonts/FontAndroid.cpp b/Source/WebCore/platform/graphics/android/fonts/FontAndroid.cpp
index 03d2fb2..ebdf6c9 100644
--- a/Source/WebCore/platform/graphics/android/fonts/FontAndroid.cpp
+++ b/Source/WebCore/platform/graphics/android/fonts/FontAndroid.cpp
@@ -228,11 +228,20 @@
// set filtering, to make scaled images look nice(r)
paint.setFilterBitmap(true);
+ SkMatrix rotator;
+ rotator.reset();
+ if (font->platformData().orientation() == Vertical) {
+ canvas->save();
+ canvas->rotate(-90);
+ rotator.setRotate(90);
+ }
+
int localIndex = 0;
int localCount = 0;
for (int i = 0; i < numGlyphs; i++) {
if (EmojiFont::IsEmojiGlyph(glyphs[i])) {
if (localCount) {
+ rotator.mapPoints(&pos[localIndex], localCount);
canvas->drawPosText(&glyphs[localIndex],
localCount * sizeof(uint16_t),
&pos[localIndex], paint);
@@ -248,12 +257,18 @@
x += SkFloatToScalar(adv[i].width());
y += SkFloatToScalar(adv[i].height());
}
+
// draw the last run of glyphs (if any)
if (localCount) {
+ rotator.mapPoints(&pos[localIndex], localCount);
canvas->drawPosText(&glyphs[localIndex],
localCount * sizeof(uint16_t),
&pos[localIndex], paint);
+
}
+
+ if (font->platformData().orientation() == Vertical)
+ canvas->restore();
} else {
for (int i = 0; i < numGlyphs; i++) {
pos[i].set(x, y);