+2009-01-15 Dimitri Glazkov <dglazkov@chromium.org>
+
+ Reviewed by Darin Adler.
+
+ https://bugs.webkit.org/show_bug.cgi?id=23354
+ Fix up graphics/chromium files to account for Uniscribe style scrubbing.
+
+ * platform/graphics/chromium/FontChromiumWin.cpp:
+ (WebCore::windowsCanHandleTextDrawing):
+ (WebCore::Font::selectionRectForComplexText):
+ (WebCore::Font::drawComplexText):
+ (WebCore::Font::floatWidthForComplexText):
+ (WebCore::Font::offsetForPositionForComplexText):
+ * platform/graphics/chromium/GlyphPageTreeNodeChromiumWin.cpp:
+ (WebCore::fillNonBMPGlyphs):
+
2009-01-15 David Levin <levin@chromium.org>
Reviewed by Darin Adler.
// which look weird. All else being equal, it's better to use Windows' text
// drawing, so we don't check for zooms.
const TransformationMatrix& matrix = context->getCTM();
- if (matrix.b() != 0 || // Y skew
- matrix.c() != 0) // X skew
+ if (matrix.b() != 0 || matrix.c() != 0) // Check for skew.
return false;
// Check for stroke effects.
int to) const
{
UniscribeHelperTextRun state(run, *this);
- float left = static_cast<float>(point.x() + state.CharacterToX(from));
- float right = static_cast<float>(point.x() + state.CharacterToX(to));
+ float left = static_cast<float>(point.x() + state.characterToX(from));
+ float right = static_cast<float>(point.x() + state.characterToX(to));
// If the text is RTL, left will actually be after right.
if (left < right)
- return FloatRect(left, static_cast<float>(point.y()),
+ return FloatRect(left, static_cast<float>(point.y()),
right - left, static_cast<float>(h));
return FloatRect(right, static_cast<float>(point.y()),
// Uniscribe counts the coordinates from the upper left, while WebKit uses
// the baseline, so we have to subtract off the ascent.
- state.Draw(hdc, static_cast<int>(point.x()), static_cast<int>(point.y() - ascent()), from, to);
+ state.draw(hdc, static_cast<int>(point.x()), static_cast<int>(point.y() - ascent()), from, to);
context->canvas()->endPlatformPaint();
}
float Font::floatWidthForComplexText(const TextRun& run) const
{
UniscribeHelperTextRun state(run, *this);
- return static_cast<float>(state.Width());
+ return static_cast<float>(state.width());
}
int Font::offsetForPositionForComplexText(const TextRun& run, int x,
// Mac code ignores includePartialGlyphs, and they don't know what it's
// supposed to do, so we just ignore it as well.
UniscribeHelperTextRun state(run, *this);
- int char_index = state.XToCharacter(x);
+ int charIndex = state.xToCharacter(x);
// XToCharacter will return -1 if the position is before the first
// character (we get called like this sometimes).
- if (char_index < 0)
- char_index = 0;
- return char_index;
+ if (charIndex < 0)
+ charIndex = 0;
+ return charIndex;
}
} // namespace WebCore
fontData->m_font.scriptCache(),
fontData->m_font.scriptFontProperties());
state.setInhibitLigate(true);
- state.Init();
+ state.init();
for (unsigned i = 0; i < length; i++) {
// Each character in this input buffer is a surrogate pair, which
// consists of two UChars. So, the offset for its i-th character is
// (i * 2).
- WORD glyph = state.FirstGlyphForCharacter(i * 2);
+ WORD glyph = state.firstGlyphForCharacter(i * 2);
if (glyph) {
haveGlyphs = true;
page->setGlyphDataForIndex(offset + i, glyph, fontData);