194 for (int i=0; i<count; i++) {
195 int code = unicodes[i]; // char is unsigned.
196
197 if (code >= HI_SURROGATE_START &&
198 code <= HI_SURROGATE_END && i < count - 1) {
199 char low = unicodes[i + 1];
200
201 if (low >= LO_SURROGATE_START &&
202 low <= LO_SURROGATE_END) {
203 code = (code - HI_SURROGATE_START) *
204 0x400 + low - LO_SURROGATE_START + 0x10000;
205 glyphs[i + 1] = INVISIBLE_GLYPH_ID;
206 }
207 }
208
209 int gc = glyphs[i] = getCachedGlyphCode(code);
210 if (gc == UNINITIALIZED_GLYPH) {
211 glyphs[i] = convertToGlyph(code);
212 }
213
214 if (code < FontManager.MIN_LAYOUT_CHARCODE) {
215 continue;
216 }
217 else if (FontManager.isComplexCharCode(code)) {
218 return true;
219 }
220 else if (code >= 0x10000) {
221 i += 1; // Empty glyph slot after surrogate
222 continue;
223 }
224 }
225
226 return false;
227 }
228
229 /* The conversion is not very efficient - looping as it does, converting
230 * one char at a time. However the cache should fill very rapidly.
231 */
232 public void charsToGlyphs(int count, char[] unicodes, int[] glyphs) {
233 for (int i=0; i<count; i++) {
234 int code = unicodes[i]; // char is unsigned.
235
236 if (code >= HI_SURROGATE_START &&
237 code <= HI_SURROGATE_END && i < count - 1) {
|
194 for (int i=0; i<count; i++) {
195 int code = unicodes[i]; // char is unsigned.
196
197 if (code >= HI_SURROGATE_START &&
198 code <= HI_SURROGATE_END && i < count - 1) {
199 char low = unicodes[i + 1];
200
201 if (low >= LO_SURROGATE_START &&
202 low <= LO_SURROGATE_END) {
203 code = (code - HI_SURROGATE_START) *
204 0x400 + low - LO_SURROGATE_START + 0x10000;
205 glyphs[i + 1] = INVISIBLE_GLYPH_ID;
206 }
207 }
208
209 int gc = glyphs[i] = getCachedGlyphCode(code);
210 if (gc == UNINITIALIZED_GLYPH) {
211 glyphs[i] = convertToGlyph(code);
212 }
213
214 if (code < FontUtilities.MIN_LAYOUT_CHARCODE) {
215 continue;
216 }
217 else if (FontUtilities.isComplexCharCode(code)) {
218 return true;
219 }
220 else if (code >= 0x10000) {
221 i += 1; // Empty glyph slot after surrogate
222 continue;
223 }
224 }
225
226 return false;
227 }
228
229 /* The conversion is not very efficient - looping as it does, converting
230 * one char at a time. However the cache should fill very rapidly.
231 */
232 public void charsToGlyphs(int count, char[] unicodes, int[] glyphs) {
233 for (int i=0; i<count; i++) {
234 int code = unicodes[i]; // char is unsigned.
235
236 if (code >= HI_SURROGATE_START &&
237 code <= HI_SURROGATE_END && i < count - 1) {
|