| 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 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |