Changeset 219504 in webkit
- Timestamp:
- Jul 14, 2017 8:54:31 AM (7 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r219500 r219504 1 2017-07-14 Fujii Hironori <Hironori.Fujii@sony.com> 2 3 [HarfBuzz] Decomposed Vietnamese characters are rendered incorrectly 4 https://bugs.webkit.org/show_bug.cgi?id=174418 5 6 Reviewed by Michael Catanzaro. 7 8 * fast/text/international/vietnamese-nfd-expected.html: Added. 9 * fast/text/international/vietnamese-nfd.html: Added. 10 1 11 2017-07-14 Aaron Chu <aaron_chu@apple.com> 2 12 -
trunk/Source/WebCore/ChangeLog
r219503 r219504 1 2017-07-14 Fujii Hironori <Hironori.Fujii@sony.com> 2 3 [HarfBuzz] Decomposed Vietnamese characters are rendered incorrectly 4 https://bugs.webkit.org/show_bug.cgi?id=174418 5 6 Reviewed by Michael Catanzaro. 7 8 HarfBuzzShaper should normalize the input text before collecting 9 HarfBuzzRuns. Actually, HarfBuzzShaper::setNormalizedBuffer does 10 the task. But, this function hasn't been called from anywhere 11 since Bug 108077. 12 13 Test: fast/text/international/vietnamese-nfd.html 14 15 * platform/graphics/harfbuzz/HarfBuzzShaper.cpp: 16 (WebCore::HarfBuzzShaper::HarfBuzzShaper): 17 Call setNormalizedBuffer instead of normalizeCharacters. 18 (WebCore::normalizeCharacters): Deleted. 19 1 20 2017-07-14 Fujii Hironori <Hironori.Fujii@sony.com> 2 21 -
trunk/Source/WebCore/platform/graphics/harfbuzz/HarfBuzzShaper.cpp
r215754 r219504 161 161 } 162 162 163 static void normalizeCharacters(const TextRun& run, UChar* destination, unsigned length)164 {165 unsigned position = 0;166 bool error = false;167 const UChar* source;168 String stringFor8BitRun;169 if (run.is8Bit()) {170 stringFor8BitRun = String::make16BitFrom8BitSource(run.characters8(), run.length());171 source = stringFor8BitRun.characters16();172 } else173 source = run.characters16();174 175 while (position < length) {176 UChar32 character;177 unsigned nextPosition = position;178 U16_NEXT(source, nextPosition, length, character);179 // Don't normalize tabs as they are not treated as spaces for word-end.180 if (FontCascade::treatAsSpace(character) && character != '\t')181 character = ' ';182 else if (FontCascade::treatAsZeroWidthSpaceInComplexScript(character))183 character = zeroWidthSpace;184 U16_APPEND(destination, position, length, character, error);185 ASSERT_UNUSED(error, !error);186 position = nextPosition;187 }188 }189 190 163 HarfBuzzShaper::HarfBuzzShaper(const FontCascade* font, const TextRun& run) 191 164 : m_font(font) … … 198 171 , m_letterSpacing(font->letterSpacing()) 199 172 { 200 m_normalizedBuffer = std::make_unique<UChar[]>(m_run.length() + 1); 201 m_normalizedBufferLength = m_run.length(); 202 normalizeCharacters(m_run, m_normalizedBuffer.get(), m_normalizedBufferLength); 173 setNormalizedBuffer(); 203 174 setPadding(m_run.expansion()); 204 175 setFontFeatures();
Note: See TracChangeset
for help on using the changeset viewer.