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 Lookup { 29 30 public static final int IGNORE_BASE_GLYPHS = 0x0002; 32 public static final int IGNORE_BASE_LIGATURES = 0x0004; 33 public static final int IGNORE_BASE_MARKS = 0x0008; 34 public static final int MARK_ATTACHMENT_TYPE = 0xFF00; 35 36 private int type; 37 private int flag; 38 private int subTableCount; 39 private int[] subTableOffsets; 40 private LookupSubtable[] subTables; 41 42 43 public Lookup(LookupSubtableFactory factory, RandomAccessFile raf, int offset) 44 throws IOException { 45 raf.seek(offset); 46 type = raf.readUnsignedShort(); 47 flag = raf.readUnsignedShort(); 48 subTableCount = raf.readUnsignedShort(); 49 subTableOffsets = new int[subTableCount]; 50 subTables = new LookupSubtable[subTableCount]; 51 for (int i = 0; i < subTableCount; i++) { 52 subTableOffsets[i] = raf.readUnsignedShort(); 53 } 54 for (int i = 0; i < subTableCount; i++) { 55 subTables[i] = factory.read(type, raf, offset + subTableOffsets[i]); 56 } 57 } 58 59 public int getType() { 60 return type; 61 } 62 63 public int getSubtableCount() { 64 return subTableCount; 65 } 66 67 public LookupSubtable getSubtable(int i) { 68 return subTables[i]; 69 } 70 71 } 72 73 | Popular Tags |