1. /*
  2. * @(#)MultipleMaster.java 1.14 01/11/29
  3. *
  4. * Copyright 2002 Sun Microsystems, Inc. All rights reserved.
  5. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  6. */
  7. package java.awt.font;
  8. import java.awt.Font;
  9. /**
  10. * The <code>MultipleMaster</code> interface represents Type 1
  11. * Multiple Master fonts.
  12. * A particular {@link Font} object can implement this interface.
  13. * @version 10 Feb 1997
  14. */
  15. public interface MultipleMaster {
  16. /**
  17. * Returns the number of multiple master design controls.
  18. * Design axes include things like width, weight and optical scaling.
  19. * @return the number of multiple master design controls
  20. */
  21. public int getNumDesignAxes();
  22. /**
  23. * Returns an array of design limits interleaved in the form [from->to]
  24. * for each axis. For example,
  25. * design limits for weight could be from 0.1 to 1.0. The values are
  26. * returned in the same order returned by
  27. * <code>getDesignAxisNames</code>.
  28. * @return an array of design limits for each axis.
  29. */
  30. public float[] getDesignAxisRanges();
  31. /**
  32. * Returns an array of default design values for each axis. For example,
  33. * the default value for weight could be 1.6. The values are returned
  34. * in the same order returned by <code>getDesignAxisNames</code>.
  35. * @return an array of default design values for each axis.
  36. */
  37. public float[] getDesignAxisDefaults();
  38. /**
  39. * Returns the name for each design axis. This also determines the order in
  40. * which the values for each axis are returned.
  41. * @return an array containing the names of each design axis.
  42. */
  43. public String[] getDesignAxisNames();
  44. /**
  45. * Creates a new instance of a multiple master font based on the design
  46. * axis values contained in the specified array. The size of the array
  47. * must correspond to the value returned from
  48. * <code>getNumDesignAxes</code> and the values of the array elements
  49. * must fall within limits specified by
  50. * <code>getDesignAxesLimits</code>. In case of an error,
  51. * <code>null</code> is returned.
  52. * @param axes an array containing axis values
  53. * @return a {@link Font} object that is an instance of
  54. * <code>MultipleMaster</code> and is based on the design axis values
  55. * provided by <code>axes</code>.
  56. */
  57. public Font deriveMMFont(float[] axes);
  58. /**
  59. * Creates a new instance of a multiple master font based on detailed metric
  60. * information. In case of an error, <code>null</code> is returned.
  61. * @param glyphWidths an array of floats representing the desired width
  62. * of each glyph in font space
  63. * @param avgStemWidth the average stem width for the overall font in
  64. * font space
  65. * @param typicalCapHeight the height of a typical upper case char
  66. * @param typicalXHeight the height of a typical lower case char
  67. * @param italicAngle the angle at which the italics lean, in degrees
  68. * counterclockwise from vertical
  69. * @return a <code>Font</code> object that is an instance of
  70. * <code>MultipleMaster</code> and is based on the specified metric
  71. * information.
  72. */
  73. public Font deriveMMFont(
  74. float[] glyphWidths,
  75. float avgStemWidth,
  76. float typicalCapHeight,
  77. float typicalXHeight,
  78. float italicAngle);
  79. }