1 /***************************************************************************** 2 * Copyright (C) The Apache Software Foundation. All rights reserved. * 3 * ------------------------------------------------------------------------- * 4 * This software is published under the terms of the Apache Software License * 5 * version 1.1, a copy of which has been included with this distribution in * 6 * the LICENSE file. * 7 *****************************************************************************/ 8 9 package jogamp.graph.font.typecast.ot.table; 10 11 import java.io.DataInput; 12 import java.io.IOException; 13 14 /** 15 * 16 * @author <a href="mailto:davidsch@dev.java.net">David Schweinsberg</a> 17 * @version $Id: KernSubtableFormat0.java,v 1.1.1.1 2004-12-05 23:14:48 davidsch Exp $ 18 */ 19 public class KernSubtableFormat0 extends KernSubtable { 20 21 private final int nPairs; 22 private final int searchRange; 23 private final int entrySelector; 24 private final int rangeShift; 25 private final KerningPair[] kerningPairs; 26 27 /** Creates new KernSubtableFormat0 */ KernSubtableFormat0(final DataInput di)28 protected KernSubtableFormat0(final DataInput di) throws IOException { 29 nPairs = di.readUnsignedShort(); 30 searchRange = di.readUnsignedShort(); 31 entrySelector = di.readUnsignedShort(); 32 rangeShift = di.readUnsignedShort(); 33 kerningPairs = new KerningPair[nPairs]; 34 for (int i = 0; i < nPairs; i++) { 35 kerningPairs[i] = new KerningPair(di); 36 } 37 } 38 39 @Override getKerningPairCount()40 public int getKerningPairCount() { 41 return nPairs; 42 } 43 44 @Override getKerningPair(final int i)45 public KerningPair getKerningPair(final int i) { 46 return kerningPairs[i]; 47 } 48 49 } 50