src/share/classes/sun/font/ExtendedTextSourceLabel.java

Print this page




 991             // CJK, Hangul, CJK Compatibility areas
 992           } else if (c >= 0x4e00 &&
 993                      (c < 0xa000) ||
 994                      (c >= 0xac00 && c < 0xd7b0) ||
 995                      (c >= 0xf900 && c < 0xfb00)) {
 996             info = kanjiInfo;
 997           } else {
 998             info = nullInfo;
 999           }
1000         }
1001       }
1002       infos[infoStart + i] = info;
1003     }
1004   }
1005 
1006   public TextLineComponent applyJustificationDeltas(float[] deltas, int deltaStart, boolean[] flags) {
1007 
1008     // when we justify, we need to adjust the charinfo since spaces
1009     // change their advances.  preserve the existing charinfo.
1010 
1011     float[] newCharinfo = (float[])getCharinfo().clone();
1012 
1013     // we only push spaces, so never need to rejustify
1014     flags[0] = false;
1015 
1016     // preserve the existing gv.
1017 
1018     StandardGlyphVector newgv = (StandardGlyphVector)getGV().clone();
1019     float[] newPositions = newgv.getGlyphPositions(null);
1020     int numGlyphs = newgv.getNumGlyphs();
1021 
1022     /*
1023     System.out.println("oldgv: " + getGV() + ", newgv: " + newgv);
1024     System.out.println("newpositions: " + newPositions);
1025     for (int i = 0; i < newPositions.length; i += 2) {
1026       System.out.println("[" + (i/2) + "] " + newPositions[i] + ", " + newPositions[i+1]);
1027     }
1028 
1029     System.out.println("deltas: " + deltas + " start: " + deltaStart);
1030     for (int i = deltaStart; i < deltaStart + numGlyphs; i += 2) {
1031       System.out.println("[" + (i/2) + "] " + deltas[i] + ", " + deltas[i+1]);




 991             // CJK, Hangul, CJK Compatibility areas
 992           } else if (c >= 0x4e00 &&
 993                      (c < 0xa000) ||
 994                      (c >= 0xac00 && c < 0xd7b0) ||
 995                      (c >= 0xf900 && c < 0xfb00)) {
 996             info = kanjiInfo;
 997           } else {
 998             info = nullInfo;
 999           }
1000         }
1001       }
1002       infos[infoStart + i] = info;
1003     }
1004   }
1005 
1006   public TextLineComponent applyJustificationDeltas(float[] deltas, int deltaStart, boolean[] flags) {
1007 
1008     // when we justify, we need to adjust the charinfo since spaces
1009     // change their advances.  preserve the existing charinfo.
1010 
1011     float[] newCharinfo = getCharinfo().clone();
1012 
1013     // we only push spaces, so never need to rejustify
1014     flags[0] = false;
1015 
1016     // preserve the existing gv.
1017 
1018     StandardGlyphVector newgv = (StandardGlyphVector)getGV().clone();
1019     float[] newPositions = newgv.getGlyphPositions(null);
1020     int numGlyphs = newgv.getNumGlyphs();
1021 
1022     /*
1023     System.out.println("oldgv: " + getGV() + ", newgv: " + newgv);
1024     System.out.println("newpositions: " + newPositions);
1025     for (int i = 0; i < newPositions.length; i += 2) {
1026       System.out.println("[" + (i/2) + "] " + newPositions[i] + ", " + newPositions[i+1]);
1027     }
1028 
1029     System.out.println("deltas: " + deltas + " start: " + deltaStart);
1030     for (int i = deltaStart; i < deltaStart + numGlyphs; i += 2) {
1031       System.out.println("[" + (i/2) + "] " + deltas[i] + ", " + deltas[i+1]);