Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(73)

Side by Side Diff: third_party/harfbuzz/src/harfbuzz-shaper.cpp

Issue 10382212: Fix the alignment issue with Arabic when a font has kerning or cursive gsub. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « third_party/harfbuzz/chromium.patch ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) 2 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
3 * 3 *
4 * This is part of HarfBuzz, an OpenType Layout engine library. 4 * This is part of HarfBuzz, an OpenType Layout engine library.
5 * 5 *
6 * Permission is hereby granted, without written agreement and without 6 * Permission is hereby granted, without written agreement and without
7 * license or royalty fees, to use, copy, modify, and distribute this 7 * license or royalty fees, to use, copy, modify, and distribute this
8 * software and its documentation for any purpose, provided that the 8 * software and its documentation for any purpose, provided that the
9 * above copyright notice and the following two paragraphs appear in 9 * above copyright notice and the following two paragraphs appear in
10 * all copies of this software. 10 * all copies of this software.
(...skipping 1264 matching lines...) Expand 10 before | Expand all | Expand 10 after
1275 HB_Fixed *advances = item->advances; 1275 HB_Fixed *advances = item->advances;
1276 1276
1277 // DEBUG("positioned glyphs:"); 1277 // DEBUG("positioned glyphs:");
1278 for (unsigned int i = 0; i < face->buffer->in_length; i++) { 1278 for (unsigned int i = 0; i < face->buffer->in_length; i++) {
1279 // DEBUG(" %d:\t orig advance: (%d/%d)\tadv=(%d/%d)\tpos=(%d/%d)\ tback=%d\tnew_advance=%d", i, 1279 // DEBUG(" %d:\t orig advance: (%d/%d)\tadv=(%d/%d)\tpos=(%d/%d)\ tback=%d\tnew_advance=%d", i,
1280 // glyphs[i].advance.x.toInt(), glyphs[i].advance.y.toInt(), 1280 // glyphs[i].advance.x.toInt(), glyphs[i].advance.y.toInt(),
1281 // (int)(positions[i].x_advance >> 6), (int)(positions[i].y_a dvance >> 6), 1281 // (int)(positions[i].x_advance >> 6), (int)(positions[i].y_a dvance >> 6),
1282 // (int)(positions[i].x_pos >> 6), (int)(positions[i].y_pos > > 6), 1282 // (int)(positions[i].x_pos >> 6), (int)(positions[i].y_pos > > 6),
1283 // positions[i].back, positions[i].new_advance); 1283 // positions[i].back, positions[i].new_advance);
1284 1284
1285 HB_Fixed adjustment = (item->item.bidiLevel % 2) ? -positions[i].x_a dvance : positions[i].x_advance; 1285 HB_Fixed adjustment = positions[i].x_advance;
1286 1286
1287 if (!(face->current_flags & HB_ShaperFlag_UseDesignMetrics)) 1287 if (!(face->current_flags & HB_ShaperFlag_UseDesignMetrics))
1288 adjustment = HB_FIXED_ROUND(adjustment); 1288 adjustment = HB_FIXED_ROUND(adjustment);
1289 1289
1290 if (positions[i].new_advance) { 1290 if (positions[i].new_advance == 0)
1291 advances[i] = adjustment;
1292 } else {
1293 advances[i] += adjustment; 1291 advances[i] += adjustment;
1294 }
1295 1292
1296 int back = 0; 1293 int back = 0;
1297 HB_FixedPoint *offsets = item->offsets; 1294 HB_FixedPoint *offsets = item->offsets;
1298 offsets[i].x = positions[i].x_pos; 1295 offsets[i].x = positions[i].x_pos;
1299 offsets[i].y = positions[i].y_pos; 1296 offsets[i].y = positions[i].y_pos;
1300 while (positions[i - back].back) { 1297 while (positions[i - back].back) {
1301 back += positions[i - back].back; 1298 back += positions[i - back].back;
1302 offsets[i].x += positions[i - back].x_pos; 1299 offsets[i].x += positions[i - back].x_pos;
1303 offsets[i].y += positions[i - back].y_pos; 1300 offsets[i].y += positions[i - back].y_pos;
1304 } 1301 }
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
1347 HB_Bool result = false; 1344 HB_Bool result = false;
1348 if (shaper_item->num_glyphs < shaper_item->item.length) { 1345 if (shaper_item->num_glyphs < shaper_item->item.length) {
1349 shaper_item->num_glyphs = shaper_item->item.length; 1346 shaper_item->num_glyphs = shaper_item->item.length;
1350 return false; 1347 return false;
1351 } 1348 }
1352 assert(shaper_item->item.script < HB_ScriptCount); 1349 assert(shaper_item->item.script < HB_ScriptCount);
1353 result = HB_ScriptEngines[shaper_item->item.script].shape(shaper_item); 1350 result = HB_ScriptEngines[shaper_item->item.script].shape(shaper_item);
1354 shaper_item->glyphIndicesPresent = false; 1351 shaper_item->glyphIndicesPresent = false;
1355 return result; 1352 return result;
1356 } 1353 }
1357
OLDNEW
« no previous file with comments | « third_party/harfbuzz/chromium.patch ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698