1 17 18 19 20 package org.apache.fop.fonts.truetype; 21 22 import java.io.IOException ; 23 import java.io.UnsupportedEncodingException ; 24 25 26 29 class TTFDirTabEntry { 30 31 private byte[] tag = new byte[4]; 32 private int checksum; 33 private long offset; 34 private long length; 35 36 39 public String read(FontFileReader in) throws IOException { 40 tag[0] = in.readTTFByte(); 41 tag[1] = in.readTTFByte(); 42 tag[2] = in.readTTFByte(); 43 tag[3] = in.readTTFByte(); 44 45 in.skip(4); 47 offset = in.readTTFULong(); 48 length = in.readTTFULong(); 49 String tagStr = new String (tag, "ISO-8859-1"); 50 51 return tagStr; 52 } 53 54 55 public String toString() { 56 return "Read dir tab [" 57 + tag[0] + " " + tag[1] + " " + tag[2] + " " + tag[3] + "]" 58 + " offset: " + offset 59 + " length: " + length 60 + " name: " + tag; 61 } 62 63 67 public int getChecksum() { 68 return checksum; 69 } 70 71 75 public long getLength() { 76 return length; 77 } 78 79 83 public long getOffset() { 84 return offset; 85 } 86 87 91 public byte[] getTag() { 92 return tag; 93 } 94 95 99 public String getTagString() { 100 try { 101 return new String (tag, "ISO-8859-1"); 102 } catch (UnsupportedEncodingException e) { 103 return this.toString(); } 105 } 106 107 } 108 | Popular Tags |