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

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

Issue 1144033004: Unicode Variation Selectors support in collectCandidateRuns (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Avoid using wcslen() in tests Created 5 years, 6 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
« no previous file with comments | « Source/platform/fonts/Character.h ('k') | Source/platform/fonts/shaping/HarfBuzzShaperTest.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 561 matching lines...) Expand 10 before | Expand all | Expand 10 after
572 do { 572 do {
573 const UChar* currentCharacterPosition = iterator.characters(); 573 const UChar* currentCharacterPosition = iterator.characters();
574 const SimpleFontData* currentFontData = nextFontData; 574 const SimpleFontData* currentFontData = nextFontData;
575 UScriptCode currentScript = nextScript; 575 UScriptCode currentScript = nextScript;
576 576
577 UChar32 lastCharacter = character; 577 UChar32 lastCharacter = character;
578 for (iterator.advance(); iterator.consume(character); iterator.advance() ) { 578 for (iterator.advance(); iterator.consume(character); iterator.advance() ) {
579 if (Character::treatAsZeroWidthSpace(character)) 579 if (Character::treatAsZeroWidthSpace(character))
580 continue; 580 continue;
581 if ((U_GET_GC_MASK(character) & U_GC_M_MASK) 581 if ((U_GET_GC_MASK(character) & U_GC_M_MASK)
582 && currentFontData->canRenderCombiningCharacterSequence( 582 && (Character::isUnicodeVariationSelector(character)
583 currentCharacterPosition, 583 || currentFontData->canRenderCombiningCharacterSequence(
584 iterator.glyphEnd() - currentCharacterPosition)) 584 currentCharacterPosition,
585 iterator.glyphEnd() - currentCharacterPosition)))
585 continue; 586 continue;
586 587
587 nextFontData = font->glyphDataForCharacter(character, false, isSpace Normalize).fontData; 588 nextFontData = font->glyphDataForCharacter(character, false, isSpace Normalize).fontData;
588 nextScript = uscript_getScript(character, &errorCode); 589 nextScript = uscript_getScript(character, &errorCode);
589 if (U_FAILURE(errorCode)) 590 if (U_FAILURE(errorCode))
590 return false; 591 return false;
591 if (lastCharacter == zeroWidthJoinerCharacter) 592 if (lastCharacter == zeroWidthJoinerCharacter)
592 currentFontData = nextFontData; 593 currentFontData = nextFontData;
593 if ((nextFontData != currentFontData) || ((currentScript != nextScri pt) && (nextScript != USCRIPT_INHERITED) && (!uscript_hasScript(character, curre ntScript)))) 594 if ((nextFontData != currentFontData) || ((currentScript != nextScri pt) && (nextScript != USCRIPT_INHERITED) && (!uscript_hasScript(character, curre ntScript))))
594 break; 595 break;
(...skipping 596 matching lines...) Expand 10 before | Expand all | Expand 10 after
1191 // possibly invalid from, to arguments. 1192 // possibly invalid from, to arguments.
1192 if (!foundToX && !foundFromX) 1193 if (!foundToX && !foundFromX)
1193 fromX = toX = 0; 1194 fromX = toX = 0;
1194 1195
1195 if (fromX < toX) 1196 if (fromX < toX)
1196 return FloatRect(point.x() + fromX, point.y(), toX - fromX, height); 1197 return FloatRect(point.x() + fromX, point.y(), toX - fromX, height);
1197 return FloatRect(point.x() + toX, point.y(), fromX - toX, height); 1198 return FloatRect(point.x() + toX, point.y(), fromX - toX, height);
1198 } 1199 }
1199 1200
1200 } // namespace blink 1201 } // namespace blink
OLDNEW
« no previous file with comments | « Source/platform/fonts/Character.h ('k') | Source/platform/fonts/shaping/HarfBuzzShaperTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698