Package org.apache.fop.fonts

Examples of org.apache.fop.fonts.FontTriplet


            AFPFontInfo afi = buildFont(font[i], null);
            if (afi != null) {
                if (log.isDebugEnabled()) {
                    log.debug("Adding font " + afi.getAFPFont().getFontName());
                    for (int j = 0; j < afi.getFontTriplets().size(); ++j) {
                        FontTriplet triplet = (FontTriplet) afi.getFontTriplets().get(j);
                        log.debug("Font triplet "
                                  + triplet.getName() + ", "
                                  + triplet.getStyle() + ", "
                                  + triplet.getWeight());
                    }
                }

                fontList.add(afi);
            }
View Full Code Here


                style = "normal";
            }
            // NOTE: this is incomplete. font-size may be specified with
            // various kinds of keywords too
            //int fontVariant = propertyList.get("font-variant").getEnum();
            FontTriplet triplet = fontInfo.fontLookup(getFontFamily(), style,
                                               font_weight);
            fontState = fontInfo.getFontInstance(triplet, fontSize.getValue(context));
        }
        return fontState;
    }
View Full Code Here

            while (fonts.hasNext()) {
                FontSpec f = (FontSpec)fonts.next();
                System.out.println("  " + f.getKey() + " " + f.getFamilyNames());
                Iterator triplets = f.getTriplets().iterator();
                while (triplets.hasNext()) {
                    FontTriplet triplet = (FontTriplet)triplets.next();
                    System.out.println("    " + triplet.toString());
                }
            }
        }
    }
View Full Code Here

        AttributesImpl atts = new AttributesImpl();
        atts.clear();
        handler.startElement(TRIPLETS, atts);
        Iterator iter = triplets.iterator();
        while (iter.hasNext()) {
            FontTriplet triplet = (FontTriplet)iter.next();
            atts.clear();
            atts.addAttribute(null, NAME, NAME, CDATA, triplet.getName());
            atts.addAttribute(null, STYLE, STYLE, CDATA, triplet.getStyle());
            atts.addAttribute(null, WEIGHT, WEIGHT, CDATA,
                    Integer.toString(triplet.getWeight()));
            handler.element(TRIPLET, atts);
        }
        handler.endElement(TRIPLETS);
    }
View Full Code Here

        //SortedMap<String/font-family, List<FontSpec>>

        Iterator iter = fontInfo.getFontTriplets().entrySet().iterator();
        while (iter.hasNext()) {
            Map.Entry entry = (Map.Entry)iter.next();
            FontTriplet triplet = (FontTriplet)entry.getKey();
            String key = (String)entry.getValue();
            FontSpec container;
            if (keyBag.contains(key)) {
                keyBag.remove(key);
View Full Code Here

            final int letterSpacing, final int wordSpacing, final int[] dx,
            final String text) throws IFException {
        final int fontSize = this.state.getFontSize();
        getPaintingState().setFontSize(fontSize);

        FontTriplet triplet = new FontTriplet(
                state.getFontFamily(), state.getFontStyle(), state.getFontWeight());
        //TODO Ignored: state.getFontVariant()
        String fontKey = getFontInfo().getInternalFontKey(triplet);
        if (fontKey == null) {
            triplet = new FontTriplet("any", Font.STYLE_NORMAL, Font.WEIGHT_NORMAL);
            fontKey = getFontInfo().getInternalFontKey(triplet);
        }

        // register font as necessary
        Map/*<String,FontMetrics>*/ fontMetricMap = documentHandler.getFontInfo().getFonts();
View Full Code Here

        establishStructurePointer(ptr);

        // This assumes that *all* CIDFonts use a /ToUnicode mapping
        Typeface tf = getTypeface(fontName);

        FontTriplet triplet = (FontTriplet)text.getTrait(Trait.FONT);
        try {
            painter.setFont(triplet.getName(), triplet.getStyle(), new Integer(triplet.getWeight()),
                    "normal", new Integer(size), ct);
        } catch (IFException e) {
            handleIFException(e);
        }

View Full Code Here

        } else {
            generator.updateColor(state.getTextColor(), true, null);
            generator.beginTextObject();
        }

        FontTriplet triplet = new FontTriplet(
                state.getFontFamily(), state.getFontStyle(), state.getFontWeight());
        //TODO Ignored: state.getFontVariant()
        //TODO Opportunity for font caching if font state is more heavily used
        String fontKey = getFontInfo().getInternalFontKey(triplet);
        int sizeMillipoints = state.getFontSize();
View Full Code Here

    /** {@inheritDoc} */
    public void drawText(int x, int y, int letterSpacing, int wordSpacing, int[] dx, String text)
            throws IFException {
        g2dState.updateColor(state.getTextColor());
        FontTriplet triplet = new FontTriplet(
                state.getFontFamily(), state.getFontStyle(), state.getFontWeight());
        //TODO Ignored: state.getFontVariant()
        //TODO Opportunity for font caching if font state is more heavily used
        Font font = getFontInfo().getFontInstance(triplet, state.getFontSize());
        //String fontName = font.getFontName();
View Full Code Here

     * Returns the internal font key fot a font triplet coming from the area tree
     * @param area the area from which to retrieve the font triplet information
     * @return the internal font key (F1, F2 etc.) or null if not found
     */
    protected String getInternalFontNameForArea(Area area) {
        FontTriplet triplet = (FontTriplet)area.getTrait(Trait.FONT);
        return fontInfo.getInternalFontKey(triplet);
    }
View Full Code Here

TOP

Related Classes of org.apache.fop.fonts.FontTriplet

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.