2362N/A * Copyright (c) 1997, 1999, Oracle and/or its affiliates. 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 2362N/A * published by the Free Software Foundation. Oracle designates this 0N/A * particular file as subject to the "Classpath" exception as provided 2362N/A * by Oracle 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. 2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 2362N/A * or visit www.oracle.com if you need additional information or have any 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 * one info for each side of each glyph 0N/A * separate infos for grow and shrink case 0N/A * !!! this doesn't really need to be a separate class. If we keep it 0N/A * separate, probably the newJustify code from TextLayout belongs here as well. 0N/A * Initialize the justifier with an array of infos corresponding to each 0N/A * glyph. Start and limit indicate the range of the array to examine. 0N/A * Return an array of deltas twice as long as the original info array, 0N/A * indicating the amount by which each side of each glyph should grow 0N/A * Delta should be positive to expand the line, and negative to compress it. 0N/A // make separate passes through glyphs in order of decreasing priority 0N/A // until justifyDelta is zero or we run out of priorities. 0N/A * special case 'fallback' iteration, set flag and recheck 0N/A // pass through glyphs, first collecting weights and limits 0N/A if (i !=
start) {
// ignore left of first character 0N/A if (i +
1 !=
limit) {
// ignore right of last character 0N/A // did we hit the limit? 0N/A // predivide delta by weight 0N/A // now allocate this based on ratio of weight to total weight 0N/A // sign factored in already 0N/A // sign factored in already