Package org.axsl.font

Examples of org.axsl.font.Font


     * @param codePoint The Unicode code point whose width is needed.
     * @return The width of {@code codePoint}, in millipoints.
     */
    public int getCharWidth(final LineText lineText, final int codePoint) {
        final FontUse fontUse = lineText.inlinePrimaryFont();
        final Font font = fontUse.getFont();
        int fontSize = lineText.inlineFontSize();
        int codePointToUse = codePoint;
        if (lineText.inlineIsFauxSmallCaps()
                && isLowerCase(codePoint)) {
            fontSize = lineText.inlineFauxSmallCapsFontSize();
            codePointToUse = java.lang.Character.toUpperCase((char) codePoint);
        }
        fontUse.registerCharUsed(codePointToUse);
        return font.width(codePointToUse, fontSize)
                + lineText.inlineLetterSpacingOptimum();
    }
View Full Code Here


     * @param word The word whose size is needed.
     * @return The width, in millipoints, of {@code word}.
     */
    public int getWordWidth(final LineText lineText, final CharSequence word) {
        final FontUse fontUse = lineText.inlinePrimaryFont();
        final Font font = fontUse.getFont();
        fontUse.registerCharsUsed(word);
        return font.width(word,
                lineText.inlineFontSize(),
                lineText.inlineLetterSpacingOptimum(), 0, true);
    }
View Full Code Here

         * that is no longer valid, that is, the idea that dominant-baseline
         * could be set on a line or any other block or reference area. This
         * whole issue needs to be revisited. */
//        final Baseline baseline = this.traitDominantBaseline();
        final Font.Baseline baseline = Font.Baseline.ALPHABETIC;
        final Font font = this.getPrimaryFont().getFont();
        return font.baselineOffset(axis, baseline, this.traitFontSize());
    }
View Full Code Here

     * @param word The word whose width should be computed.
     * @return The width of the word, in millipoints.
     */
    public int getWordWidth(final CharSequence word) {
        final FontUse fontUse = getPrimaryFont();
        final Font font = fontUse.getFont();
        fontUse.registerCharsUsed(word);
        return font.width(word, traitFontSize(),
                traitGeneratedBy().traitLetterSpacingOpt(this),
                traitGeneratedBy().traitWordSpacingOpt(this), true);
    }
View Full Code Here

TOP

Related Classes of org.axsl.font.Font

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.