J. Duke | 319a3b9 | 2007-12-01 00:00:00 +0000 | [diff] [blame^] | 1 | /* |
| 2 | * Copyright 1997-1998 Sun Microsystems, Inc. All Rights Reserved. |
| 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
| 4 | * |
| 5 | * This code is free software; you can redistribute it and/or modify it |
| 6 | * under the terms of the GNU General Public License version 2 only, as |
| 7 | * published by the Free Software Foundation. Sun designates this |
| 8 | * particular file as subject to the "Classpath" exception as provided |
| 9 | * by Sun in the LICENSE file that accompanied this code. |
| 10 | * |
| 11 | * This code is distributed in the hope that it will be useful, but WITHOUT |
| 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
| 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
| 14 | * version 2 for more details (a copy is included in the LICENSE file that |
| 15 | * accompanied this code). |
| 16 | * |
| 17 | * You should have received a copy of the GNU General Public License version |
| 18 | * 2 along with this work; if not, write to the Free Software Foundation, |
| 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
| 20 | * |
| 21 | * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, |
| 22 | * CA 95054 USA or visit www.sun.com if you need additional information or |
| 23 | * have any questions. |
| 24 | */ |
| 25 | package java.awt.font; |
| 26 | |
| 27 | import java.awt.Font; |
| 28 | |
| 29 | /** |
| 30 | * The <code>MultipleMaster</code> interface represents Type 1 |
| 31 | * Multiple Master fonts. |
| 32 | * A particular {@link Font} object can implement this interface. |
| 33 | */ |
| 34 | public interface MultipleMaster { |
| 35 | |
| 36 | /** |
| 37 | * Returns the number of multiple master design controls. |
| 38 | * Design axes include things like width, weight and optical scaling. |
| 39 | * @return the number of multiple master design controls |
| 40 | */ |
| 41 | public int getNumDesignAxes(); |
| 42 | |
| 43 | /** |
| 44 | * Returns an array of design limits interleaved in the form [from->to] |
| 45 | * for each axis. For example, |
| 46 | * design limits for weight could be from 0.1 to 1.0. The values are |
| 47 | * returned in the same order returned by |
| 48 | * <code>getDesignAxisNames</code>. |
| 49 | * @return an array of design limits for each axis. |
| 50 | */ |
| 51 | public float[] getDesignAxisRanges(); |
| 52 | |
| 53 | /** |
| 54 | * Returns an array of default design values for each axis. For example, |
| 55 | * the default value for weight could be 1.6. The values are returned |
| 56 | * in the same order returned by <code>getDesignAxisNames</code>. |
| 57 | * @return an array of default design values for each axis. |
| 58 | */ |
| 59 | public float[] getDesignAxisDefaults(); |
| 60 | |
| 61 | /** |
| 62 | * Returns the name for each design axis. This also determines the order in |
| 63 | * which the values for each axis are returned. |
| 64 | * @return an array containing the names of each design axis. |
| 65 | */ |
| 66 | public String[] getDesignAxisNames(); |
| 67 | |
| 68 | /** |
| 69 | * Creates a new instance of a multiple master font based on the design |
| 70 | * axis values contained in the specified array. The size of the array |
| 71 | * must correspond to the value returned from |
| 72 | * <code>getNumDesignAxes</code> and the values of the array elements |
| 73 | * must fall within limits specified by |
| 74 | * <code>getDesignAxesLimits</code>. In case of an error, |
| 75 | * <code>null</code> is returned. |
| 76 | * @param axes an array containing axis values |
| 77 | * @return a {@link Font} object that is an instance of |
| 78 | * <code>MultipleMaster</code> and is based on the design axis values |
| 79 | * provided by <code>axes</code>. |
| 80 | */ |
| 81 | public Font deriveMMFont(float[] axes); |
| 82 | |
| 83 | /** |
| 84 | * Creates a new instance of a multiple master font based on detailed metric |
| 85 | * information. In case of an error, <code>null</code> is returned. |
| 86 | * @param glyphWidths an array of floats representing the desired width |
| 87 | * of each glyph in font space |
| 88 | * @param avgStemWidth the average stem width for the overall font in |
| 89 | * font space |
| 90 | * @param typicalCapHeight the height of a typical upper case char |
| 91 | * @param typicalXHeight the height of a typical lower case char |
| 92 | * @param italicAngle the angle at which the italics lean, in degrees |
| 93 | * counterclockwise from vertical |
| 94 | * @return a <code>Font</code> object that is an instance of |
| 95 | * <code>MultipleMaster</code> and is based on the specified metric |
| 96 | * information. |
| 97 | */ |
| 98 | public Font deriveMMFont( |
| 99 | float[] glyphWidths, |
| 100 | float avgStemWidth, |
| 101 | float typicalCapHeight, |
| 102 | float typicalXHeight, |
| 103 | float italicAngle); |
| 104 | |
| 105 | |
| 106 | } |