Examples of FSFont


Examples of org.xhtmlrenderer.render.FSFont

    }

    //strike-through offset should always be half of the height of lowercase x...
    //and it is defined even for fonts without 'x'!
    public float getXHeight(FontContext fontContext, FontSpecification fs) {
        FSFont font = getFontResolver().resolveFont(this, fs);
        FSFontMetrics fm = getTextRenderer().getFSFontMetrics(fontContext, font, " ");
        float sto = fm.getStrikethroughOffset();
        return fm.getAscent() - 2 * Math.abs(sto) + fm.getStrikethroughThickness();
    }
View Full Code Here

Examples of org.xhtmlrenderer.render.FSFont

        }
        throw new RuntimeException("internal error: unsupported color class " + color.getClass().getName());
    }

    public Font getFont() {
        FSFont font = getStyle().getFSFont(getContext());
        if (font instanceof AWTFSFont) {
            return ((AWTFSFont) font).getAWTFont();
        }
        return null;
    }
View Full Code Here

Examples of org.xhtmlrenderer.render.FSFont

*/
public class Breaker {

    public static void breakFirstLetter(LayoutContext c, LineBreakContext context,
            int avail, CalculatedStyle style) {
        FSFont font = style.getFSFont(c);
        context.setEnd(getFirstLetterEnd(context.getMaster(), context.getStart()));
        context.setWidth(c.getTextRenderer().getWidth(
                c.getFontContext(), font, context.getCalculatedSubstring()));

        if (context.getWidth() > avail) {
View Full Code Here

Examples of org.xhtmlrenderer.render.FSFont

        return end;
    }

    public static void breakText(LayoutContext c,
            LineBreakContext context, int avail, CalculatedStyle style) {
        FSFont font = style.getFSFont(c);
        IdentValue whitespace = style.getWhitespace();

        // ====== handle nowrap
        if (whitespace == IdentValue.NOWRAP) {
          context.setEnd(context.getLast());
View Full Code Here

Examples of org.xhtmlrenderer.render.FSFont

    }

    private static void doBreakText(LayoutContext c,
            LineBreakContext context, int avail, CalculatedStyle style,
            boolean tryToBreakAnywhere) {
        FSFont font = style.getFSFont(c);
        String currentString = context.getStartSubstring();
        BreakIterator iterator = getWordStream(currentString);
        int left = 0;
        int right = tryToBreakAnywhere ? 1 : iterator.next();
        int lastWrap = 0;
View Full Code Here

Examples of org.xhtmlrenderer.render.FSFont

    public void drawSelection(RenderingContext c, InlineText inlineText) {
        if (inlineText.isSelected()) {
            InlineLayoutBox iB = inlineText.getParent();
            String text = inlineText.getSubstring();
            if (text != null && text.length() > 0) {
                FSFont font = iB.getStyle().getFSFont(c);
                FSGlyphVector glyphVector = c.getTextRenderer().getGlyphVector(
                        c.getOutputDevice(),
                        font,
                        inlineText.getSubstring());
               
View Full Code Here

Examples of org.xhtmlrenderer.render.FSFont

                || style == IdentValue.ITALIC)) {
            style = IdentValue.NORMAL;
        }
        if (families != null) {
            for (int i = 0; i < families.length; i++) {
                FSFont font = resolveFont(ctx, families[i], size, weight, style, variant);
                if (font != null) {
                    return font;
                }
            }
        }
View Full Code Here

Examples of org.xhtmlrenderer.render.FSFont

    }

    public FSFont resolveFont(SharedContext renderingContext, FontSpecification spec) {
        if (spec.families != null) {
            for (int i = 0; i < spec.families.length; i++) {
                FSFont font = resolveFont(renderingContext, spec.families[i], spec.size,
                        spec.fontWeight, spec.fontStyle, spec.variant);
                if (font != null) {
                    return font;
                }
            }
        }

        // no font found, fall back to standard sans
        FSFont font = resolveFont(renderingContext, "sans-serif", spec.size, spec.fontWeight,
                spec.fontStyle, spec.variant);
        if (font != null) {
            return font;
        }
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.