| 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 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 , m_finalRoundingWidth(0) | 127 , m_finalRoundingWidth(0) |
| 128 , m_expansion(run.expansion()) | 128 , m_expansion(run.expansion()) |
| 129 , m_leadingExpansion(0) | 129 , m_leadingExpansion(0) |
| 130 , m_afterExpansion(!run.allowsLeadingExpansion()) | 130 , m_afterExpansion(!run.allowsLeadingExpansion()) |
| 131 , m_fallbackFonts(fallbackFonts) | 131 , m_fallbackFonts(fallbackFonts) |
| 132 , m_minGlyphBoundingBoxX(numeric_limits<float>::max()) | 132 , m_minGlyphBoundingBoxX(numeric_limits<float>::max()) |
| 133 , m_maxGlyphBoundingBoxX(numeric_limits<float>::min()) | 133 , m_maxGlyphBoundingBoxX(numeric_limits<float>::min()) |
| 134 , m_minGlyphBoundingBoxY(numeric_limits<float>::max()) | 134 , m_minGlyphBoundingBoxY(numeric_limits<float>::max()) |
| 135 , m_maxGlyphBoundingBoxY(numeric_limits<float>::min()) | 135 , m_maxGlyphBoundingBoxY(numeric_limits<float>::min()) |
| 136 , m_lastRoundingGlyph(0) | 136 , m_lastRoundingGlyph(0) |
| 137 , m_distributeJustification(false) |
| 137 { | 138 { |
| 138 if (!m_expansion) | 139 if (!m_expansion) |
| 139 m_expansionPerOpportunity = 0; | 140 m_expansionPerOpportunity = 0; |
| 140 else { | 141 else { |
| 141 bool isAfterExpansion = m_afterExpansion; | 142 bool isAfterExpansion = m_afterExpansion; |
| 142 unsigned expansionOpportunityCount; | 143 unsigned expansionOpportunityCount; |
| 144 m_distributeJustification = m_run.isDistributeJustification(); |
| 143 if (m_run.is8Bit()) | 145 if (m_run.is8Bit()) |
| 144 expansionOpportunityCount = Font::expansionOpportunityCount(m_run.ch
aracters8(), m_end, m_run.ltr() ? LTR : RTL, isAfterExpansion); | 146 expansionOpportunityCount = Font::expansionOpportunityCount(m_run.ch
aracters8(), m_end, m_run.ltr() ? LTR : RTL, isAfterExpansion, m_distributeJusti
fication); |
| 145 else | 147 else |
| 146 expansionOpportunityCount = Font::expansionOpportunityCount(m_run.c
haracters16(), m_end, m_run.ltr() ? LTR : RTL, isAfterExpansion); | 148 expansionOpportunityCount = Font::expansionOpportunityCount(m_run.ch
aracters16(), m_end, m_run.ltr() ? LTR : RTL, isAfterExpansion, m_distributeJust
ification); |
| 147 if (isAfterExpansion && !m_run.allowsTrailingExpansion()) | 149 if (isAfterExpansion && !m_run.allowsTrailingExpansion()) |
| 148 expansionOpportunityCount--; | 150 expansionOpportunityCount--; |
| 149 | 151 |
| 150 if (!expansionOpportunityCount) | 152 if (!expansionOpportunityCount) |
| 151 m_expansionPerOpportunity = 0; | 153 m_expansionPerOpportunity = 0; |
| 152 else | 154 else |
| 153 m_expansionPerOpportunity = m_expansion / expansionOpportunityCount; | 155 m_expansionPerOpportunity = m_expansion / expansionOpportunityCount; |
| 154 } | 156 } |
| 155 | 157 |
| 156 collectComplexTextRuns(); | 158 collectComplexTextRuns(); |
| (...skipping 561 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 718 | 720 |
| 719 lastCharacterIndex = characterIndex; | 721 lastCharacterIndex = characterIndex; |
| 720 } | 722 } |
| 721 if (!isMonotonic) | 723 if (!isMonotonic) |
| 722 complexTextRun.setIsNonMonotonic(); | 724 complexTextRun.setIsNonMonotonic(); |
| 723 } | 725 } |
| 724 m_totalWidth += widthSinceLastCommit; | 726 m_totalWidth += widthSinceLastCommit; |
| 725 } | 727 } |
| 726 | 728 |
| 727 } // namespace WebCore | 729 } // namespace WebCore |
| OLD | NEW |