Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Vertically writing characetrs even if the carrier emoji is available …

…on the device.

Bug id: b/7354733

Change-Id: I2688cb856664bd57bcef508644039c8a13ee96e1
  • Loading branch information...
commit 398703a12520dd1a7c2bdbd99d56fe024f761717 1 parent 923f222
Junichi Monma authored
Showing with 15 additions and 0 deletions.
  1. +15 −0 Source/WebCore/platform/graphics/android/fonts/FontAndroid.cpp
View
15 Source/WebCore/platform/graphics/android/fonts/FontAndroid.cpp
@@ -228,11 +228,20 @@ void Font::drawGlyphs(GraphicsContext* gc, const SimpleFontData* font,
// 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 @@ void Font::drawGlyphs(GraphicsContext* gc, const SimpleFontData* font,
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);
Please sign in to comment.
Something went wrong with that request. Please try again.