KickJava   Java API By Example, From Geeks To Geeks.

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


1 /*
2  * @(#)MultipleMaster.java 1.18 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 package java.awt.font;
8
9 import java.awt.Font JavaDoc;
10
11 /**
12  * The <code>MultipleMaster</code> interface represents Type 1
13  * Multiple Master fonts.
14  * A particular {@link Font} object can implement this interface.
15  * @version 10 Feb 1997
16  */

17 public interface MultipleMaster {
18
19   /**
20    * Returns the number of multiple master design controls.
21    * Design axes include things like width, weight and optical scaling.
22    * @return the number of multiple master design controls
23    */

24   public int getNumDesignAxes();
25
26   /**
27    * Returns an array of design limits interleaved in the form [from->to]
28    * for each axis. For example,
29    * design limits for weight could be from 0.1 to 1.0. The values are
30    * returned in the same order returned by
31    * <code>getDesignAxisNames</code>.
32    * @return an array of design limits for each axis.
33    */

34   public float[] getDesignAxisRanges();
35
36   /**
37    * Returns an array of default design values for each axis. For example,
38    * the default value for weight could be 1.6. The values are returned
39    * in the same order returned by <code>getDesignAxisNames</code>.
40    * @return an array of default design values for each axis.
41    */

42   public float[] getDesignAxisDefaults();
43
44   /**
45    * Returns the name for each design axis. This also determines the order in
46    * which the values for each axis are returned.
47    * @return an array containing the names of each design axis.
48    */

49   public String JavaDoc[] getDesignAxisNames();
50
51   /**
52    * Creates a new instance of a multiple master font based on the design
53    * axis values contained in the specified array. The size of the array
54    * must correspond to the value returned from
55    * <code>getNumDesignAxes</code> and the values of the array elements
56    * must fall within limits specified by
57    * <code>getDesignAxesLimits</code>. In case of an error,
58    * <code>null</code> is returned.
59    * @param axes an array containing axis values
60    * @return a {@link Font} object that is an instance of
61    * <code>MultipleMaster</code> and is based on the design axis values
62    * provided by <code>axes</code>.
63    */

64   public Font JavaDoc deriveMMFont(float[] axes);
65
66   /**
67    * Creates a new instance of a multiple master font based on detailed metric
68    * information. In case of an error, <code>null</code> is returned.
69    * @param glyphWidths an array of floats representing the desired width
70    * of each glyph in font space
71    * @param avgStemWidth the average stem width for the overall font in
72    * font space
73    * @param typicalCapHeight the height of a typical upper case char
74    * @param typicalXHeight the height of a typical lower case char
75    * @param italicAngle the angle at which the italics lean, in degrees
76    * counterclockwise from vertical
77    * @return a <code>Font</code> object that is an instance of
78    * <code>MultipleMaster</code> and is based on the specified metric
79    * information.
80    */

81   public Font JavaDoc deriveMMFont(
82                    float[] glyphWidths,
83                    float avgStemWidth,
84                    float typicalCapHeight,
85                    float typicalXHeight,
86                    float italicAngle);
87  
88
89 }
90
Popular Tags