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 Ligature { 29 30 private int ligGlyph; 31 private int compCount; 32 private int[] components; 33 34 35 public Ligature(RandomAccessFile raf) throws IOException { 36 ligGlyph = raf.readUnsignedShort(); 37 compCount = raf.readUnsignedShort(); 38 components = new int[compCount - 1]; 39 for (int i = 0; i < compCount - 1; i++) { 40 components[i] = raf.readUnsignedShort(); 41 } 42 } 43 44 public int getGlyphCount() { 45 return compCount; 46 } 47 48 public int getGlyphId(int i) { 49 return (i == 0) ? ligGlyph : components[i-1]; 50 } 51 52 } 53 | Popular Tags |