1 31 package org.pdfbox.ttf; 32 33 import java.io.IOException ; 34 35 41 public class HorizontalHeaderTable extends TTFTable 42 { 43 46 public static final String TAG = "hhea"; 47 48 private float version; 49 private short ascender; 50 private short descender; 51 private short lineGap; 52 private int advanceWidthMax; 53 private short minLeftSideBearing; 54 private short minRightSideBearing; 55 private short xMaxExtent; 56 private short caretSlopeRise; 57 private short caretSlopeRun; 58 private short reserved1; 59 private short reserved2; 60 private short reserved3; 61 private short reserved4; 62 private short reserved5; 63 private short metricDataFormat; 64 private int numberOfHMetrics; 65 66 73 public void initData( TrueTypeFont ttf, TTFDataStream data ) throws IOException 74 { 75 version = data.read32Fixed(); 76 ascender = data.readSignedShort(); 77 descender = data.readSignedShort(); 78 lineGap = data.readSignedShort(); 79 advanceWidthMax = data.readUnsignedShort(); 80 minLeftSideBearing = data.readSignedShort(); 81 minRightSideBearing = data.readSignedShort(); 82 xMaxExtent = data.readSignedShort(); 83 caretSlopeRise = data.readSignedShort(); 84 caretSlopeRun = data.readSignedShort(); 85 reserved1 = data.readSignedShort(); 86 reserved2 = data.readSignedShort(); 87 reserved3 = data.readSignedShort(); 88 reserved4 = data.readSignedShort(); 89 reserved5 = data.readSignedShort(); 90 metricDataFormat = data.readSignedShort(); 91 numberOfHMetrics = data.readUnsignedShort(); 92 } 93 94 97 public int getAdvanceWidthMax() 98 { 99 return advanceWidthMax; 100 } 101 104 public void setAdvanceWidthMax(int advanceWidthMaxValue) 105 { 106 this.advanceWidthMax = advanceWidthMaxValue; 107 } 108 111 public short getAscender() 112 { 113 return ascender; 114 } 115 118 public void setAscender(short ascenderValue) 119 { 120 this.ascender = ascenderValue; 121 } 122 125 public short getCaretSlopeRise() 126 { 127 return caretSlopeRise; 128 } 129 132 public void setCaretSlopeRise(short caretSlopeRiseValue) 133 { 134 this.caretSlopeRise = caretSlopeRiseValue; 135 } 136 139 public short getCaretSlopeRun() 140 { 141 return caretSlopeRun; 142 } 143 146 public void setCaretSlopeRun(short caretSlopeRunValue) 147 { 148 this.caretSlopeRun = caretSlopeRunValue; 149 } 150 153 public short getDescender() 154 { 155 return descender; 156 } 157 160 public void setDescender(short descenderValue) 161 { 162 this.descender = descenderValue; 163 } 164 167 public short getLineGap() 168 { 169 return lineGap; 170 } 171 174 public void setLineGap(short lineGapValue) 175 { 176 this.lineGap = lineGapValue; 177 } 178 181 public short getMetricDataFormat() 182 { 183 return metricDataFormat; 184 } 185 188 public void setMetricDataFormat(short metricDataFormatValue) 189 { 190 this.metricDataFormat = metricDataFormatValue; 191 } 192 195 public short getMinLeftSideBearing() 196 { 197 return minLeftSideBearing; 198 } 199 202 public void setMinLeftSideBearing(short minLeftSideBearingValue) 203 { 204 this.minLeftSideBearing = minLeftSideBearingValue; 205 } 206 209 public short getMinRightSideBearing() 210 { 211 return minRightSideBearing; 212 } 213 216 public void setMinRightSideBearing(short minRightSideBearingValue) 217 { 218 this.minRightSideBearing = minRightSideBearingValue; 219 } 220 223 public int getNumberOfHMetrics() 224 { 225 return numberOfHMetrics; 226 } 227 230 public void setNumberOfHMetrics(int numberOfHMetricsValue) 231 { 232 this.numberOfHMetrics = numberOfHMetricsValue; 233 } 234 237 public short getReserved1() 238 { 239 return reserved1; 240 } 241 244 public void setReserved1(short reserved1Value) 245 { 246 this.reserved1 = reserved1Value; 247 } 248 251 public short getReserved2() 252 { 253 return reserved2; 254 } 255 258 public void setReserved2(short reserved2Value) 259 { 260 this.reserved2 = reserved2Value; 261 } 262 265 public short getReserved3() 266 { 267 return reserved3; 268 } 269 272 public void setReserved3(short reserved3Value) 273 { 274 this.reserved3 = reserved3Value; 275 } 276 279 public short getReserved4() 280 { 281 return reserved4; 282 } 283 286 public void setReserved4(short reserved4Value) 287 { 288 this.reserved4 = reserved4Value; 289 } 290 293 public short getReserved5() 294 { 295 return reserved5; 296 } 297 300 public void setReserved5(short reserved5Value) 301 { 302 this.reserved5 = reserved5Value; 303 } 304 307 public float getVersion() 308 { 309 return version; 310 } 311 314 public void setVersion(float versionValue) 315 { 316 this.version = versionValue; 317 } 318 321 public short getXMaxExtent() 322 { 323 return xMaxExtent; 324 } 325 328 public void setXMaxExtent(short maxExtentValue) 329 { 330 xMaxExtent = maxExtentValue; 331 } 332 } 333 | Popular Tags |