home *** CD-ROM | disk | FTP | other *** search
Java Source | 1998-03-20 | 5.7 KB | 159 lines |
- /*
- * @(#)GlyphJustificationInfo.java 1.11 98/03/18
- *
- * Copyright 1997, 1998 by Sun Microsystems, Inc.,
- * 901 San Antonio Road, Palo Alto, California, 94303, U.S.A.
- * All rights reserved.
- *
- * This software is the confidential and proprietary information
- * of Sun Microsystems, Inc. ("Confidential Information"). You
- * shall not disclose such Confidential Information and shall use
- * it only in accordance with the terms of the license agreement
- * you entered into with Sun.
- */
-
- /*
- * (C) Copyright Taligent, Inc. 1996 - 1997, All Rights Reserved
- * (C) Copyright IBM Corp. 1996 - 1998, All Rights Reserved
- *
- * The original version of this source code and documentation is
- * copyrighted and owned by Taligent, Inc., a wholly-owned subsidiary
- * of IBM. These materials are provided under terms of a License
- * Agreement between Taligent and Sun. This technology is protected
- * by multiple US and International patents.
- *
- * This notice and attribution to Taligent may not be removed.
- * Taligent is a registered trademark of Taligent, Inc.
- *
- */
-
- package java.awt.font;
-
- /**
- * GlyphJustificationInfo represents information about the justification
- * properties of a glyph.
- * <p>
- * Weight is the overall 'weight' of the glyph in the line. Generally it is
- * proportional to the size of the font. Glyphs with larger weight are
- * allocated a correspondingly larger amount of the change in space.
- * <p>
- * Priority determines the justification phase in which this glyph is used.
- * All glyphs of the same priority are examined before glyphs of the next
- * lower priority. If all the change in space can be allocated to these
- * glyphs without exceeding their limits, then lower priority glyphs are not
- * examined.
- * <p>
- * Absorb determines whether a glyph absorbs all change in space. Within a
- * given priority, some glyphs may absorb all the change in space. If any of
- * these glyphs are present, no glyphs of lower priority will be examined.
- * <p>
- * Limit determines the maximum or minimum amount by which the glyph can
- * change. Left and right sides of the glyph may have different limits.
- * <p>
- * Each justification info represents two sets of metrics, growing and
- * shrinking. Growing metrics are used when the glyphs on a line are to be
- * spread apart to fit a larger width, shrinking metrics are used when the
- * glyphs are to be moved together to fit a smaller width.
- * <p>
- * <strong>Example:</strong>
- * Querying a Font for justification information
- * <blockquote><pre>
- * Font font = ...;
- * int glyphCode = ...;
- * GlyphJustificationInfo info = font.getGlyphJustificationInfo(glyphCode);
- * </blockquote></pre>
- */
-
- public final class GlyphJustificationInfo {
-
- /**
- * Construct information about the justification properties of a glyph.
- *
- * @param weight the weight of this glyph
- * @param growAbsorb if true, when growing this glyph absorbs all extra
- * space at this and lower priority levels
- * @param growPriority the priority level of this glyph when growing
- * @param growLeftLimit the maximum amount by which the left side of this
- * glyph can grow
- * @param growRightLimit the maximum amount by which the right side of this
- * glyph can grow
- * @param shrinkAbsorb if true, when shrinking this glyph absorbs all
- * remaining shrinkage at this and lower priority levels
- * @param shrinkPriority the priority level of this glyph when shrinking
- * @param shrinkLeftLimit the maximum amount by which the left side of this
- * glyph can shrink (a positive number)
- * @param shrinkRightLimit the maximum amoun by which the right side of
- * this glyph can shrink (a postive number)
- * @see Font2#getGlyphJustificationInfo
- */
- public GlyphJustificationInfo(float weight,
- boolean growAbsorb,
- int growPriority,
- float growLeftLimit,
- float growRightLimit,
- boolean shrinkAbsorb,
- int shrinkPriority,
- float shrinkLeftLimit,
- float shrinkRightLimit)
- {
- this.weight = weight;
- this.growAbsorb = growAbsorb;
- this.growPriority = (byte)growPriority;
- this.growLeftLimit = growLeftLimit;
- this.growRightLimit = growRightLimit;
- this.shrinkAbsorb = shrinkAbsorb;
- this.shrinkPriority = (byte)shrinkPriority;
- this.shrinkLeftLimit = shrinkLeftLimit;
- this.shrinkRightLimit = shrinkRightLimit;
- }
-
- /**
- * The weight of this glyph.
- */
- public final float weight;
-
- /**
- * The priority level of this glyph when growing.
- */
- public final byte growPriority;
-
- /**
- * If true, when growing this glyph absorbs all extra space at this and
- * lower priority levels.
- */
- public final boolean growAbsorb;
-
- /**
- * The maximum amount by which the left side of this glyph can grow.
- */
- public final float growLeftLimit;
-
- /**
- * The maximum amount by which the right side of this glyph can grow.
- */
- public final float growRightLimit;
-
- /**
- * The priority level of this glyph when shrinking.
- */
- public final byte shrinkPriority;
-
- /**
- * If true, when shrinking this glyph absorbs all remaining shrinkage at
- * this and lower priority levels.
- */
- public final boolean shrinkAbsorb;
-
- /**
- * The maximum amount by which the left side of this glyph can shrink
- * (a positive number).
- */
- public final float shrinkLeftLimit;
-
- /**
- * The maximum amount by which the right side of this glyph can shrink
- * (a positive number).
- */
- public final float shrinkRightLimit;
- }
-