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

Unified Diff: third_party/WebKit/Source/platform/fonts/Font.cpp

Issue 1555013002: Make emphasis mark glyph data retrieval independent of code path (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Additional win rebaselines Created 4 years, 12 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/LayoutTests/TestExpectations ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/platform/fonts/Font.cpp
diff --git a/third_party/WebKit/Source/platform/fonts/Font.cpp b/third_party/WebKit/Source/platform/fonts/Font.cpp
index 834c9960fb13c93b9da95d68f91b900eb6f3d23e..4a39f1d9d83b39bf25b0184fa9e611fa80ce7c42 100644
--- a/third_party/WebKit/Source/platform/fonts/Font.cpp
+++ b/third_party/WebKit/Source/platform/fonts/Font.cpp
@@ -658,31 +658,23 @@ GlyphData Font::glyphDataForCharacter(UChar32& c, bool mirror, bool normalizeSpa
return data;
}
-// FIXME: This function may not work if the emphasis mark uses a complex script, but none of the
-// standard emphasis marks do so.
bool Font::getEmphasisMarkGlyphData(const AtomicString& mark, GlyphData& glyphData) const
{
if (mark.isEmpty())
return false;
- UChar32 character = mark[0];
-
- if (U16_IS_SURROGATE(character)) {
- if (!U16_IS_SURROGATE_LEAD(character))
- return false;
-
- if (mark.length() < 2)
- return false;
+ TextRun emphasisMarkRun(mark, mark.length());
+ TextRunPaintInfo emphasisPaintInfo(emphasisMarkRun);
+ GlyphBuffer glyphBuffer;
+ buildGlyphBuffer(emphasisPaintInfo, glyphBuffer);
- UChar low = mark[1];
- if (!U16_IS_TRAIL(low))
- return false;
+ if (glyphBuffer.isEmpty())
+ return false;
- character = U16_GET_SUPPLEMENTARY(character, low);
- }
+ ASSERT(glyphBuffer.fontDataAt(0));
+ glyphData.fontData = glyphBuffer.fontDataAt(0)->emphasisMarkFontData(m_fontDescription).get();
+ glyphData.glyph = glyphBuffer.glyphAt(0);
- bool normalizeSpace = false;
- glyphData = glyphDataForCharacter(character, false, normalizeSpace, EmphasisMarkVariant);
return true;
}
« no previous file with comments | « third_party/WebKit/LayoutTests/TestExpectations ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698