Package org.albite.font

Examples of org.albite.font.AlbiteFont.charsWidth()


                        if (parser.length == 0) {
                            continue line;
                        }

                        wordPixelWidth = font.charsWidth(buffer,
                                parser.position, parser.length);

                        if (!firstWord) {
                            /*
                             * If it is not the first word, it will need the
View Full Code Here


                                 * wordInfo.length - 2: starts from one before
                                 * the last
                                 */
                                for (int i = parser.length - 2; i > 0; i--) {
                                    if (info.isHyphenationPossible(i)) {
                                        wordPixelWidth = font.charsWidth(buffer,
                                                parser.position, i) + dashWidth;

                                        /*
                                         * This part of the word fits on the line
                                         */
 
View Full Code Here

                            /*
                             * The word could not be hyphenated. Could it fit
                             * into a single line at all?
                             */
                            if (font.charsWidth(buffer, parser.position,
                                    parser.length) > width) {

                                /* This word neither hyphenates, nor does it
                                 * fit at all on a single line, so one should
                                 * force hyphanation on it!
View Full Code Here

                                /* This word neither hyphenates, nor does it
                                 * fit at all on a single line, so one should
                                 * force hyphanation on it!
                                 */
                                for (int i = parser.length - 2; i > 0; i--) {
                                    wordPixelWidth = font.charsWidth(buffer,
                                            parser.position, i) + dashWidth;

                                    if (wordPixelWidth < width - posX) {
                                        /*
                                         * If the word chunk already ends with a
View Full Code Here

               
                font.drawChars(
                        g,
                        textColor,
                        text,
                        centerX - (font.charsWidth(text) / 2), centerY);
            } else {
                g.setColor(textColor);
                if (textFont != null) {
                    g.setFont(textFont);
                }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.