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 LookupList { 29 30 private int lookupCount; 31 private int[] lookupOffsets; 32 private Lookup[] lookups; 33 34 35 public LookupList(RandomAccessFile raf, int offset, LookupSubtableFactory factory) 36 throws IOException { 37 raf.seek(offset); 38 lookupCount = raf.readUnsignedShort(); 39 lookupOffsets = new int[lookupCount]; 40 lookups = new Lookup[lookupCount]; 41 for (int i = 0; i < lookupCount; i++) { 42 lookupOffsets[i] = raf.readUnsignedShort(); 43 } 44 for (int i = 0; i < lookupCount; i++) { 45 lookups[i] = new Lookup(factory, raf, offset + lookupOffsets[i]); 46 } 47 } 48 49 public Lookup getLookup(Feature feature, int index) { 50 if (feature.getLookupCount() > index) { 51 int i = feature.getLookupListIndex(index); 52 return lookups[i]; 53 } 54 return null; 55 } 56 57 } 58 59 | Popular Tags |