Skip to content

Commit

Permalink
Vertically writing characetrs even if the carrier emoji is available …
Browse files Browse the repository at this point in the history
…on the device.

Bug id: b/7354733

Change-Id: I2688cb856664bd57bcef508644039c8a13ee96e1
  • Loading branch information
Junichi Monma committed Oct 29, 2012
1 parent 923f222 commit 398703a
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions Source/WebCore/platform/graphics/android/fonts/FontAndroid.cpp
Expand Up @@ -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);
Expand All @@ -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);
Expand Down

0 comments on commit 398703a

Please sign in to comment.