GlyphJustificationInfo.java revision 0
0N/A * Copyright 1997-1999 Sun Microsystems, Inc. All Rights Reserved. 0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 0N/A * This code is free software; you can redistribute it and/or modify it 0N/A * under the terms of the GNU General Public License version 2 only, as 0N/A * published by the Free Software Foundation. Sun designates this 0N/A * particular file as subject to the "Classpath" exception as provided 0N/A * by Sun in the LICENSE file that accompanied this code. 0N/A * This code is distributed in the hope that it will be useful, but WITHOUT 0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 0N/A * version 2 for more details (a copy is included in the LICENSE file that 0N/A * accompanied this code). 0N/A * You should have received a copy of the GNU General Public License version 0N/A * 2 along with this work; if not, write to the Free Software Foundation, 0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 0N/A * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 0N/A * CA 95054 USA or visit www.sun.com if you need additional information or 0N/A * have any questions. 0N/A * (C) Copyright Taligent, Inc. 1996 - 1997, All Rights Reserved 0N/A * (C) Copyright IBM Corp. 1996 - 1998, All Rights Reserved 0N/A * The original version of this source code and documentation is 0N/A * copyrighted and owned by Taligent, Inc., a wholly-owned subsidiary 0N/A * of IBM. These materials are provided under terms of a License 0N/A * Agreement between Taligent and Sun. This technology is protected 0N/A * by multiple US and International patents. 0N/A * This notice and attribution to Taligent may not be removed. 0N/A * Taligent is a registered trademark of Taligent, Inc. 0N/A * The <code>GlyphJustificationInfo</code> class represents information 0N/A * about the justification properties of a glyph. A glyph is the visual 0N/A * representation of one or more characters. Many different glyphs can 0N/A * be used to represent a single character or combination of characters. 0N/A * The four justification properties represented by 0N/A * <code>GlyphJustificationInfo</code> are weight, priority, absorb and 0N/A * Weight is the overall 'weight' of the glyph in the line. Generally it is 0N/A * proportional to the size of the font. Glyphs with larger weight are 0N/A * allocated a correspondingly larger amount of the change in space. 0N/A * Priority determines the justification phase in which this glyph is used. 0N/A * All glyphs of the same priority are examined before glyphs of the next 0N/A * priority. If all the change in space can be allocated to these glyphs 0N/A * without exceeding their limits, then glyphs of the next priority are not 0N/A * examined. There are four priorities, kashida, whitespace, interchar, 0N/A * and none. KASHIDA is the first priority examined. NONE is the last 0N/A * priority examined. 0N/A * Absorb determines whether a glyph absorbs all change in space. Within a 0N/A * given priority, some glyphs may absorb all the change in space. If any of 0N/A * these glyphs are present, no glyphs of later priority are examined. 0N/A * Limit determines the maximum or minimum amount by which the glyph can 0N/A * change. Left and right sides of the glyph can have different limits. 0N/A * Each <code>GlyphJustificationInfo</code> represents two sets of 0N/A * metrics, which are <i>growing</i> and <i>shrinking</i>. Growing 0N/A * metrics are used when the glyphs on a line are to be 0N/A * spread apart to fit a larger width. Shrinking metrics are used when 0N/A * the glyphs are to be moved together to fit a smaller width. 0N/A * Constructs information about the justification properties of a 0N/A * @param weight the weight of this glyph when allocating space. Must be non-negative. 0N/A * @param growAbsorb if <code>true</code> this glyph absorbs 0N/A * all extra space at this priority and lower priority levels when it 0N/A * @param growPriority the priority level of this glyph when it 0N/A * @param growLeftLimit the maximum amount by which the left side of this 0N/A * glyph can grow. Must be non-negative. 0N/A * @param growRightLimit the maximum amount by which the right side of this 0N/A * glyph can grow. Must be non-negative. 0N/A * @param shrinkAbsorb if <code>true</code>, this glyph absorbs all 0N/A * remaining shrinkage at this and lower priority levels when it 0N/A * @param shrinkPriority the priority level of this glyph when 0N/A * @param shrinkLeftLimit the maximum amount by which the left side of this 0N/A * glyph can shrink. Must be non-negative. 0N/A * @param shrinkRightLimit the maximum amount by which the right side 0N/A * of this glyph can shrink. Must be non-negative. 0N/A /** The highest justification priority. */ 0N/A /** The second highest justification priority. */ 0N/A /** The second lowest justification priority. */ 0N/A /** The lowest justification priority. */ 0N/A * The weight of this glyph. 0N/A * The priority level of this glyph as it is growing. 0N/A * If <code>true</code>, this glyph absorbs all extra 0N/A * space at this and lower priority levels when it grows. 0N/A * The maximum amount by which the left side of this glyph can grow. 0N/A * The maximum amount by which the right side of this glyph can grow. 0N/A * The priority level of this glyph as it is shrinking. 0N/A * If <code>true</code>,this glyph absorbs all remaining shrinkage at 0N/A * this and lower priority levels as it shrinks. 0N/A * The maximum amount by which the left side of this glyph can shrink 0N/A * (a positive number). 0N/A * The maximum amount by which the right side of this glyph can shrink 0N/A * (a positive number).