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 507 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
518 unsigned glyphCount = complexTextRun.glyphCount(); | 518 unsigned glyphCount = complexTextRun.glyphCount(); |
519 const SimpleFontData* fontData = complexTextRun.fontData(); | 519 const SimpleFontData* fontData = complexTextRun.fontData(); |
520 | 520 |
521 if (!complexTextRun.isLTR()) | 521 if (!complexTextRun.isLTR()) |
522 m_isLTROnly = false; | 522 m_isLTROnly = false; |
523 | 523 |
524 const CGGlyph* glyphs = complexTextRun.glyphs(); | 524 const CGGlyph* glyphs = complexTextRun.glyphs(); |
525 const CGSize* advances = complexTextRun.advances(); | 525 const CGSize* advances = complexTextRun.advances(); |
526 | 526 |
527 bool lastRun = r + 1 == runCount; | 527 bool lastRun = r + 1 == runCount; |
528 bool roundsAdvances = !m_font.fontDescription().usePrinterFont() && font
Data->platformData().roundsGlyphAdvances(); | 528 bool roundsAdvances = fontData->platformData().roundsGlyphAdvances(); |
529 float spaceWidth = fontData->spaceWidth() - fontData->syntheticBoldOffse
t(); | 529 float spaceWidth = fontData->spaceWidth() - fontData->syntheticBoldOffse
t(); |
530 CGFloat roundedSpaceWidth = roundCGFloat(spaceWidth); | 530 CGFloat roundedSpaceWidth = roundCGFloat(spaceWidth); |
531 const UChar* cp = complexTextRun.characters(); | 531 const UChar* cp = complexTextRun.characters(); |
532 CGPoint glyphOrigin = CGPointZero; | 532 CGPoint glyphOrigin = CGPointZero; |
533 CFIndex lastCharacterIndex = m_run.ltr() ? numeric_limits<CFIndex>::min(
) : numeric_limits<CFIndex>::max(); | 533 CFIndex lastCharacterIndex = m_run.ltr() ? numeric_limits<CFIndex>::min(
) : numeric_limits<CFIndex>::max(); |
534 bool isMonotonic = true; | 534 bool isMonotonic = true; |
535 | 535 |
536 for (unsigned i = 0; i < glyphCount; i++) { | 536 for (unsigned i = 0; i < glyphCount; i++) { |
537 CFIndex characterIndex = complexTextRun.indexAt(i); | 537 CFIndex characterIndex = complexTextRun.indexAt(i); |
538 if (m_run.ltr()) { | 538 if (m_run.ltr()) { |
(...skipping 121 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 |