OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 452 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
463 glyphEndOffset = max<unsigned>(glyphStartOffset, static_cast
<unsigned>(g > 0 ? complexTextRun.indexAt(g - 1) : complexTextRun.indexEnd())); | 463 glyphEndOffset = max<unsigned>(glyphStartOffset, static_cast
<unsigned>(g > 0 ? complexTextRun.indexAt(g - 1) : complexTextRun.indexEnd())); |
464 } else | 464 } else |
465 glyphEndOffset = complexTextRun.endOffsetAt(g); | 465 glyphEndOffset = complexTextRun.endOffsetAt(g); |
466 | 466 |
467 CGSize adjustedAdvance = m_adjustedAdvances[k]; | 467 CGSize adjustedAdvance = m_adjustedAdvances[k]; |
468 | 468 |
469 if (glyphStartOffset + complexTextRun.stringLocation() >= m_currentC
haracter) | 469 if (glyphStartOffset + complexTextRun.stringLocation() >= m_currentC
haracter) |
470 return; | 470 return; |
471 | 471 |
472 if (glyphBuffer && !m_characterInCurrentGlyph) | 472 if (glyphBuffer && !m_characterInCurrentGlyph) |
473 glyphBuffer->add(m_adjustedGlyphs[k], complexTextRun.fontData(),
adjustedAdvance); | 473 glyphBuffer->add(m_adjustedGlyphs[k], complexTextRun.fontData(),
FloatSize(adjustedAdvance)); |
474 | 474 |
475 unsigned oldCharacterInCurrentGlyph = m_characterInCurrentGlyph; | 475 unsigned oldCharacterInCurrentGlyph = m_characterInCurrentGlyph; |
476 m_characterInCurrentGlyph = min(m_currentCharacter - complexTextRun.
stringLocation(), glyphEndOffset) - glyphStartOffset; | 476 m_characterInCurrentGlyph = min(m_currentCharacter - complexTextRun.
stringLocation(), glyphEndOffset) - glyphStartOffset; |
477 // FIXME: Instead of dividing the glyph's advance equally between th
e characters, this | 477 // FIXME: Instead of dividing the glyph's advance equally between th
e characters, this |
478 // could use the glyph's "ligature carets". However, there is no Cor
e Text API to get the | 478 // could use the glyph's "ligature carets". However, there is no Cor
e Text API to get the |
479 // ligature carets. | 479 // ligature carets. |
480 if (glyphStartOffset == glyphEndOffset) { | 480 if (glyphStartOffset == glyphEndOffset) { |
481 // When there are multiple glyphs per character we need to advan
ce by the full width of the glyph. | 481 // When there are multiple glyphs per character we need to advan
ce by the full width of the glyph. |
482 ASSERT(m_characterInCurrentGlyph == oldCharacterInCurrentGlyph); | 482 ASSERT(m_characterInCurrentGlyph == oldCharacterInCurrentGlyph); |
483 m_runWidthSoFar += adjustedAdvance.width; | 483 m_runWidthSoFar += adjustedAdvance.width; |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
660 | 660 |
661 lastCharacterIndex = characterIndex; | 661 lastCharacterIndex = characterIndex; |
662 } | 662 } |
663 if (!isMonotonic) | 663 if (!isMonotonic) |
664 complexTextRun.setIsNonMonotonic(); | 664 complexTextRun.setIsNonMonotonic(); |
665 } | 665 } |
666 m_totalWidth += widthSinceLastCommit; | 666 m_totalWidth += widthSinceLastCommit; |
667 } | 667 } |
668 | 668 |
669 } // namespace WebCore | 669 } // namespace WebCore |
OLD | NEW |