1 18 package org.apache.batik.svggen.font.table; 19 20 import java.io.IOException ; 21 import java.io.RandomAccessFile ; 22 23 27 public class HheaTable implements Table { 28 29 private int version; 30 private short ascender; 31 private short descender; 32 private short lineGap; 33 private short advanceWidthMax; 34 private short minLeftSideBearing; 35 private short minRightSideBearing; 36 private short xMaxExtent; 37 private short caretSlopeRise; 38 private short caretSlopeRun; 39 private short metricDataFormat; 40 private short numberOfHMetrics; 41 42 protected HheaTable(DirectoryEntry de,RandomAccessFile raf) throws IOException { 43 raf.seek(de.getOffset()); 44 version = raf.readInt(); 45 ascender = raf.readShort(); 46 descender = raf.readShort(); 47 lineGap = raf.readShort(); 48 advanceWidthMax = raf.readShort(); 49 minLeftSideBearing = raf.readShort(); 50 minRightSideBearing = raf.readShort(); 51 xMaxExtent = raf.readShort(); 52 caretSlopeRise = raf.readShort(); 53 caretSlopeRun = raf.readShort(); 54 for (int i = 0; i < 5; i++) { 55 raf.readShort(); 56 } 57 metricDataFormat = raf.readShort(); 58 numberOfHMetrics = raf.readShort(); 59 } 60 61 public short getAdvanceWidthMax() { 62 return advanceWidthMax; 63 } 64 65 public short getAscender() { 66 return ascender; 67 } 68 69 public short getCaretSlopeRise() { 70 return caretSlopeRise; 71 } 72 73 public short getCaretSlopeRun() { 74 return caretSlopeRun; 75 } 76 77 public short getDescender() { 78 return descender; 79 } 80 81 public short getLineGap() { 82 return lineGap; 83 } 84 85 public short getMetricDataFormat() { 86 return metricDataFormat; 87 } 88 89 public short getMinLeftSideBearing() { 90 return minLeftSideBearing; 91 } 92 93 public short getMinRightSideBearing() { 94 return minRightSideBearing; 95 } 96 97 public short getNumberOfHMetrics() { 98 return numberOfHMetrics; 99 } 100 101 public int getType() { 102 return hhea; 103 } 104 105 public short getXMaxExtent() { 106 return xMaxExtent; 107 } 108 } 109 | Popular Tags |