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