jdk/src/share/classes/sun/font/CMap.java
changeset 3928 be186a33df9b
parent 2 90ce3da70b43
child 5506 202f599c92aa
equal deleted inserted replaced
3927:d717df90e151 3928:be186a33df9b
   230                  * cmap table, these fonts have EncodingID 4 which is Big5
   230                  * cmap table, these fonts have EncodingID 4 which is Big5
   231                  * encoding according the TrueType spec, but actually the
   231                  * encoding according the TrueType spec, but actually the
   232                  * fonts are using gb2312 encoding, have to use this
   232                  * fonts are using gb2312 encoding, have to use this
   233                  * workaround to make Solaris zh_CN locale work.  -sherman
   233                  * workaround to make Solaris zh_CN locale work.  -sherman
   234                  */
   234                  */
   235                 if (FontManager.isSolaris && font.platName != null &&
   235                 if (FontUtilities.isSolaris && font.platName != null &&
   236                     (font.platName.startsWith(
   236                     (font.platName.startsWith(
   237                      "/usr/openwin/lib/locale/zh_CN.EUC/X11/fonts/TrueType") ||
   237                      "/usr/openwin/lib/locale/zh_CN.EUC/X11/fonts/TrueType") ||
   238                      font.platName.startsWith(
   238                      font.platName.startsWith(
   239                      "/usr/openwin/lib/locale/zh_CN/X11/fonts/TrueType") ||
   239                      "/usr/openwin/lib/locale/zh_CN/X11/fonts/TrueType") ||
   240                      font.platName.startsWith(
   240                      font.platName.startsWith(
   405             subtableLength = buffer.getChar(offset+2);
   405             subtableLength = buffer.getChar(offset+2);
   406         } else {
   406         } else {
   407             subtableLength = buffer.getInt(offset+4) & INTMASK;
   407             subtableLength = buffer.getInt(offset+4) & INTMASK;
   408         }
   408         }
   409         if (offset+subtableLength > buffer.capacity()) {
   409         if (offset+subtableLength > buffer.capacity()) {
   410             if (FontManager.logging) {
   410             if (FontUtilities.isLogging()) {
   411                 FontManager.logger.warning("Cmap subtable overflows buffer.");
   411                 FontUtilities.getLogger().warning("Cmap subtable overflows buffer.");
   412             }
   412             }
   413         }
   413         }
   414         switch (subtableFormat) {
   414         switch (subtableFormat) {
   415         case 0:  return new CMapFormat0(buffer, offset);
   415         case 0:  return new CMapFormat0(buffer, offset);
   416         case 2:  return new CMapFormat2(buffer, offset, xlat);
   416         case 2:  return new CMapFormat2(buffer, offset, xlat);