|
17 | 17 | package com.mta.tehreer.internal.layout; |
18 | 18 |
|
19 | 19 | import com.mta.tehreer.graphics.Typeface; |
| 20 | +import com.mta.tehreer.internal.util.Clusters; |
20 | 21 | import com.mta.tehreer.sfnt.WritingDirection; |
21 | 22 |
|
22 | 23 | public class IntrinsicRun { |
@@ -108,28 +109,17 @@ public int glyphCount() { |
108 | 109 | return glyphIds.length; |
109 | 110 | } |
110 | 111 |
|
111 | | - public int charGlyphStart(int charIndex) { |
112 | | - return clusterMap[charIndex - charStart]; |
| 112 | + public void loadGlyphRange(int startIndex, int endIndex, int[] glyphRange) { |
| 113 | + Clusters.loadGlyphRange(clusterMap, startIndex - charStart, endIndex - charStart, |
| 114 | + isBackward, glyphIds.length, glyphRange); |
113 | 115 | } |
114 | 116 |
|
115 | | - public int charGlyphEnd(int charIndex) { |
116 | | - int glyphEnd; |
117 | | - |
118 | | - if (!isBackward) { |
119 | | - int charNext = charIndex + 1; |
120 | | - |
121 | | - glyphEnd = (charNext < charEnd |
122 | | - ? clusterMap[charNext - charStart] |
123 | | - : glyphCount()); |
124 | | - } else { |
125 | | - int charPrevious = charIndex - 1; |
126 | | - |
127 | | - glyphEnd = (charPrevious > charStart |
128 | | - ? clusterMap[charPrevious - charStart] |
129 | | - : glyphCount()); |
130 | | - } |
| 117 | + public int clusterStart(int charIndex) { |
| 118 | + return Clusters.actualClusterStart(clusterMap, charIndex - charStart) + charStart; |
| 119 | + } |
131 | 120 |
|
132 | | - return glyphEnd; |
| 121 | + public int clusterEnd(int charIndex) { |
| 122 | + return Clusters.actualClusterEnd(clusterMap, charIndex - charStart) + charStart; |
133 | 123 | } |
134 | 124 |
|
135 | 125 | public float measureGlyphs(int glyphStart, int glyphEnd) { |
|
0 commit comments