| 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 518 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 529 const FontDescription& fontDescription = m_font->fontDescription(); | 529 const FontDescription& fontDescription = m_font->fontDescription(); |
| 530 const String& localeString = fontDescription.locale(); | 530 const String& localeString = fontDescription.locale(); |
| 531 CString locale = localeString.latin1(); | 531 CString locale = localeString.latin1(); |
| 532 const hb_language_t language = hb_language_from_string(locale.data(), locale
.length()); | 532 const hb_language_t language = hb_language_from_string(locale.data(), locale
.length()); |
| 533 | 533 |
| 534 RunSegmenter::RunSegmenterRange segmentRange = { | 534 RunSegmenter::RunSegmenterRange segmentRange = { |
| 535 0, | 535 0, |
| 536 0, | 536 0, |
| 537 USCRIPT_INVALID_CODE, | 537 USCRIPT_INVALID_CODE, |
| 538 OrientationIterator::OrientationInvalid, | 538 OrientationIterator::OrientationInvalid, |
| 539 SmallCapsIterator::SmallCapsSameCase }; | 539 SmallCapsIterator::SmallCapsSameCase, |
| 540 FontFallbackPriority::Invalid }; |
| 540 RunSegmenter runSegmenter( | 541 RunSegmenter runSegmenter( |
| 541 m_normalizedBuffer.get(), | 542 m_normalizedBuffer.get(), |
| 542 m_normalizedBufferLength, | 543 m_normalizedBufferLength, |
| 543 m_font->fontDescription().orientation(), | 544 m_font->fontDescription().orientation(), |
| 544 fontDescription.variant()); | 545 fontDescription.variant()); |
| 545 | 546 |
| 546 Vector<UChar32> fallbackCharsHint; | 547 Vector<UChar32> fallbackCharsHint; |
| 547 | 548 |
| 548 // TODO: Check whether this treatAsZerowidthspace from the previous script | 549 // TODO: Check whether this treatAsZerowidthspace from the previous script |
| 549 // segmentation plays a role here, does the new scriptRuniterator handle tha
t correctly? | 550 // segmentation plays a role here, does the new scriptRuniterator handle tha
t correctly? |
| 550 while (runSegmenter.consume(&segmentRange)) { | 551 while (runSegmenter.consume(&segmentRange)) { |
| 551 RefPtr<FontFallbackIterator> fallbackIterator = m_font->createFontFallba
ckIterator(); | 552 RefPtr<FontFallbackIterator> fallbackIterator = |
| 553 m_font->createFontFallbackIterator( |
| 554 segmentRange.fontFallbackPriority); |
| 552 | 555 |
| 553 appendToHolesQueue(HolesQueueNextFont, 0, 0); | 556 appendToHolesQueue(HolesQueueNextFont, 0, 0); |
| 554 appendToHolesQueue(HolesQueueRange, segmentRange.start, segmentRange.end
- segmentRange.start); | 557 appendToHolesQueue(HolesQueueRange, segmentRange.start, segmentRange.end
- segmentRange.start); |
| 555 | 558 |
| 556 const SimpleFontData* currentFont = nullptr; | 559 const SimpleFontData* currentFont = nullptr; |
| 557 unsigned currentFontRangeFrom = 0; | 560 unsigned currentFontRangeFrom = 0; |
| 558 unsigned currentFontRangeTo = 0; | 561 unsigned currentFontRangeTo = 0; |
| 559 | 562 |
| 560 bool fontCycleQueued = false; | 563 bool fontCycleQueued = false; |
| 561 while (m_holesQueue.size()) { | 564 while (m_holesQueue.size()) { |
| (...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 797 } | 800 } |
| 798 | 801 |
| 799 // Don't need to check m_textRun.allowsTrailingExpansion() since it's covere
d by !m_expansionOpportunityCount above | 802 // Don't need to check m_textRun.allowsTrailingExpansion() since it's covere
d by !m_expansionOpportunityCount above |
| 800 spacing += nextExpansionPerOpportunity(); | 803 spacing += nextExpansionPerOpportunity(); |
| 801 m_isAfterExpansion = true; | 804 m_isAfterExpansion = true; |
| 802 return spacing; | 805 return spacing; |
| 803 } | 806 } |
| 804 | 807 |
| 805 | 808 |
| 806 } // namespace blink | 809 } // namespace blink |
| OLD | NEW |