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 1005 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1016 clusterEnd = isRunEnd ? currentRun->startIndex() + currentRun->n umCharacters() : currentRun->startIndex() + glyphToCharacterIndexes[i + 1]; | 1016 clusterEnd = isRunEnd ? currentRun->startIndex() + currentRun->n umCharacters() : currentRun->startIndex() + glyphToCharacterIndexes[i + 1]; |
1017 | 1017 |
1018 graphemesInCluster = countGraphemesInCluster(m_normalizedBuffer.get( ), m_normalizedBufferLength, clusterStart, clusterEnd); | 1018 graphemesInCluster = countGraphemesInCluster(m_normalizedBuffer.get( ), m_normalizedBufferLength, clusterStart, clusterEnd); |
1019 if (!graphemesInCluster || !clusterAdvance) | 1019 if (!graphemesInCluster || !clusterAdvance) |
1020 continue; | 1020 continue; |
1021 | 1021 |
1022 float glyphAdvanceX = clusterAdvance / graphemesInCluster; | 1022 float glyphAdvanceX = clusterAdvance / graphemesInCluster; |
1023 for (unsigned j = 0; j < graphemesInCluster; ++j) { | 1023 for (unsigned j = 0; j < graphemesInCluster; ++j) { |
1024 // Do not put emphasis marks on space, separator, and control ch aracters. | 1024 // Do not put emphasis marks on space, separator, and control ch aracters. |
1025 Glyph glyphToAdd = Character::canReceiveTextEmphasis(m_run[curre ntCharacterIndex]) ? 1 : 0; | 1025 Glyph glyphToAdd = Character::canReceiveTextEmphasis(m_run[curre ntCharacterIndex]) ? 1 : 0; |
1026 if (m_run.rtl() && currentCharacterIndex >= m_toIndex) | |
1027 glyphToAdd = 0; | |
Dominik Röttsches
2014/09/30 12:27:00
Can m_toIndex be factored into the clusterEnd comp
Habib Virji
2014/09/30 13:28:40
Reason to add special handling was returning befor
Dominik Röttsches
2014/09/30 13:48:24
Yes, I understood your analysis. Please take a loo
Dominik Röttsches
2014/10/01 07:35:35
I looked at this a bit more closely again - this f
| |
1026 glyphBuffer->add(glyphToAdd, currentRun->fontData(), glyphAdvanc eX); | 1028 glyphBuffer->add(glyphToAdd, currentRun->fontData(), glyphAdvanc eX); |
1027 } | 1029 } |
1028 clusterStart = clusterEnd; | 1030 clusterStart = clusterEnd; |
1029 clusterAdvance = 0; | 1031 clusterAdvance = 0; |
1030 } | 1032 } |
1031 } | 1033 } |
1032 } | 1034 } |
1033 | 1035 |
1034 bool HarfBuzzShaper::fillGlyphBuffer(GlyphBuffer* glyphBuffer) | 1036 bool HarfBuzzShaper::fillGlyphBuffer(GlyphBuffer* glyphBuffer) |
1035 { | 1037 { |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1143 point.x() + fromX, point.x() + toX, | 1145 point.x() + fromX, point.x() + toX, |
1144 point.y(), height); | 1146 point.y(), height); |
1145 } | 1147 } |
1146 | 1148 |
1147 return Font::pixelSnappedSelectionRect( | 1149 return Font::pixelSnappedSelectionRect( |
1148 point.x() + toX, point.x() + fromX, | 1150 point.x() + toX, point.x() + fromX, |
1149 point.y(), height); | 1151 point.y(), height); |
1150 } | 1152 } |
1151 | 1153 |
1152 } // namespace blink | 1154 } // namespace blink |
OLD | NEW |