1 18 19 package org.apache.batik.gvt.flow; 20 21 import org.apache.batik.gvt.font.GVTGlyphVector; 22 23 31 class GlyphGroupInfo { 32 int start, end; 33 int glyphCount, lastGlyphCount; 34 boolean hideLast; 35 float advance, lastAdvance; 36 int range; 37 GVTGlyphVector gv; 38 boolean [] hide; 39 40 public GlyphGroupInfo(GVTGlyphVector gv, 41 int start, 42 int end, 43 boolean [] glyphHide, 44 boolean glyphGroupHideLast, 45 float [] glyphPos, 46 float [] advAdj, 47 float [] lastAdvAdj, 48 boolean [] space) { 49 this.gv = gv; 50 this.start = start; 51 this.end = end; 52 this.hide = new boolean[this.end-this.start+1]; 53 this.hideLast = glyphGroupHideLast; 54 System.arraycopy(glyphHide, this.start, this.hide, 0, 55 this.hide.length); 56 57 float adv = glyphPos[2*end+2]-glyphPos[2*start]; 58 float ladv = adv; 59 adv += advAdj[end]; 60 int glyphCount = end-start+1; 61 for (int g=start; g<end; g++) { 62 if (glyphHide[g]) glyphCount--; 63 } 64 int lastGlyphCount = glyphCount; 65 for (int g=end; g>=start; g--) { 66 ladv += lastAdvAdj[g]; 67 if (!space[g]) break; 68 lastGlyphCount--; 69 } 70 if (hideLast) lastGlyphCount--; 71 72 this.glyphCount = glyphCount; 73 this.lastGlyphCount = lastGlyphCount; 74 this.advance = adv; 75 this.lastAdvance = ladv; 76 } 77 78 81 public GVTGlyphVector getGlyphVector() { return gv; } 82 83 84 public int getStart() { return start; } 85 86 public int getEnd() { return end; } 87 88 91 public int getGlyphCount() { return glyphCount; } 92 97 public int getLastGlyphCount() { return lastGlyphCount; } 98 99 public boolean [] getHide() { return hide; } 100 101 103 public boolean getHideLast() { return hideLast; } 104 108 public float getAdvance() { return advance; } 109 116 public float getLastAdvance() { return lastAdvance; } 117 118 public void setRange(int range) { this.range = range; } 119 public int getRange() { return this.range; } 120 } 121 122 | Popular Tags |