911 FontDescriptor[] descriptors = new FontDescriptor[names.length];
912
913 for (int i = 0; i < names.length; i++) {
914 String awtFontName;
915 String encoding;
916
917 awtFontName = makeAWTFontName(names[i], sequence[i]);
918
919 // look up character encoding
920 encoding = getEncoding(names[i], sequence[i]);
921 if (encoding == null) {
922 encoding = "default";
923 }
924 CharsetEncoder enc
925 = getFontCharsetEncoder(encoding.trim(), awtFontName);
926
927 // we already have the exclusion ranges
928 int[] exclusionRanges = fontExclusionRanges[i];
929
930 // create descriptor
931 descriptors[i] = new FontDescriptor(awtFontName, enc, exclusionRanges);
932 }
933 return descriptors;
934 }
935
936 /**
937 * Returns the AWT font name for the given platform font name and
938 * character subset.
939 */
940 protected String makeAWTFontName(String platformFontName,
941 String characterSubsetName) {
942 return platformFontName;
943 }
944
945 /**
946 * Returns the java.io name of the platform character encoding for the
947 * given AWT font name and character subset. May return "default"
948 * to indicate that getDefaultFontCharset should be called to obtain
949 * a charset encoder.
950 */
951 protected abstract String getEncoding(String awtFontName,
|
911 FontDescriptor[] descriptors = new FontDescriptor[names.length];
912
913 for (int i = 0; i < names.length; i++) {
914 String awtFontName;
915 String encoding;
916
917 awtFontName = makeAWTFontName(names[i], sequence[i]);
918
919 // look up character encoding
920 encoding = getEncoding(names[i], sequence[i]);
921 if (encoding == null) {
922 encoding = "default";
923 }
924 CharsetEncoder enc
925 = getFontCharsetEncoder(encoding.trim(), awtFontName);
926
927 // we already have the exclusion ranges
928 int[] exclusionRanges = fontExclusionRanges[i];
929
930 // create descriptor
931 descriptors[i] = new FontDescriptor(awtFontName, enc, exclusionRanges, encoding.equals("default"));
932 }
933 return descriptors;
934 }
935
936 /**
937 * Returns the AWT font name for the given platform font name and
938 * character subset.
939 */
940 protected String makeAWTFontName(String platformFontName,
941 String characterSubsetName) {
942 return platformFontName;
943 }
944
945 /**
946 * Returns the java.io name of the platform character encoding for the
947 * given AWT font name and character subset. May return "default"
948 * to indicate that getDefaultFontCharset should be called to obtain
949 * a charset encoder.
950 */
951 protected abstract String getEncoding(String awtFontName,
|