Package java.awt.font

Examples of java.awt.font.LineBreakMeasurer


                // attempt to lay the text out in the specified width, incrementing by 10% each
                // time; limit our attempts to 10 expansions to avoid infinite loops if something
                // is fucked
                for (int i = 0; i < 10; i++) {
                    LineBreakMeasurer measurer = new LineBreakMeasurer(textIterator(gfx), frc);
                    layouts = computeLines(measurer, targetWidth, _size, true);
                    if ((layouts != null) && (layouts.size() <= lines)) {
                        break;
                    }
                    targetWidth = (int)Math.round(targetWidth * 1.1);
                }
            }

        } else if (_constraints.width > 0) {
            LineBreakMeasurer measurer =
                new LineBreakMeasurer(textIterator(gfx), frc);
            layouts = computeLines(measurer, _constraints.width, _size, false);
        }

        // if no constraint, or our constraining height puts us on one line then layout on one line
        // and call it good
View Full Code Here

TOP

Related Classes of java.awt.font.LineBreakMeasurer

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.