/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
}
public int getNumGlyphs() {
if (numGlyphs == -1) {
}
return numGlyphs;
}
return glyph != missingGlyph;
}
return glyph != missingGlyph;
}
{
// The following shaping checks are from either
// TrueTypeGlyphMapper or Type1GlyphMapper
for (int i = 0; i < count; i++) {
}
}
if (code < 0x0590) {
continue;
} else if (code <= 0x05ff) {
// Hebrew 0x0590->0x05ff
return true;
// Arabic
return true;
// if Indic, assume shaping for conjuncts, reordering:
// 0900 - 097F Devanagari
// 0980 - 09FF Bengali
// 0A00 - 0A7F Gurmukhi
// 0A80 - 0AFF Gujarati
// 0B00 - 0B7F Oriya
// 0B80 - 0BFF Tamil
// 0C00 - 0C7F Telugu
// 0C80 - 0CFF Kannada
// 0D00 - 0D7F Malayalam
return true;
// if Thai, assume shaping for vowel, tone marks
return true;
// zwj or zwnj
return true;
// directional control
return true;
// directional control
return true;
} else if (code >= 0x10000) {
i += 1; // Empty glyph slot after surrogate
continue;
}
}
return false;
}
final char[] unicodeArray = new char[] { unicode };
final int[] glyphArray = new int[1];
return glyphArray[0];
}
if (unicode >= 0x10000) {
int[] glyphs = new int[2];
char[] surrogates = new char[2];
return glyphs[0];
} else
return charToGlyph((char)unicode);
}
}
for (int i = 0; i < count; i++) {
};
}
// This mapper returns either the glyph code, or if the character can be
// replaced on-the-fly using CoreText substitution; the negative unicode
// value. If this "glyph code int" is treated as an opaque code, it will
// strike and measure exactly as a real glyph code - whether the character
// is present or not. Missing characters for any font on the system will
// be returned as 0, as the getMissingGlyphCode() function above indicates.
int[] glyphs);
private class Cache {
Cache() {
// <rdar://problem/5331678> need to prevent getting '-1' stuck in the cache
}
if (index < FIRST_LAYER_SIZE) {
// catch common glyphcodes
return firstLayerCache[index];
}
if (index < SECOND_LAYER_SIZE) {
// catch common unicodes
}
}
if (index < FIRST_LAYER_SIZE) {
// catch common glyphcodes
return;
}
if (index < SECOND_LAYER_SIZE) {
// catch common unicodes
if (secondLayerCache == null) {
}
return;
}
if (generalCache == null) {
}
}
private class SparseBitShiftingTwoLayerArray {
final int[][] cache;
final int shift;
final int secondLayerLength;
final int shift)
{
}
}
if (firstLayerRow == null) {
}
}
}
{
// "missed" is the count of 'char' that are not mapped.
// Surrogates count for 2.
// unmappedChars is the unique list of these chars.
// unmappedCharIndices is the location in the original array
int missed = 0;
char[] unmappedChars = null;
int [] unmappedCharIndices = null;
for (int i = 0; i < count; i++){
if (code >= HI_SURROGATE_START &&
{
}
}
if (code >= 0x10000) {
i++;
}
} else {
values[i] = 0;
if (unmappedChars == null) {
// This is likely to be longer than we need,
// but is the simplest and cheapest option.
}
unmappedCharIndices[missed] = i;
}
missed++;
}
}
if (missed == 0) {
return;
}
final int[] glyphCodes = new int[missed];
// bulk call to fill in the unmapped code points.
for (int m = 0; m < missed; m++){
int i = unmappedCharIndices[m];
int code = unmappedChars[m];
if (code >= HI_SURROGATE_START &&
{
}
}
values[i] = glyphCodes[m];
if (code >= 0x10000) {
m++;
}
}
}
}
}