0N/A/*
2362N/A * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved.
0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
0N/A *
0N/A * This code is free software; you can redistribute it and/or modify it
0N/A * under the terms of the GNU General Public License version 2 only, as
2362N/A * published by the Free Software Foundation. Oracle designates this
0N/A * particular file as subject to the "Classpath" exception as provided
2362N/A * by Oracle in the LICENSE file that accompanied this code.
0N/A *
0N/A * This code is distributed in the hope that it will be useful, but WITHOUT
0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
0N/A * version 2 for more details (a copy is included in the LICENSE file that
0N/A * accompanied this code).
0N/A *
0N/A * You should have received a copy of the GNU General Public License version
0N/A * 2 along with this work; if not, write to the Free Software Foundation,
0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
0N/A *
2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
2362N/A * or visit www.oracle.com if you need additional information or have any
2362N/A * questions.
0N/A */
0N/A
0N/Apackage java.awt.font;
0N/A
0N/A/**
0N/A * The <code>OpenType</code> interface represents OpenType and
0N/A * TrueType fonts. This interface makes it possible to obtain
0N/A * <i>sfnt</i> tables from the font. A particular
0N/A * <code>Font</code> object can implement this interface.
0N/A * <p>
288N/A * For more information on TrueType and OpenType fonts, see the
288N/A * OpenType specification.
288N/A * ( <a href=http://www.microsoft.com/typography/otspec/">http://www.microsoft.com/typography/otspec/l</a> ).
0N/A */
0N/Apublic interface OpenType {
0N/A
0N/A /* 51 tag types so far */
0N/A
0N/A /**
0N/A * Character to glyph mapping. Table tag "cmap" in the Open
0N/A * Type Specification.
0N/A */
0N/A public final static int TAG_CMAP = 0x636d6170;
0N/A
0N/A /**
0N/A * Font header. Table tag "head" in the Open
0N/A * Type Specification.
0N/A */
0N/A public final static int TAG_HEAD = 0x68656164;
0N/A
0N/A /**
0N/A * Naming table. Table tag "name" in the Open
0N/A * Type Specification.
0N/A */
0N/A public final static int TAG_NAME = 0x6e616d65;
0N/A
0N/A /**
0N/A * Glyph data. Table tag "glyf" in the Open
0N/A * Type Specification.
0N/A */
0N/A public final static int TAG_GLYF = 0x676c7966;
0N/A
0N/A /**
0N/A * Maximum profile. Table tag "maxp" in the Open
0N/A * Type Specification.
0N/A */
0N/A public final static int TAG_MAXP = 0x6d617870;
0N/A
0N/A /**
0N/A * CVT preprogram. Table tag "prep" in the Open
0N/A * Type Specification.
0N/A */
0N/A public final static int TAG_PREP = 0x70726570;
0N/A
0N/A /**
0N/A * Horizontal metrics. Table tag "hmtx" in the Open
0N/A * Type Specification.
0N/A */
0N/A public final static int TAG_HMTX = 0x686d7478;
0N/A
0N/A /**
0N/A * Kerning. Table tag "kern" in the Open
0N/A * Type Specification.
0N/A */
0N/A public final static int TAG_KERN = 0x6b65726e;
0N/A
0N/A /**
0N/A * Horizontal device metrics. Table tag "hdmx" in the Open
0N/A * Type Specification.
0N/A */
0N/A public final static int TAG_HDMX = 0x68646d78;
0N/A
0N/A /**
0N/A * Index to location. Table tag "loca" in the Open
0N/A * Type Specification.
0N/A */
0N/A public final static int TAG_LOCA = 0x6c6f6361;
0N/A
0N/A /**
0N/A * PostScript Information. Table tag "post" in the Open
0N/A * Type Specification.
0N/A */
0N/A public final static int TAG_POST = 0x706f7374;
0N/A
0N/A /**
0N/A * OS/2 and Windows specific metrics. Table tag "OS/2"
0N/A * in the Open Type Specification.
0N/A */
0N/A public final static int TAG_OS2 = 0x4f532f32;
0N/A
0N/A /**
0N/A * Control value table. Table tag "cvt "
0N/A * in the Open Type Specification.
0N/A */
0N/A public final static int TAG_CVT = 0x63767420;
0N/A
0N/A /**
0N/A * Grid-fitting and scan conversion procedure. Table tag
0N/A * "gasp" in the Open Type Specification.
0N/A */
0N/A public final static int TAG_GASP = 0x67617370;
0N/A
0N/A /**
0N/A * Vertical device metrics. Table tag "VDMX" in the Open
0N/A * Type Specification.
0N/A */
0N/A public final static int TAG_VDMX = 0x56444d58;
0N/A
0N/A /**
0N/A * Vertical metrics. Table tag "vmtx" in the Open
0N/A * Type Specification.
0N/A */
0N/A public final static int TAG_VMTX = 0x766d7478;
0N/A
0N/A /**
0N/A * Vertical metrics header. Table tag "vhea" in the Open
0N/A * Type Specification.
0N/A */
0N/A public final static int TAG_VHEA = 0x76686561;
0N/A
0N/A /**
0N/A * Horizontal metrics header. Table tag "hhea" in the Open
0N/A * Type Specification.
0N/A */
0N/A public final static int TAG_HHEA = 0x68686561;
0N/A
0N/A /**
0N/A * Adobe Type 1 font data. Table tag "typ1" in the Open
0N/A * Type Specification.
0N/A */
0N/A public final static int TAG_TYP1 = 0x74797031;
0N/A
0N/A /**
0N/A * Baseline table. Table tag "bsln" in the Open
0N/A * Type Specification.
0N/A */
0N/A public final static int TAG_BSLN = 0x62736c6e;
0N/A
0N/A /**
0N/A * Glyph substitution. Table tag "GSUB" in the Open
0N/A * Type Specification.
0N/A */
0N/A public final static int TAG_GSUB = 0x47535542;
0N/A
0N/A /**
0N/A * Digital signature. Table tag "DSIG" in the Open
0N/A * Type Specification.
0N/A */
0N/A public final static int TAG_DSIG = 0x44534947;
0N/A
0N/A /**
0N/A * Font program. Table tag "fpgm" in the Open
0N/A * Type Specification.
0N/A */
0N/A public final static int TAG_FPGM = 0x6670676d;
0N/A
0N/A /**
0N/A * Font variation. Table tag "fvar" in the Open
0N/A * Type Specification.
0N/A */
0N/A public final static int TAG_FVAR = 0x66766172;
0N/A
0N/A /**
0N/A * Glyph variation. Table tag "gvar" in the Open
0N/A * Type Specification.
0N/A */
0N/A public final static int TAG_GVAR = 0x67766172;
0N/A
0N/A /**
0N/A * Compact font format (Type1 font). Table tag
0N/A * "CFF " in the Open Type Specification.
0N/A */
0N/A public final static int TAG_CFF = 0x43464620;
0N/A
0N/A /**
0N/A * Multiple master supplementary data. Table tag
0N/A * "MMSD" in the Open Type Specification.
0N/A */
0N/A public final static int TAG_MMSD = 0x4d4d5344;
0N/A
0N/A /**
0N/A * Multiple master font metrics. Table tag
0N/A * "MMFX" in the Open Type Specification.
0N/A */
0N/A public final static int TAG_MMFX = 0x4d4d4658;
0N/A
0N/A /**
0N/A * Baseline data. Table tag "BASE" in the Open
0N/A * Type Specification.
0N/A */
0N/A public final static int TAG_BASE = 0x42415345;
0N/A
0N/A /**
0N/A * Glyph definition. Table tag "GDEF" in the Open
0N/A * Type Specification.
0N/A */
0N/A public final static int TAG_GDEF = 0x47444546;
0N/A
0N/A /**
0N/A * Glyph positioning. Table tag "GPOS" in the Open
0N/A * Type Specification.
0N/A */
0N/A public final static int TAG_GPOS = 0x47504f53;
0N/A
0N/A /**
0N/A * Justification. Table tag "JSTF" in the Open
0N/A * Type Specification.
0N/A */
0N/A public final static int TAG_JSTF = 0x4a535446;
0N/A
0N/A /**
0N/A * Embedded bitmap data. Table tag "EBDT" in the Open
0N/A * Type Specification.
0N/A */
0N/A public final static int TAG_EBDT = 0x45424454;
0N/A
0N/A /**
0N/A * Embedded bitmap location. Table tag "EBLC" in the Open
0N/A * Type Specification.
0N/A */
0N/A public final static int TAG_EBLC = 0x45424c43;
0N/A
0N/A /**
0N/A * Embedded bitmap scaling. Table tag "EBSC" in the Open
0N/A * Type Specification.
0N/A */
0N/A public final static int TAG_EBSC = 0x45425343;
0N/A
0N/A /**
0N/A * Linear threshold. Table tag "LTSH" in the Open
0N/A * Type Specification.
0N/A */
0N/A public final static int TAG_LTSH = 0x4c545348;
0N/A
0N/A /**
0N/A * PCL 5 data. Table tag "PCLT" in the Open
0N/A * Type Specification.
0N/A */
0N/A public final static int TAG_PCLT = 0x50434c54;
0N/A
0N/A /**
0N/A * Accent attachment. Table tag "acnt" in the Open
0N/A * Type Specification.
0N/A */
0N/A public final static int TAG_ACNT = 0x61636e74;
0N/A
0N/A /**
0N/A * Axis variaiton. Table tag "avar" in the Open
0N/A * Type Specification.
0N/A */
0N/A public final static int TAG_AVAR = 0x61766172;
0N/A
0N/A /**
0N/A * Bitmap data. Table tag "bdat" in the Open
0N/A * Type Specification.
0N/A */
0N/A public final static int TAG_BDAT = 0x62646174;
0N/A
0N/A /**
0N/A * Bitmap location. Table tag "bloc" in the Open
0N/A * Type Specification.
0N/A */
0N/A public final static int TAG_BLOC = 0x626c6f63;
0N/A
0N/A /**
0N/A * CVT variation. Table tag "cvar" in the Open
0N/A * Type Specification.
0N/A */
0N/A public final static int TAG_CVAR = 0x63766172;
0N/A
0N/A /**
0N/A * Feature name. Table tag "feat" in the Open
0N/A * Type Specification.
0N/A */
0N/A public final static int TAG_FEAT = 0x66656174;
0N/A
0N/A /**
0N/A * Font descriptors. Table tag "fdsc" in the Open
0N/A * Type Specification.
0N/A */
0N/A public final static int TAG_FDSC = 0x66647363;
0N/A
0N/A /**
0N/A * Font metrics. Table tag "fmtx" in the Open
0N/A * Type Specification.
0N/A */
0N/A public final static int TAG_FMTX = 0x666d7478;
0N/A
0N/A /**
0N/A * Justification. Table tag "just" in the Open
0N/A * Type Specification.
0N/A */
0N/A public final static int TAG_JUST = 0x6a757374;
0N/A
0N/A /**
0N/A * Ligature caret. Table tag "lcar" in the Open
0N/A * Type Specification.
0N/A */
0N/A public final static int TAG_LCAR = 0x6c636172;
0N/A
0N/A /**
0N/A * Glyph metamorphosis. Table tag "mort" in the Open
0N/A * Type Specification.
0N/A */
0N/A public final static int TAG_MORT = 0x6d6f7274;
0N/A
0N/A /**
0N/A * Optical bounds. Table tag "opbd" in the Open
0N/A * Type Specification.
0N/A */
0N/A public final static int TAG_OPBD = 0x6d6f7274;
0N/A
0N/A /**
0N/A * Glyph properties. Table tag "prop" in the Open
0N/A * Type Specification.
0N/A */
0N/A public final static int TAG_PROP = 0x70726f70;
0N/A
0N/A /**
0N/A * Tracking. Table tag "trak" in the Open
0N/A * Type Specification.
0N/A */
0N/A public final static int TAG_TRAK = 0x7472616b;
0N/A
0N/A /**
0N/A * Returns the version of the <code>OpenType</code> font.
0N/A * 1.0 is represented as 0x00010000.
0N/A * @return the version of the <code>OpenType</code> font.
0N/A */
0N/A public int getVersion();
0N/A
0N/A /**
0N/A * Returns the table as an array of bytes for a specified tag.
0N/A * Tags for sfnt tables include items like <i>cmap</i>,
0N/A * <i>name</i> and <i>head</i>. The <code>byte</code> array
0N/A * returned is a copy of the font data in memory.
0N/A * @param sfntTag a four-character code as a 32-bit integer
0N/A * @return a <code>byte</code> array that is the table that
0N/A * contains the font data corresponding to the specified
0N/A * tag.
0N/A */
0N/A public byte[] getFontTable(int sfntTag);
0N/A
0N/A /**
0N/A * Returns the table as an array of bytes for a specified tag.
0N/A * Tags for sfnt tables include items like <i>cmap</i>,
0N/A * <i>name</i> and <i>head</i>. The byte array returned is a
0N/A * copy of the font data in memory.
0N/A * @param strSfntTag a four-character code as a
0N/A * <code>String</code>
0N/A * @return a <code>byte</code> array that is the table that
0N/A * contains the font data corresponding to the specified
0N/A * tag.
0N/A */
0N/A public byte[] getFontTable(String strSfntTag);
0N/A
0N/A /**
0N/A * Returns a subset of the table as an array of bytes
0N/A * for a specified tag. Tags for sfnt tables include
0N/A * items like <i>cmap</i>, <i>name</i> and <i>head</i>.
0N/A * The byte array returned is a copy of the font data in
0N/A * memory.
0N/A * @param sfntTag a four-character code as a 32-bit integer
0N/A * @param offset index of first byte to return from table
0N/A * @param count number of bytes to return from table
0N/A * @return a subset of the table corresponding to
0N/A * <code>sfntTag</code> and containing the bytes
0N/A * starting at <code>offset</code> byte and including
0N/A * <code>count</code> bytes.
0N/A */
0N/A public byte[] getFontTable(int sfntTag, int offset, int count);
0N/A
0N/A /**
0N/A * Returns a subset of the table as an array of bytes
0N/A * for a specified tag. Tags for sfnt tables include items
0N/A * like <i>cmap</i>, <i>name</i> and <i>head</i>. The
0N/A * <code>byte</code> array returned is a copy of the font
0N/A * data in memory.
0N/A * @param strSfntTag a four-character code as a
0N/A * <code>String</code>
0N/A * @param offset index of first byte to return from table
0N/A * @param count number of bytes to return from table
0N/A * @return a subset of the table corresponding to
0N/A * <code>strSfntTag</code> and containing the bytes
0N/A * starting at <code>offset</code> byte and including
0N/A * <code>count</code> bytes.
0N/A */
0N/A public byte[] getFontTable(String strSfntTag, int offset, int count);
0N/A
0N/A /**
0N/A * Returns the size of the table for a specified tag. Tags for sfnt
0N/A * tables include items like <i>cmap</i>, <i>name</i> and <i>head</i>.
0N/A * @param sfntTag a four-character code as a 32-bit integer
0N/A * @return the size of the table corresponding to the specified
0N/A * tag.
0N/A */
0N/A public int getFontTableSize(int sfntTag);
0N/A
0N/A /**
0N/A * Returns the size of the table for a specified tag. Tags for sfnt
0N/A * tables include items like <i>cmap</i>, <i>name</i> and <i>head</i>.
0N/A * @param strSfntTag a four-character code as a
0N/A * <code>String</code>
0N/A * @return the size of the table corresponding to the specified tag.
0N/A */
0N/A public int getFontTableSize(String strSfntTag);
0N/A
0N/A
0N/A}