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

Side by Side Diff: third_party/WebKit/Source/platform/fonts/shaping/HarfBuzzShaper.cpp

Issue 1780723002: Enable Emoji Fitzpatrick modifier sequences (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebased on renamed CharacterData file Created 4 years, 9 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
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2012 Google Inc. All rights reserved. 2 * Copyright (c) 2012 Google Inc. All rights reserved.
3 * Copyright (C) 2013 BlackBerry Limited. All rights reserved. 3 * Copyright (C) 2013 BlackBerry Limited. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 while (position < length) { 100 while (position < length) {
101 UChar32 character; 101 UChar32 character;
102 U16_NEXT(source, position, length, character); 102 U16_NEXT(source, position, length, character);
103 // Don't normalize tabs as they are not treated as spaces for word-end. 103 // Don't normalize tabs as they are not treated as spaces for word-end.
104 if (run.normalizeSpace() && Character::isNormalizedCanvasSpaceCharacter( character)) 104 if (run.normalizeSpace() && Character::isNormalizedCanvasSpaceCharacter( character))
105 character = spaceCharacter; 105 character = spaceCharacter;
106 else if (Character::treatAsSpace(character) && character != noBreakSpace Character) 106 else if (Character::treatAsSpace(character) && character != noBreakSpace Character)
107 character = spaceCharacter; 107 character = spaceCharacter;
108 else if (Character::treatAsZeroWidthSpaceInComplexScript(character)) 108 else if (Character::treatAsZeroWidthSpaceInComplexScript(character))
109 character = zeroWidthSpaceCharacter; 109 character = zeroWidthSpaceCharacter;
110 else if (Character::isModifier(character))
111 character = zeroWidthSpaceCharacter;
112 110
113 U16_APPEND(destination, *destinationLength, length, character, error); 111 U16_APPEND(destination, *destinationLength, length, character, error);
114 ASSERT_UNUSED(error, !error); 112 ASSERT_UNUSED(error, !error);
115 } 113 }
116 } 114 }
117 115
118 HarfBuzzShaper::HarfBuzzShaper(const Font* font, const TextRun& run) 116 HarfBuzzShaper::HarfBuzzShaper(const Font* font, const TextRun& run)
119 : Shaper(font, run) 117 : Shaper(font, run)
120 , m_normalizedBufferLength(0) 118 , m_normalizedBufferLength(0)
121 , m_wordSpacingAdjustment(font->fontDescription().wordSpacing()) 119 , m_wordSpacingAdjustment(font->fontDescription().wordSpacing())
(...skipping 677 matching lines...) Expand 10 before | Expand all | Expand 10 after
799 } 797 }
800 798
801 // Don't need to check m_textRun.allowsTrailingExpansion() since it's covere d by !m_expansionOpportunityCount above 799 // Don't need to check m_textRun.allowsTrailingExpansion() since it's covere d by !m_expansionOpportunityCount above
802 spacing += nextExpansionPerOpportunity(); 800 spacing += nextExpansionPerOpportunity();
803 m_isAfterExpansion = true; 801 m_isAfterExpansion = true;
804 return spacing; 802 return spacing;
805 } 803 }
806 804
807 805
808 } // namespace blink 806 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698