1 31 package org.pdfbox.ttf; 32 33 import java.util.Collection ; 34 import java.util.HashMap ; 35 import java.util.Map ; 36 37 import java.io.IOException ; 38 39 import org.pdfbox.cos.COSStream; 40 41 47 public class TrueTypeFont 48 { 49 private float version; 50 51 private Map tables = new HashMap (); 52 53 private TTFDataStream data; 54 55 60 TrueTypeFont( TTFDataStream fontData ) 61 { 62 data = fontData; 63 } 64 65 70 public void close() throws IOException 71 { 72 data.close(); 73 } 74 75 78 public float getVersion() 79 { 80 return version; 81 } 82 85 public void setVersion(float versionValue) 86 { 87 version = versionValue; 88 } 89 90 95 public void addTable( TTFTable table ) 96 { 97 tables.put( table.getTag(), table ); 98 } 99 100 105 public Collection getTables() 106 { 107 return tables.values(); 108 } 109 110 115 public NamingTable getNaming() 116 { 117 return (NamingTable)tables.get( NamingTable.TAG ); 118 } 119 120 125 public PostScriptTable getPostScript() 126 { 127 return (PostScriptTable)tables.get( PostScriptTable.TAG ); 128 } 129 130 135 public OS2WindowsMetricsTable getOS2Windows() 136 { 137 return (OS2WindowsMetricsTable)tables.get( OS2WindowsMetricsTable.TAG ); 138 } 139 140 145 public MaximumProfileTable getMaximumProfile() 146 { 147 return (MaximumProfileTable)tables.get( MaximumProfileTable.TAG ); 148 } 149 150 155 public HeaderTable getHeader() 156 { 157 return (HeaderTable)tables.get( HeaderTable.TAG ); 158 } 159 160 165 public HorizontalHeaderTable getHorizontalHeader() 166 { 167 return (HorizontalHeaderTable)tables.get( HorizontalHeaderTable.TAG ); 168 } 169 170 175 public HorizontalMetricsTable getHorizontalMetrics() 176 { 177 return (HorizontalMetricsTable)tables.get( HorizontalMetricsTable.TAG ); 178 } 179 180 185 public IndexToLocationTable getIndexToLocation() 186 { 187 return (IndexToLocationTable)tables.get( IndexToLocationTable.TAG ); 188 } 189 190 195 public GlyphTable getGlyph() 196 { 197 return (GlyphTable)tables.get( GlyphTable.TAG ); 198 } 199 200 205 public CMAPTable getCMAP() 206 { 207 return (CMAPTable)tables.get( CMAPTable.TAG ); 208 } 209 210 217 public COSStream getCOSStream() 218 { 219 return data.getCOSStream(); 220 } 221 } 222 | Popular Tags |