OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |