1 31 package org.pdfbox.ttf; 32 33 import java.io.IOException ; 34 35 41 public class GlyphTable extends TTFTable 42 { 43 46 public static final String TAG = "glyf"; 47 48 private GlyphData[] glyphs; 49 50 57 public void initData( TrueTypeFont ttf, TTFDataStream data ) throws IOException 58 { 59 MaximumProfileTable maxp = ttf.getMaximumProfile(); 60 IndexToLocationTable loc = ttf.getIndexToLocation(); 61 PostScriptTable post = ttf.getPostScript(); 62 long[] offsets = loc.getOffsets(); 63 int numGlyphs = maxp.getNumGlyphs(); 64 glyphs = new GlyphData[numGlyphs]; 65 String [] glyphNames = post.getGlyphNames(); 66 for( int i=0; i<numGlyphs-1; i++ ) 67 { 68 GlyphData glyph = new GlyphData(); 69 data.seek( getOffset() + offsets[i] ); 70 glyph.initData( ttf, data ); 71 glyphs[i] = glyph; 72 } 73 } 74 77 public GlyphData[] getGlyphs() 78 { 79 return glyphs; 80 } 81 84 public void setGlyphs(GlyphData[] glyphsValue) 85 { 86 this.glyphs = glyphsValue; 87 } 88 } 89 | Popular Tags |