1 31 package org.pdfbox.ttf; 32 33 import java.io.IOException ; 34 import java.util.Calendar ; 35 36 42 public class HeaderTable extends TTFTable 43 { 44 47 public static final String TAG = "head"; 48 49 private float version; 50 private float fontRevision; 51 private long checkSumAdjustment; 52 private long magicNumber; 53 private int flags; 54 private int unitsPerEm; 55 private Calendar created; 56 private Calendar modified; 57 private short xMin; 58 private short yMin; 59 private short xMax; 60 private short yMax; 61 private int macStyle; 62 private int lowestRecPPEM; 63 private short fontDirectionHint; 64 private short indexToLocFormat; 65 private short glyphDataFormat; 66 67 74 public void initData( TrueTypeFont ttf, TTFDataStream data ) throws IOException 75 { 76 version = data.read32Fixed(); 77 fontRevision = data.read32Fixed(); 78 checkSumAdjustment = data.readUnsignedInt(); 79 magicNumber = data.readUnsignedInt(); 80 flags = data.readUnsignedShort(); 81 unitsPerEm = data.readUnsignedShort(); 82 created = data.readInternationalDate(); 83 modified = data.readInternationalDate(); 84 xMin = data.readSignedShort(); 85 yMin = data.readSignedShort(); 86 xMax = data.readSignedShort(); 87 yMax = data.readSignedShort(); 88 macStyle = data.readUnsignedShort(); 89 lowestRecPPEM = data.readUnsignedShort(); 90 fontDirectionHint = data.readSignedShort(); 91 indexToLocFormat = data.readSignedShort(); 92 glyphDataFormat = data.readSignedShort(); 93 } 94 97 public long getCheckSumAdjustment() 98 { 99 return checkSumAdjustment; 100 } 101 104 public void setCheckSumAdjustment(long checkSumAdjustmentValue) 105 { 106 this.checkSumAdjustment = checkSumAdjustmentValue; 107 } 108 111 public Calendar getCreated() 112 { 113 return created; 114 } 115 118 public void setCreated(Calendar createdValue) 119 { 120 this.created = createdValue; 121 } 122 125 public int getFlags() 126 { 127 return flags; 128 } 129 132 public void setFlags(int flagsValue) 133 { 134 this.flags = flagsValue; 135 } 136 139 public short getFontDirectionHint() 140 { 141 return fontDirectionHint; 142 } 143 146 public void setFontDirectionHint(short fontDirectionHintValue) 147 { 148 this.fontDirectionHint = fontDirectionHintValue; 149 } 150 153 public float getFontRevision() 154 { 155 return fontRevision; 156 } 157 160 public void setFontRevision(float fontRevisionValue) 161 { 162 this.fontRevision = fontRevisionValue; 163 } 164 167 public short getGlyphDataFormat() 168 { 169 return glyphDataFormat; 170 } 171 174 public void setGlyphDataFormat(short glyphDataFormatValue) 175 { 176 this.glyphDataFormat = glyphDataFormatValue; 177 } 178 181 public short getIndexToLocFormat() 182 { 183 return indexToLocFormat; 184 } 185 188 public void setIndexToLocFormat(short indexToLocFormatValue) 189 { 190 this.indexToLocFormat = indexToLocFormatValue; 191 } 192 195 public int getLowestRecPPEM() 196 { 197 return lowestRecPPEM; 198 } 199 202 public void setLowestRecPPEM(int lowestRecPPEMValue) 203 { 204 this.lowestRecPPEM = lowestRecPPEMValue; 205 } 206 209 public int getMacStyle() 210 { 211 return macStyle; 212 } 213 216 public void setMacStyle(int macStyleValue) 217 { 218 this.macStyle = macStyleValue; 219 } 220 223 public long getMagicNumber() 224 { 225 return magicNumber; 226 } 227 230 public void setMagicNumber(long magicNumberValue) 231 { 232 this.magicNumber = magicNumberValue; 233 } 234 237 public Calendar getModified() 238 { 239 return modified; 240 } 241 244 public void setModified(Calendar modifiedValue) 245 { 246 this.modified = modifiedValue; 247 } 248 251 public int getUnitsPerEm() 252 { 253 return unitsPerEm; 254 } 255 258 public void setUnitsPerEm(int unitsPerEmValue) 259 { 260 this.unitsPerEm = unitsPerEmValue; 261 } 262 265 public float getVersion() 266 { 267 return version; 268 } 269 272 public void setVersion(float versionValue) 273 { 274 this.version = versionValue; 275 } 276 279 public short getXMax() 280 { 281 return xMax; 282 } 283 286 public void setXMax(short maxValue) 287 { 288 xMax = maxValue; 289 } 290 293 public short getXMin() 294 { 295 return xMin; 296 } 297 300 public void setXMin(short minValue) 301 { 302 xMin = minValue; 303 } 304 307 public short getYMax() 308 { 309 return yMax; 310 } 311 314 public void setYMax(short maxValue) 315 { 316 yMax = maxValue; 317 } 318 321 public short getYMin() 322 { 323 return yMin; 324 } 325 328 public void setYMin(short minValue) 329 { 330 yMin = minValue; 331 } 332 } 333 | Popular Tags |