1 17 18 19 20 package org.apache.fop.render.afp.fonts; 21 22 28 public class OutlineFont extends AFPFont { 29 30 31 private CharacterSet _characterSet = null; 32 33 41 public OutlineFont(String name, CharacterSet characterSet) { 42 super(name); 43 _characterSet = characterSet; 44 } 45 46 51 public CharacterSet getCharacterSet() { 52 53 return _characterSet; 54 55 } 56 57 62 public CharacterSet getCharacterSet(int size) { 63 64 return _characterSet; 65 66 } 67 68 71 public int getFirstChar() { 72 73 return _characterSet.getFirstChar(); 74 75 } 76 77 80 public int getLastChar() { 81 82 return _characterSet.getLastChar(); 83 84 } 85 86 94 public int getAscender(int size) { 95 96 return _characterSet.getAscender() / 1000 * size; 97 98 } 99 100 106 public int getCapHeight(int size) { 107 108 return _characterSet.getCapHeight() / 1000 * size; 109 110 } 111 112 120 public int getDescender(int size) { 121 122 return _characterSet.getDescender() / 1000 * size; 123 124 } 125 126 132 public int getXHeight(int size) { 133 134 return _characterSet.getXHeight() / 1000 * size; 135 136 } 137 138 141 public int getWidth(int character, int size) { 142 143 return _characterSet.width(character) / 1000 * size; 144 145 } 146 147 155 public int[] getWidths(int size) { 156 157 int[] widths = _characterSet.getWidths(); 158 for (int i = 0; i < widths.length; i++) { 159 widths[i] = widths[i] / 1000 * size; 160 } 161 return widths; 162 163 } 164 165 171 public int[] getWidths() { 172 173 return getWidths(1000); 174 175 } 176 177 182 public char mapChar(char c) { 183 return _characterSet.mapChar(c); 184 } 185 186 190 public String getEncoding() { 191 return _characterSet.getEncoding(); 192 } 193 194 } | Popular Tags |