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

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: 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 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 while (position < length) { 101 while (position < length) {
102 UChar32 character; 102 UChar32 character;
103 U16_NEXT(source, position, length, character); 103 U16_NEXT(source, position, length, character);
104 // Don't normalize tabs as they are not treated as spaces for word-end. 104 // Don't normalize tabs as they are not treated as spaces for word-end.
105 if (run.normalizeSpace() && Character::isNormalizedCanvasSpaceCharacter( character)) 105 if (run.normalizeSpace() && Character::isNormalizedCanvasSpaceCharacter( character))
106 character = spaceCharacter; 106 character = spaceCharacter;
107 else if (Character::treatAsSpace(character) && character != noBreakSpace Character) 107 else if (Character::treatAsSpace(character) && character != noBreakSpace Character)
108 character = spaceCharacter; 108 character = spaceCharacter;
109 else if (Character::treatAsZeroWidthSpaceInComplexScript(character)) 109 else if (Character::treatAsZeroWidthSpaceInComplexScript(character))
110 character = zeroWidthSpaceCharacter; 110 character = zeroWidthSpaceCharacter;
111 else if (Character::isModifier(character))
112 character = zeroWidthSpaceCharacter;
113 111
114 U16_APPEND(destination, *destinationLength, length, character, error); 112 U16_APPEND(destination, *destinationLength, length, character, error);
115 ASSERT_UNUSED(error, !error); 113 ASSERT_UNUSED(error, !error);
116 } 114 }
117 } 115 }
118 116
119 HarfBuzzShaper::HarfBuzzShaper(const Font* font, const TextRun& run) 117 HarfBuzzShaper::HarfBuzzShaper(const Font* font, const TextRun& run)
120 : Shaper(font, run) 118 : Shaper(font, run)
121 , m_normalizedBufferLength(0) 119 , m_normalizedBufferLength(0)
122 , m_wordSpacingAdjustment(font->fontDescription().wordSpacing()) 120 , m_wordSpacingAdjustment(font->fontDescription().wordSpacing())
(...skipping 677 matching lines...) Expand 10 before | Expand all | Expand 10 after
800 } 798 }
801 799
802 // Don't need to check m_textRun.allowsTrailingExpansion() since it's covere d by !m_expansionOpportunityCount above 800 // Don't need to check m_textRun.allowsTrailingExpansion() since it's covere d by !m_expansionOpportunityCount above
803 spacing += nextExpansionPerOpportunity(); 801 spacing += nextExpansionPerOpportunity();
804 m_isAfterExpansion = true; 802 m_isAfterExpansion = true;
805 return spacing; 803 return spacing;
806 } 804 }
807 805
808 806
809 } // namespace blink 807 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698