jdk/src/java.desktop/share/classes/sun/font/CompositeGlyphMapper.java
changeset 26037 508779ce6619
parent 26004 7507a1b93f67
parent 25859 3317bb8137f4
child 34399 7ea60f3aab93
equal deleted inserted replaced
25992:e9b05e933ddd 26037:508779ce6619
    65          */
    65          */
    66         hasExcludes = compFont.exclusionRanges != null &&
    66         hasExcludes = compFont.exclusionRanges != null &&
    67                       compFont.maxIndices != null;
    67                       compFont.maxIndices != null;
    68     }
    68     }
    69 
    69 
    70     public final int compositeGlyphCode(int slot, int glyphCode) {
    70     public int compositeGlyphCode(int slot, int glyphCode) {
    71         return (slot << 24 | (glyphCode & GLYPHMASK));
    71         return (slot << 24 | (glyphCode & GLYPHMASK));
    72     }
    72     }
    73 
    73 
    74     private final void initMapper() {
    74     private void initMapper() {
    75         if (missingGlyph == CharToGlyphMapper.UNINITIALIZED_GLYPH) {
    75         if (missingGlyph == CharToGlyphMapper.UNINITIALIZED_GLYPH) {
    76             if (glyphMaps == null) {
    76             if (glyphMaps == null) {
    77                 glyphMaps = new int[NBLOCKS][];
    77                 glyphMaps = new int[NBLOCKS][];
    78             }
    78             }
    79             slotMappers = new CharToGlyphMapper[font.numSlots];
    79             slotMappers = new CharToGlyphMapper[font.numSlots];
   106             }
   106             }
   107         }
   107         }
   108         glyphMaps[index0][unicode & 0xff] = glyphCode;
   108         glyphMaps[index0][unicode & 0xff] = glyphCode;
   109     }
   109     }
   110 
   110 
   111     private final CharToGlyphMapper getSlotMapper(int slot) {
   111     private CharToGlyphMapper getSlotMapper(int slot) {
   112         CharToGlyphMapper mapper = slotMappers[slot];
   112         CharToGlyphMapper mapper = slotMappers[slot];
   113         if (mapper == null) {
   113         if (mapper == null) {
   114             mapper = font.getSlotFont(slot).getMapper();
   114             mapper = font.getSlotFont(slot).getMapper();
   115             slotMappers[slot] = mapper;
   115             slotMappers[slot] = mapper;
   116         }
   116         }
   117         return mapper;
   117         return mapper;
   118     }
   118     }
   119 
   119 
   120     private final int convertToGlyph(int unicode) {
   120     private int convertToGlyph(int unicode) {
   121 
   121 
   122         for (int slot = 0; slot < font.numSlots; slot++) {
   122         for (int slot = 0; slot < font.numSlots; slot++) {
   123             if (!hasExcludes || !font.isExcludedChar(slot, unicode)) {
   123             if (!hasExcludes || !font.isExcludedChar(slot, unicode)) {
   124                 CharToGlyphMapper mapper = getSlotMapper(slot);
   124                 CharToGlyphMapper mapper = getSlotMapper(slot);
   125                 int glyphCode = mapper.charToGlyph(unicode);
   125                 int glyphCode = mapper.charToGlyph(unicode);