KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > java > awt > font > OpenType


1 /*
2  * @(#)OpenType.java 1.24 03/12/19
3  *
4  * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
5  * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
6  */

7
8 package java.awt.font;
9
10 /**
11  * The <code>OpenType</code> interface represents OpenType and
12  * TrueType fonts. This interface makes it possible to obtain
13  * <i>sfnt</i> tables from the font. A particular
14  * <code>Font</code> object can implement this interface.
15  * <p>
16  * For more information on TrueType fonts, see the
17  * Apple TrueType Reference Manual
18  * ( <a HREF="http://fonts.apple.com/TTRefMan/index.html">http://fonts.apple.com/TTRefMan/index.html</a> ).
19  * @version 10 Feb 1997
20  */

21 public interface OpenType {
22   
23   /* 51 tag types so far */
24
25   /**
26    * Character to glyph mapping. Table tag "cmap" in the Open
27    * Type Specification.
28    */

29   public final static int TAG_CMAP = 0x636d6170;
30
31   /**
32    * Font header. Table tag "head" in the Open
33    * Type Specification.
34    */

35   public final static int TAG_HEAD = 0x68656164;
36
37   /**
38    * Naming table. Table tag "name" in the Open
39    * Type Specification.
40    */

41   public final static int TAG_NAME = 0x6e616d65;
42
43   /**
44    * Glyph data. Table tag "glyf" in the Open
45    * Type Specification.
46    */

47   public final static int TAG_GLYF = 0x676c7966;
48
49   /**
50    * Maximum profile. Table tag "maxp" in the Open
51    * Type Specification.
52    */

53   public final static int TAG_MAXP = 0x6d617870;
54
55   /**
56    * CVT preprogram. Table tag "prep" in the Open
57    * Type Specification.
58    */

59   public final static int TAG_PREP = 0x70726570;
60
61   /**
62    * Horizontal metrics. Table tag "hmtx" in the Open
63    * Type Specification.
64    */

65   public final static int TAG_HMTX = 0x686d7478;
66
67   /**
68    * Kerning. Table tag "kern" in the Open
69    * Type Specification.
70    */

71   public final static int TAG_KERN = 0x6b65726e;
72
73   /**
74    * Horizontal device metrics. Table tag "hdmx" in the Open
75    * Type Specification.
76    */

77   public final static int TAG_HDMX = 0x68646d78;
78
79   /**
80    * Index to location. Table tag "loca" in the Open
81    * Type Specification.
82    */

83   public final static int TAG_LOCA = 0x6c6f6361;
84
85   /**
86    * PostScript Information. Table tag "post" in the Open
87    * Type Specification.
88    */

89   public final static int TAG_POST = 0x706f7374;
90
91   /**
92    * OS/2 and Windows specific metrics. Table tag "OS/2"
93    * in the Open Type Specification.
94    */

95   public final static int TAG_OS2 = 0x4f532f32;
96
97   /**
98    * Control value table. Table tag "cvt "
99    * in the Open Type Specification.
100    */

101   public final static int TAG_CVT = 0x63767420;
102
103   /**
104    * Grid-fitting and scan conversion procedure. Table tag
105    * "gasp" in the Open Type Specification.
106    */

107   public final static int TAG_GASP = 0x67617370;
108
109   /**
110    * Vertical device metrics. Table tag "VDMX" in the Open
111    * Type Specification.
112    */

113   public final static int TAG_VDMX = 0x56444d58;
114
115   /**
116    * Vertical metrics. Table tag "vmtx" in the Open
117    * Type Specification.
118    */

119   public final static int TAG_VMTX = 0x766d7478;
120
121   /**
122    * Vertical metrics header. Table tag "vhea" in the Open
123    * Type Specification.
124    */

125   public final static int TAG_VHEA = 0x76686561;
126
127   /**
128    * Horizontal metrics header. Table tag "hhea" in the Open
129    * Type Specification.
130    */

131   public final static int TAG_HHEA = 0x68686561;
132
133   /**
134    * Adobe Type 1 font data. Table tag "typ1" in the Open
135    * Type Specification.
136    */

137   public final static int TAG_TYP1 = 0x74797031;
138
139   /**
140    * Baseline table. Table tag "bsln" in the Open
141    * Type Specification.
142    */

143   public final static int TAG_BSLN = 0x62736c6e;
144
145   /**
146    * Glyph substitution. Table tag "GSUB" in the Open
147    * Type Specification.
148    */

149   public final static int TAG_GSUB = 0x47535542;
150
151   /**
152    * Digital signature. Table tag "DSIG" in the Open
153    * Type Specification.
154    */

155   public final static int TAG_DSIG = 0x44534947;
156
157   /**
158    * Font program. Table tag "fpgm" in the Open
159    * Type Specification.
160    */

161   public final static int TAG_FPGM = 0x6670676d;
162
163   /**
164    * Font variation. Table tag "fvar" in the Open
165    * Type Specification.
166    */

167   public final static int TAG_FVAR = 0x66766172;
168
169   /**
170    * Glyph variation. Table tag "gvar" in the Open
171    * Type Specification.
172    */

173   public final static int TAG_GVAR = 0x67766172;
174
175   /**
176    * Compact font format (Type1 font). Table tag
177    * "CFF " in the Open Type Specification.
178    */

179   public final static int TAG_CFF = 0x43464620;
180
181   /**
182    * Multiple master supplementary data. Table tag
183    * "MMSD" in the Open Type Specification.
184    */

185   public final static int TAG_MMSD = 0x4d4d5344;
186
187   /**
188    * Multiple master font metrics. Table tag
189    * "MMFX" in the Open Type Specification.
190    */

191   public final static int TAG_MMFX = 0x4d4d4658;
192
193   /**
194    * Baseline data. Table tag "BASE" in the Open
195    * Type Specification.
196    */

197   public final static int TAG_BASE = 0x42415345;
198
199   /**
200    * Glyph definition. Table tag "GDEF" in the Open
201    * Type Specification.
202    */

203   public final static int TAG_GDEF = 0x47444546;
204
205   /**
206    * Glyph positioning. Table tag "GPOS" in the Open
207    * Type Specification.
208    */

209   public final static int TAG_GPOS = 0x47504f53;
210
211   /**
212    * Justification. Table tag "JSTF" in the Open
213    * Type Specification.
214    */

215   public final static int TAG_JSTF = 0x4a535446;
216
217   /**
218    * Embedded bitmap data. Table tag "EBDT" in the Open
219    * Type Specification.
220    */

221   public final static int TAG_EBDT = 0x45424454;
222
223   /**
224    * Embedded bitmap location. Table tag "EBLC" in the Open
225    * Type Specification.
226    */

227   public final static int TAG_EBLC = 0x45424c43;
228
229   /**
230    * Embedded bitmap scaling. Table tag "EBSC" in the Open
231    * Type Specification.
232    */

233   public final static int TAG_EBSC = 0x45425343;
234
235   /**
236    * Linear threshold. Table tag "LTSH" in the Open
237    * Type Specification.
238    */

239   public final static int TAG_LTSH = 0x4c545348;
240
241   /**
242    * PCL 5 data. Table tag "PCLT" in the Open
243    * Type Specification.
244    */

245   public final static int TAG_PCLT = 0x50434c54;
246
247   /**
248    * Accent attachment. Table tag "acnt" in the Open
249    * Type Specification.
250    */

251   public final static int TAG_ACNT = 0x61636e74;
252
253   /**
254    * Axis variaiton. Table tag "avar" in the Open
255    * Type Specification.
256    */

257   public final static int TAG_AVAR = 0x61766172;
258
259   /**
260    * Bitmap data. Table tag "bdat" in the Open
261    * Type Specification.
262    */

263   public final static int TAG_BDAT = 0x62646174;
264
265   /**
266    * Bitmap location. Table tag "bloc" in the Open
267    * Type Specification.
268    */

269   public final static int TAG_BLOC = 0x626c6f63;
270
271    /**
272     * CVT variation. Table tag "cvar" in the Open
273     * Type Specification.
274     */

275   public final static int TAG_CVAR = 0x63766172;
276
277   /**
278    * Feature name. Table tag "feat" in the Open
279     * Type Specification.
280    */

281   public final static int TAG_FEAT = 0x66656174;
282
283   /**
284    * Font descriptors. Table tag "fdsc" in the Open
285    * Type Specification.
286    */

287   public final static int TAG_FDSC = 0x66647363;
288  
289   /**
290    * Font metrics. Table tag "fmtx" in the Open
291    * Type Specification.
292    */

293   public final static int TAG_FMTX = 0x666d7478;
294
295   /**
296    * Justification. Table tag "just" in the Open
297    * Type Specification.
298    */

299   public final static int TAG_JUST = 0x6a757374;
300
301   /**
302    * Ligature caret. Table tag "lcar" in the Open
303    * Type Specification.
304    */

305   public final static int TAG_LCAR = 0x6c636172;
306
307   /**
308    * Glyph metamorphosis. Table tag "mort" in the Open
309    * Type Specification.
310    */

311   public final static int TAG_MORT = 0x6d6f7274;
312
313   /**
314    * Optical bounds. Table tag "opbd" in the Open
315    * Type Specification.
316    */

317   public final static int TAG_OPBD = 0x6d6f7274;
318
319   /**
320    * Glyph properties. Table tag "prop" in the Open
321    * Type Specification.
322    */

323   public final static int TAG_PROP = 0x70726f70;
324
325   /**
326    * Tracking. Table tag "trak" in the Open
327    * Type Specification.
328    */

329   public final static int TAG_TRAK = 0x7472616b;
330
331   /**
332    * Returns the version of the <code>OpenType</code> font.
333    * 1.0 is represented as 0x00010000.
334    * @return the version of the <code>OpenType</code> font.
335    */

336   public int getVersion();
337
338   /**
339    * Returns the table as an array of bytes for a specified tag.
340    * Tags for sfnt tables include items like <i>cmap</i>,
341    * <i>name</i> and <i>head</i>. The <code>byte</code> array
342    * returned is a copy of the font data in memory.
343    * @param sfntTag a four-character code as a 32-bit integer
344    * @return a <code>byte</code> array that is the table that
345    * contains the font data corresponding to the specified
346    * tag.
347    */

348   public byte[] getFontTable(int sfntTag);
349
350   /**
351    * Returns the table as an array of bytes for a specified tag.
352    * Tags for sfnt tables include items like <i>cmap</i>,
353    * <i>name</i> and <i>head</i>. The byte array returned is a
354    * copy of the font data in memory.
355    * @param strSfntTag a four-character code as a
356    * <code>String</code>
357    * @return a <code>byte</code> array that is the table that
358    * contains the font data corresponding to the specified
359    * tag.
360    */

361   public byte[] getFontTable(String JavaDoc strSfntTag);
362
363   /**
364    * Returns a subset of the table as an array of bytes
365    * for a specified tag. Tags for sfnt tables include
366    * items like <i>cmap</i>, <i>name</i> and <i>head</i>.
367    * The byte array returned is a copy of the font data in
368    * memory.
369    * @param sfntTag a four-character code as a 32-bit integer
370    * @param offset index of first byte to return from table
371    * @param count number of bytes to return from table
372    * @return a subset of the table corresponding to
373    * <code>sfntTag</code> and containing the bytes
374    * starting at <code>offset</code> byte and including
375    * <code>count</code> bytes.
376    */

377   public byte[] getFontTable(int sfntTag, int offset, int count);
378
379   /**
380    * Returns a subset of the table as an array of bytes
381    * for a specified tag. Tags for sfnt tables include items
382    * like <i>cmap</i>, <i>name</i> and <i>head</i>. The
383    * <code>byte</code> array returned is a copy of the font
384    * data in memory.
385    * @param strSfntTag a four-character code as a
386    * <code>String</code>
387    * @param offset index of first byte to return from table
388    * @param count number of bytes to return from table
389    * @return a subset of the table corresponding to
390    * <code>strSfntTag</code> and containing the bytes
391    * starting at <code>offset</code> byte and including
392    * <code>count</code> bytes.
393    */

394   public byte[] getFontTable(String JavaDoc strSfntTag, int offset, int count);
395
396   /**
397    * Returns the size of the table for a specified tag. Tags for sfnt
398    * tables include items like <i>cmap</i>, <i>name</i> and <i>head</i>.
399    * @param sfntTag a four-character code as a 32-bit integer
400    * @return the size of the table corresponding to the specified
401    * tag.
402    */

403   public int getFontTableSize(int sfntTag);
404
405   /**
406    * Returns the size of the table for a specified tag. Tags for sfnt
407    * tables include items like <i>cmap</i>, <i>name</i> and <i>head</i>.
408    * @param strSfntTag a four-character code as a
409    * <code>String</code>
410    * @return the size of the table corresponding to the specified tag.
411    */

412   public int getFontTableSize(String JavaDoc strSfntTag);
413
414
415 }
416
417
Popular Tags