Changeset 54020 in webkit
- Timestamp:
- Jan 28, 2010 2:17:23 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 4 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r54013 r54020 1 2010-01-27 Evan Martin <evan@chromium.org> 2 3 Reviewed by David Levin. 4 5 [chromium] hebrew vowel marks incorrectly positioned 6 https://bugs.webkit.org/show_bug.cgi?id=34234 7 8 Add a layout test containing some Hebrew vowels. 9 10 * fast/text/international/hebrew-vowels.html: Added. 11 1 12 2010-01-28 Dimitri Glazkov <dglazkov@chromium.org> 2 13 -
trunk/WebCore/ChangeLog
r54019 r54020 1 2010-01-27 Evan Martin <evan@chromium.org> 2 3 Reviewed by David Levin. 4 5 [chromium] hebrew vowel marks incorrectly positioned 6 https://bugs.webkit.org/show_bug.cgi?id=34234 7 8 Fix glyph metrics computation such that the glyph offsets 9 are correct, so we can now make use of them. 10 11 Test: fast/text/international/hebrew-vowels.html 12 13 * platform/graphics/chromium/FontLinux.cpp: 14 (WebCore::TextRunWalker::createGlyphArrays): initialize per-glyph 15 offset table. 16 (WebCore::TextRunWalker::setGlyphXPositions): use per-glyph 17 offsets. 18 * platform/graphics/chromium/HarfbuzzSkia.cpp: 19 (WebCore::getGlyphMetrics): fix metrics computation such that 20 per-glyph offsets are computed correctly. 21 1 22 2010-01-28 Laszlo Gombos <laszlo.1.gombos@nokia.com> 2 23 -
trunk/WebCore/platform/graphics/chromium/FontLinux.cpp
r53958 r54020 401 401 m_item.advances = new HB_Fixed[m_maxGlyphs]; 402 402 m_item.offsets = new HB_FixedPoint[m_maxGlyphs]; 403 // HB_FixedPoint is a struct, so we must use memset to clear it. 404 memset(m_item.offsets, 0, m_maxGlyphs * sizeof(HB_FixedPoint)); 403 405 m_glyphs16 = new uint16_t[m_maxGlyphs]; 404 406 m_xPositions = new SkScalar[m_maxGlyphs]; … … 437 439 void setGlyphXPositions(bool isRTL) 438 440 { 439 m_pixelWidth = 0; 440 for (unsigned i = 0; i < m_item.num_glyphs; ++i) { 441 int index; 442 if (isRTL) 443 index = m_item.num_glyphs - (i + 1); 444 else 445 index = i; 441 double position = 0; 442 for (int iter = 0; iter < m_item.num_glyphs; ++iter) { 443 // Glyphs are stored in logical order, but for layout purposes we always go left to right. 444 int i = isRTL ? m_item.num_glyphs - iter - 1 : iter; 446 445 447 446 m_glyphs16[i] = m_item.glyphs[i]; 448 m_xPositions[index] = m_offsetX + m_pixelWidth; 449 m_pixelWidth += truncateFixedPointToInteger(m_item.advances[index]); 450 } 447 double offsetX = truncateFixedPointToInteger(m_item.offsets[i].x); 448 m_xPositions[i] = m_offsetX + position + offsetX; 449 450 double advance = truncateFixedPointToInteger(m_item.advances[i]); 451 position += advance; 452 } 453 m_pixelWidth = position; 451 454 m_offsetX += m_pixelWidth; 452 455 } -
trunk/WebCore/platform/graphics/chromium/HarfbuzzSkia.cpp
r53958 r54020 168 168 paint.getTextWidths(&glyph16, sizeof(glyph16), &width, &bounds); 169 169 170 metrics->x = SkiaScalarToHarfbuzzFixed(width); 170 metrics->x = SkiaScalarToHarfbuzzFixed(bounds.fLeft); 171 metrics->y = SkiaScalarToHarfbuzzFixed(bounds.fTop); 172 metrics->width = SkiaScalarToHarfbuzzFixed(bounds.width()); 173 metrics->height = SkiaScalarToHarfbuzzFixed(bounds.height()); 174 175 metrics->xOffset = SkiaScalarToHarfbuzzFixed(width); 171 176 // We can't actually get the |y| correct because Skia doesn't export 172 177 // the vertical advance. However, nor we do ever render vertical text at 173 178 // the moment so it's unimportant. 174 metrics->y = 0; 175 metrics->width = SkiaScalarToHarfbuzzFixed(bounds.width()); 176 metrics->height = SkiaScalarToHarfbuzzFixed(bounds.height()); 177 metrics->xOffset = SkiaScalarToHarfbuzzFixed(bounds.fLeft); 178 metrics->yOffset = SkiaScalarToHarfbuzzFixed(bounds.fTop); 179 metrics->yOffset = 0; 179 180 } 180 181
Note: See TracChangeset
for help on using the changeset viewer.