1 18 package org.apache.batik.svggen.font.table; 19 20 import java.io.IOException ; 21 import java.io.RandomAccessFile ; 22 23 28 public abstract class KernSubtable { 29 30 31 protected KernSubtable() { 32 } 33 34 public abstract int getKerningPairCount(); 35 36 public abstract KerningPair getKerningPair(int i); 37 38 public static KernSubtable read(RandomAccessFile raf) throws IOException { 39 KernSubtable table = null; 40 raf.readUnsignedShort(); 41 raf.readUnsignedShort(); 42 int coverage = raf.readUnsignedShort(); 43 int format = coverage >> 8; 44 45 switch (format) { 46 case 0: 47 table = new KernSubtableFormat0(raf); 48 break; 49 case 2: 50 table = new KernSubtableFormat2(raf); 51 break; 52 default: 53 break; 54 } 55 return table; 56 } 57 58 } 59 | Popular Tags |