001 /*
002 * Copyright 1997-1999 Sun Microsystems, Inc. All Rights Reserved.
003 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
004 *
005 * This code is free software; you can redistribute it and/or modify it
006 * under the terms of the GNU General Public License version 2 only, as
007 * published by the Free Software Foundation. Sun designates this
008 * particular file as subject to the "Classpath" exception as provided
009 * by Sun in the LICENSE file that accompanied this code.
010 *
011 * This code is distributed in the hope that it will be useful, but WITHOUT
012 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
013 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
014 * version 2 for more details (a copy is included in the LICENSE file that
015 * accompanied this code).
016 *
017 * You should have received a copy of the GNU General Public License version
018 * 2 along with this work; if not, write to the Free Software Foundation,
019 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
020 *
021 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
022 * CA 95054 USA or visit www.sun.com if you need additional information or
023 * have any questions.
024 */
025
026 package java.awt.font;
027
028 /**
029 * The <code>OpenType</code> interface represents OpenType and
030 * TrueType fonts. This interface makes it possible to obtain
031 * <i>sfnt</i> tables from the font. A particular
032 * <code>Font</code> object can implement this interface.
033 * <p>
034 * For more information on TrueType fonts, see the
035 * Apple TrueType Reference Manual
036 * ( <a href="http://fonts.apple.com/TTRefMan/index.html">http://fonts.apple.com/TTRefMan/index.html</a> ).
037 * @version 10 Feb 1997
038 */
039 public interface OpenType {
040
041 /* 51 tag types so far */
042
043 /**
044 * Character to glyph mapping. Table tag "cmap" in the Open
045 * Type Specification.
046 */
047 public final static int TAG_CMAP = 0x636d6170;
048
049 /**
050 * Font header. Table tag "head" in the Open
051 * Type Specification.
052 */
053 public final static int TAG_HEAD = 0x68656164;
054
055 /**
056 * Naming table. Table tag "name" in the Open
057 * Type Specification.
058 */
059 public final static int TAG_NAME = 0x6e616d65;
060
061 /**
062 * Glyph data. Table tag "glyf" in the Open
063 * Type Specification.
064 */
065 public final static int TAG_GLYF = 0x676c7966;
066
067 /**
068 * Maximum profile. Table tag "maxp" in the Open
069 * Type Specification.
070 */
071 public final static int TAG_MAXP = 0x6d617870;
072
073 /**
074 * CVT preprogram. Table tag "prep" in the Open
075 * Type Specification.
076 */
077 public final static int TAG_PREP = 0x70726570;
078
079 /**
080 * Horizontal metrics. Table tag "hmtx" in the Open
081 * Type Specification.
082 */
083 public final static int TAG_HMTX = 0x686d7478;
084
085 /**
086 * Kerning. Table tag "kern" in the Open
087 * Type Specification.
088 */
089 public final static int TAG_KERN = 0x6b65726e;
090
091 /**
092 * Horizontal device metrics. Table tag "hdmx" in the Open
093 * Type Specification.
094 */
095 public final static int TAG_HDMX = 0x68646d78;
096
097 /**
098 * Index to location. Table tag "loca" in the Open
099 * Type Specification.
100 */
101 public final static int TAG_LOCA = 0x6c6f6361;
102
103 /**
104 * PostScript Information. Table tag "post" in the Open
105 * Type Specification.
106 */
107 public final static int TAG_POST = 0x706f7374;
108
109 /**
110 * OS/2 and Windows specific metrics. Table tag "OS/2"
111 * in the Open Type Specification.
112 */
113 public final static int TAG_OS2 = 0x4f532f32;
114
115 /**
116 * Control value table. Table tag "cvt "
117 * in the Open Type Specification.
118 */
119 public final static int TAG_CVT = 0x63767420;
120
121 /**
122 * Grid-fitting and scan conversion procedure. Table tag
123 * "gasp" in the Open Type Specification.
124 */
125 public final static int TAG_GASP = 0x67617370;
126
127 /**
128 * Vertical device metrics. Table tag "VDMX" in the Open
129 * Type Specification.
130 */
131 public final static int TAG_VDMX = 0x56444d58;
132
133 /**
134 * Vertical metrics. Table tag "vmtx" in the Open
135 * Type Specification.
136 */
137 public final static int TAG_VMTX = 0x766d7478;
138
139 /**
140 * Vertical metrics header. Table tag "vhea" in the Open
141 * Type Specification.
142 */
143 public final static int TAG_VHEA = 0x76686561;
144
145 /**
146 * Horizontal metrics header. Table tag "hhea" in the Open
147 * Type Specification.
148 */
149 public final static int TAG_HHEA = 0x68686561;
150
151 /**
152 * Adobe Type 1 font data. Table tag "typ1" in the Open
153 * Type Specification.
154 */
155 public final static int TAG_TYP1 = 0x74797031;
156
157 /**
158 * Baseline table. Table tag "bsln" in the Open
159 * Type Specification.
160 */
161 public final static int TAG_BSLN = 0x62736c6e;
162
163 /**
164 * Glyph substitution. Table tag "GSUB" in the Open
165 * Type Specification.
166 */
167 public final static int TAG_GSUB = 0x47535542;
168
169 /**
170 * Digital signature. Table tag "DSIG" in the Open
171 * Type Specification.
172 */
173 public final static int TAG_DSIG = 0x44534947;
174
175 /**
176 * Font program. Table tag "fpgm" in the Open
177 * Type Specification.
178 */
179 public final static int TAG_FPGM = 0x6670676d;
180
181 /**
182 * Font variation. Table tag "fvar" in the Open
183 * Type Specification.
184 */
185 public final static int TAG_FVAR = 0x66766172;
186
187 /**
188 * Glyph variation. Table tag "gvar" in the Open
189 * Type Specification.
190 */
191 public final static int TAG_GVAR = 0x67766172;
192
193 /**
194 * Compact font format (Type1 font). Table tag
195 * "CFF " in the Open Type Specification.
196 */
197 public final static int TAG_CFF = 0x43464620;
198
199 /**
200 * Multiple master supplementary data. Table tag
201 * "MMSD" in the Open Type Specification.
202 */
203 public final static int TAG_MMSD = 0x4d4d5344;
204
205 /**
206 * Multiple master font metrics. Table tag
207 * "MMFX" in the Open Type Specification.
208 */
209 public final static int TAG_MMFX = 0x4d4d4658;
210
211 /**
212 * Baseline data. Table tag "BASE" in the Open
213 * Type Specification.
214 */
215 public final static int TAG_BASE = 0x42415345;
216
217 /**
218 * Glyph definition. Table tag "GDEF" in the Open
219 * Type Specification.
220 */
221 public final static int TAG_GDEF = 0x47444546;
222
223 /**
224 * Glyph positioning. Table tag "GPOS" in the Open
225 * Type Specification.
226 */
227 public final static int TAG_GPOS = 0x47504f53;
228
229 /**
230 * Justification. Table tag "JSTF" in the Open
231 * Type Specification.
232 */
233 public final static int TAG_JSTF = 0x4a535446;
234
235 /**
236 * Embedded bitmap data. Table tag "EBDT" in the Open
237 * Type Specification.
238 */
239 public final static int TAG_EBDT = 0x45424454;
240
241 /**
242 * Embedded bitmap location. Table tag "EBLC" in the Open
243 * Type Specification.
244 */
245 public final static int TAG_EBLC = 0x45424c43;
246
247 /**
248 * Embedded bitmap scaling. Table tag "EBSC" in the Open
249 * Type Specification.
250 */
251 public final static int TAG_EBSC = 0x45425343;
252
253 /**
254 * Linear threshold. Table tag "LTSH" in the Open
255 * Type Specification.
256 */
257 public final static int TAG_LTSH = 0x4c545348;
258
259 /**
260 * PCL 5 data. Table tag "PCLT" in the Open
261 * Type Specification.
262 */
263 public final static int TAG_PCLT = 0x50434c54;
264
265 /**
266 * Accent attachment. Table tag "acnt" in the Open
267 * Type Specification.
268 */
269 public final static int TAG_ACNT = 0x61636e74;
270
271 /**
272 * Axis variaiton. Table tag "avar" in the Open
273 * Type Specification.
274 */
275 public final static int TAG_AVAR = 0x61766172;
276
277 /**
278 * Bitmap data. Table tag "bdat" in the Open
279 * Type Specification.
280 */
281 public final static int TAG_BDAT = 0x62646174;
282
283 /**
284 * Bitmap location. Table tag "bloc" in the Open
285 * Type Specification.
286 */
287 public final static int TAG_BLOC = 0x626c6f63;
288
289 /**
290 * CVT variation. Table tag "cvar" in the Open
291 * Type Specification.
292 */
293 public final static int TAG_CVAR = 0x63766172;
294
295 /**
296 * Feature name. Table tag "feat" in the Open
297 * Type Specification.
298 */
299 public final static int TAG_FEAT = 0x66656174;
300
301 /**
302 * Font descriptors. Table tag "fdsc" in the Open
303 * Type Specification.
304 */
305 public final static int TAG_FDSC = 0x66647363;
306
307 /**
308 * Font metrics. Table tag "fmtx" in the Open
309 * Type Specification.
310 */
311 public final static int TAG_FMTX = 0x666d7478;
312
313 /**
314 * Justification. Table tag "just" in the Open
315 * Type Specification.
316 */
317 public final static int TAG_JUST = 0x6a757374;
318
319 /**
320 * Ligature caret. Table tag "lcar" in the Open
321 * Type Specification.
322 */
323 public final static int TAG_LCAR = 0x6c636172;
324
325 /**
326 * Glyph metamorphosis. Table tag "mort" in the Open
327 * Type Specification.
328 */
329 public final static int TAG_MORT = 0x6d6f7274;
330
331 /**
332 * Optical bounds. Table tag "opbd" in the Open
333 * Type Specification.
334 */
335 public final static int TAG_OPBD = 0x6d6f7274;
336
337 /**
338 * Glyph properties. Table tag "prop" in the Open
339 * Type Specification.
340 */
341 public final static int TAG_PROP = 0x70726f70;
342
343 /**
344 * Tracking. Table tag "trak" in the Open
345 * Type Specification.
346 */
347 public final static int TAG_TRAK = 0x7472616b;
348
349 /**
350 * Returns the version of the <code>OpenType</code> font.
351 * 1.0 is represented as 0x00010000.
352 * @return the version of the <code>OpenType</code> font.
353 */
354 public int getVersion();
355
356 /**
357 * Returns the table as an array of bytes for a specified tag.
358 * Tags for sfnt tables include items like <i>cmap</i>,
359 * <i>name</i> and <i>head</i>. The <code>byte</code> array
360 * returned is a copy of the font data in memory.
361 * @param sfntTag a four-character code as a 32-bit integer
362 * @return a <code>byte</code> array that is the table that
363 * contains the font data corresponding to the specified
364 * tag.
365 */
366 public byte[] getFontTable(int sfntTag);
367
368 /**
369 * Returns the table as an array of bytes for a specified tag.
370 * Tags for sfnt tables include items like <i>cmap</i>,
371 * <i>name</i> and <i>head</i>. The byte array returned is a
372 * copy of the font data in memory.
373 * @param strSfntTag a four-character code as a
374 * <code>String</code>
375 * @return a <code>byte</code> array that is the table that
376 * contains the font data corresponding to the specified
377 * tag.
378 */
379 public byte[] getFontTable(String strSfntTag);
380
381 /**
382 * Returns a subset of the table as an array of bytes
383 * for a specified tag. Tags for sfnt tables include
384 * items like <i>cmap</i>, <i>name</i> and <i>head</i>.
385 * The byte array returned is a copy of the font data in
386 * memory.
387 * @param sfntTag a four-character code as a 32-bit integer
388 * @param offset index of first byte to return from table
389 * @param count number of bytes to return from table
390 * @return a subset of the table corresponding to
391 * <code>sfntTag</code> and containing the bytes
392 * starting at <code>offset</code> byte and including
393 * <code>count</code> bytes.
394 */
395 public byte[] getFontTable(int sfntTag, int offset, int count);
396
397 /**
398 * Returns a subset of the table as an array of bytes
399 * for a specified tag. Tags for sfnt tables include items
400 * like <i>cmap</i>, <i>name</i> and <i>head</i>. The
401 * <code>byte</code> array returned is a copy of the font
402 * data in memory.
403 * @param strSfntTag a four-character code as a
404 * <code>String</code>
405 * @param offset index of first byte to return from table
406 * @param count number of bytes to return from table
407 * @return a subset of the table corresponding to
408 * <code>strSfntTag</code> and containing the bytes
409 * starting at <code>offset</code> byte and including
410 * <code>count</code> bytes.
411 */
412 public byte[] getFontTable(String strSfntTag, int offset, int count);
413
414 /**
415 * Returns the size of the table for a specified tag. Tags for sfnt
416 * tables include items like <i>cmap</i>, <i>name</i> and <i>head</i>.
417 * @param sfntTag a four-character code as a 32-bit integer
418 * @return the size of the table corresponding to the specified
419 * tag.
420 */
421 public int getFontTableSize(int sfntTag);
422
423 /**
424 * Returns the size of the table for a specified tag. Tags for sfnt
425 * tables include items like <i>cmap</i>, <i>name</i> and <i>head</i>.
426 * @param strSfntTag a four-character code as a
427 * <code>String</code>
428 * @return the size of the table corresponding to the specified tag.
429 */
430 public int getFontTableSize(String strSfntTag);
431
432 }
|