< prev index next >

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

Print this page




 762         charInfo[cp + posx] = cposl;
 763         charInfo[cp + posy] = baseline;
 764         charInfo[cp + advx] = cposr - cposl;
 765         charInfo[cp + advy] = 0;
 766         charInfo[cp + visx] = cvisl;
 767         charInfo[cp + visy] = cvist;
 768         charInfo[cp + visw] = cvisr - cvisl;
 769         charInfo[cp + vish] = cvisb - cvist;
 770         cc++;
 771 
 772         /* We may have consumed multiple glyphs for this char position.
 773          * Map those extra consumed glyphs to char positions that would follow
 774          * up to the index prior to that which begins the next cluster.
 775          * If we have reached the last glyph (reached gxlimit) then we need to
 776          * map remaining unmapped chars to the same location as the last one.
 777          */
 778         int tgt;
 779         if (gx == gxlimit) {
 780            tgt = charInfo.length / numvals;
 781         } else {
 782            tgt = indices[gx]-1;
 783         }
 784         if (DEBUG) {
 785            System.err.println("gx=" + gx + " gxlimit=" + gxlimit +
 786                               " charInfo.len=" + charInfo.length +
 787                               " tgt=" + tgt + " cc=" + cc + " cp=" + cp);
 788         }
 789         while (cc < tgt) {
 790             if (rtl) {
 791                 // if rtl, characters to left of base, else to right.  reuse cposr.
 792                 cposr = cposl;
 793             }
 794             cvisr -= cvisl; // reuse, convert to deltas.
 795             cvisb -= cvist;
 796 
 797             cp += pdelta;
 798 
 799             if (cp < 0 || cp >= charInfo.length) {
 800                 if (DEBUG)  {
 801                     System.err.println("Error : cp=" + cp +
 802                                        " charInfo.length=" + charInfo.length);




 762         charInfo[cp + posx] = cposl;
 763         charInfo[cp + posy] = baseline;
 764         charInfo[cp + advx] = cposr - cposl;
 765         charInfo[cp + advy] = 0;
 766         charInfo[cp + visx] = cvisl;
 767         charInfo[cp + visy] = cvist;
 768         charInfo[cp + visw] = cvisr - cvisl;
 769         charInfo[cp + vish] = cvisb - cvist;
 770         cc++;
 771 
 772         /* We may have consumed multiple glyphs for this char position.
 773          * Map those extra consumed glyphs to char positions that would follow
 774          * up to the index prior to that which begins the next cluster.
 775          * If we have reached the last glyph (reached gxlimit) then we need to
 776          * map remaining unmapped chars to the same location as the last one.
 777          */
 778         int tgt;
 779         if (gx == gxlimit) {
 780            tgt = charInfo.length / numvals;
 781         } else {
 782            tgt = indices[gx];
 783         }
 784         if (DEBUG) {
 785            System.err.println("gx=" + gx + " gxlimit=" + gxlimit +
 786                               " charInfo.len=" + charInfo.length +
 787                               " tgt=" + tgt + " cc=" + cc + " cp=" + cp);
 788         }
 789         while (cc < tgt) {
 790             if (rtl) {
 791                 // if rtl, characters to left of base, else to right.  reuse cposr.
 792                 cposr = cposl;
 793             }
 794             cvisr -= cvisl; // reuse, convert to deltas.
 795             cvisb -= cvist;
 796 
 797             cp += pdelta;
 798 
 799             if (cp < 0 || cp >= charInfo.length) {
 800                 if (DEBUG)  {
 801                     System.err.println("Error : cp=" + cp +
 802                                        " charInfo.length=" + charInfo.length);


< prev index next >