1 17 18 19 20 package org.apache.fop.render.afp.fonts; 21 22 23 42 public class CharacterSetOrientation { 43 44 47 private String _codePage; 48 49 52 private String _encoding; 53 54 57 private int _ascender; 58 59 62 private int _descender; 63 64 67 private int _capHeight; 68 69 72 private int[] _characters = new int[256]; 73 74 77 private int _xHeight; 78 79 82 private int _firstCharacter; 83 84 87 private int _lastCharacter; 88 89 90 93 private int _orientation = 0; 94 95 100 public CharacterSetOrientation(int orientation) { 101 102 _orientation = orientation; 103 104 } 105 106 118 public int getAscender() { 119 return _ascender; 120 } 121 122 128 public int getCapHeight() { 129 return _capHeight; 130 } 131 132 138 public int getDescender() { 139 return _descender; 140 } 141 142 146 public int getFirstChar() { 147 return _firstCharacter; 148 } 149 150 154 public int getLastChar() { 155 return _lastCharacter; 156 } 157 158 162 public int getOrientation() { 163 return _orientation; 164 } 165 166 171 public int[] getWidths() { 172 173 int arr[] = new int[(getLastChar() - getFirstChar()) + 1]; 174 System.arraycopy(_characters, getFirstChar(), arr, 0, (getLastChar() - getFirstChar()) + 1); 175 return arr; 176 177 } 178 179 184 public int getXHeight() { 185 return _xHeight; 186 } 187 188 194 public int width(int character) { 195 return _characters[character]; 196 } 197 198 210 public void setAscender(int ascender) { 211 _ascender = ascender; 212 } 213 214 220 public void setCapHeight(int capHeight) { 221 _capHeight = capHeight; 222 } 223 224 230 public void setDescender(int descender) { 231 _descender = descender; 232 } 233 234 238 public void setFirstChar(int firstCharacter) { 239 _firstCharacter = firstCharacter; 240 } 241 242 246 public void setLastChar(int lastCharacter) { 247 _lastCharacter = lastCharacter; 248 } 249 250 256 public void setWidth(int character, int width) { 257 258 if (character >= _characters.length) { 259 int arr[] = new int[(character - _firstCharacter) + 1]; 261 System.arraycopy(_characters, 0, arr, 0, _characters.length); 262 _characters = arr; 263 } 264 _characters[character] = width; 265 266 } 267 268 273 public void setXHeight(int xHeight) { 274 _xHeight = xHeight; 275 } 276 } 277 | Popular Tags |