1 18 package org.apache.batik.svggen.font.table; 19 20 import java.io.IOException ; 21 import java.io.RandomAccessFile ; 22 23 28 public class GsubTable implements Table, LookupSubtableFactory { 29 30 private ScriptList scriptList; 31 private FeatureList featureList; 32 private LookupList lookupList; 33 34 protected GsubTable(DirectoryEntry de, RandomAccessFile raf) throws IOException { 35 raf.seek(de.getOffset()); 36 37 raf.readInt(); 39 int scriptListOffset = raf.readUnsignedShort(); 40 int featureListOffset = raf.readUnsignedShort(); 41 int lookupListOffset = raf.readUnsignedShort(); 42 43 scriptList = new ScriptList(raf, de.getOffset() + scriptListOffset); 45 46 featureList = new FeatureList(raf, de.getOffset() + featureListOffset); 48 49 lookupList = new LookupList(raf, de.getOffset() + lookupListOffset, this); 51 } 52 53 61 public LookupSubtable read(int type, RandomAccessFile raf, int offset) 62 throws IOException { 63 LookupSubtable s = null; 64 switch (type) { 65 case 1: 66 s = SingleSubst.read(raf, offset); 67 break; 68 case 2: 69 break; 71 case 3: 72 break; 74 case 4: 75 s = LigatureSubst.read(raf, offset); 76 break; 77 case 5: 78 break; 80 case 6: 81 break; 83 } 84 return s; 85 } 86 87 90 public int getType() { 91 return GSUB; 92 } 93 94 public ScriptList getScriptList() { 95 return scriptList; 96 } 97 98 public FeatureList getFeatureList() { 99 return featureList; 100 } 101 102 public LookupList getLookupList() { 103 return lookupList; 104 } 105 106 public String toString() { 107 return "GSUB"; 108 } 109 110 } 111 | Popular Tags |