1065 lines · 40.8 KB · Java
RawDownload
             power = 1 << highBit;            extra = numGroups - power;        }         char getGlyph(int charCode) {            int controlGlyph = getControlCodeGlyph(charCode, false);            if (controlGlyph >= 0) {                return (char)controlGlyph;            }            int probe = power;            int range = 0;             if (startCharCode[extra] <= charCode) {                range = extra;            }             while (probe > 1) {                probe >>= 1;                 if (startCharCode[range+probe] <= charCode) {                    range += probe;                }            }             if (startCharCode[range] <= charCode &&                  endCharCode[range] >= charCode) {                return (char)                    (startGlyphID[range] + (charCode - startCharCode[range]));            }             return 0;        }     }     /* Used to substitute for bad Cmaps. */    static class NullCMapClass extends CMap {         char getGlyph(int charCode) {            return 0;        }    }     public static final NullCMapClass theNullCmap = new NullCMapClass();     final int getControlCodeGlyph(int charCode, boolean noSurrogates) {        if (charCode < 0x0010) {            switch (charCode) {            case 0x0009:            case 0x000a:            case 0x000d: return CharToGlyphMapper.INVISIBLE_GLYPH_ID;            }        } else if (charCode >= 0x200c) {            if ((charCode <= 0x200f) ||                (charCode >= 0x2028 && charCode <= 0x202e) ||                (charCode >= 0x206a && charCode <= 0x206f)) {                return CharToGlyphMapper.INVISIBLE_GLYPH_ID;            } else if (noSurrogates && charCode >= 0xFFFF) {                return 0;            }        }        return -1;    }}

Lines 1001–1065 of 1065. Previous lines