Package org.apache.fop.fonts

Examples of org.apache.fop.fonts.FontInfo


    }

    private boolean createPattern(PatternPaint pp, boolean fill) {
        preparePainting();

        FontInfo specialFontInfo = new FontInfo();
        FontSetup.setup(specialFontInfo);

        PDFResources res = pdfDoc.getFactory().makeResources();
        PDFResourceContext context = new PDFResourceContext(res);
        PDFGraphics2D pattGraphic = new PDFGraphics2D(textAsShapes, specialFontInfo,
View Full Code Here


        fobj = node;
    }

    /** {@inheritDoc} */
    public void initialize() {
        FontInfo fi = fobj.getFOEventHandler().getFontInfo();
        FontTriplet[] fontkeys = fobj.getCommonFont().getFontState(fi);
        font = fi.getFontInstance(fontkeys[0], fobj.getCommonFont().fontSize.getValue(this));
        setCommonBorderPaddingBackground(fobj.getCommonBorderPaddingBackground());
    }
View Full Code Here

        SVGUserAgent svgUserAgent
            = new SVGUserAgent(userAgent, new AffineTransform());

        ImageSessionContext imageSessionContext = userAgent.getImageSessionContext();

        FontInfo fontInfo = g2d.getFontInfo();
        return new AFPBridgeContext(svgUserAgent, fontInfo, imageManager, imageSessionContext,
                new AffineTransform(), g2d);
    }
View Full Code Here

        return createBridgeContext("1.x");
    }

    /** {@inheritDoc} */
    public BridgeContext createBridgeContext(String version) {
        FontInfo fontInfo = graphics.getFontInfo();
        if (isTextStroked()) {
            fontInfo = null;
        }
        BridgeContext ctx = new PDFBridgeContext(userAgent, fontInfo,
                getImageManager(), getImageSessionContext());
View Full Code Here

        pdfDoc.setFilterMap(
                PDFRendererConfigurator.buildFilterMapFromConfiguration(cfg));

        //Fonts
        try {
            FontInfo fontInfo = createFontInfo(cfg);
            graphics.setFontInfo(fontInfo);
        } catch (FOPException e) {
            throw new ConfigurationException("Error while setting up fonts", e);
        }
    }
View Full Code Here

     * @param cfg the configuration
     * @return the font collection
     * @throws FOPException if an error occurs while setting up the fonts
     */
    public static FontInfo createFontInfo(Configuration cfg) throws FOPException {
        FontInfo fontInfo = new FontInfo();
        if (cfg != null) {
            FontResolver fontResolver = FontManager.createMinimalFontResolver();
            //TODO The following could be optimized by retaining the FontManager somewhere
            FontManager fontManager = new FontManager();

View Full Code Here

        FontManager fontManager = getUserAgent().getFactory().getFontManager();
        FontCollection[] fontCollections = new FontCollection[] {
                new Base14FontCollection(fontManager.isBase14KerningEnabled())
        };

        FontInfo fi = (fontInfo != null ? fontInfo : new FontInfo());
        fi.setEventListener(new FontEventAdapter(getUserAgent().getEventBroadcaster()));
        fontManager.setup(fi, fontCollections);
        setFontInfo(fi);
    }
View Full Code Here

        FontManager fontManager = getUserAgent().getFactory().getFontManager();
        FontCollection[] fontCollections = new FontCollection[] {
            new AFPFontCollection(getUserAgent().getEventBroadcaster(), null)
        };

        FontInfo fi = (fontInfo != null ? fontInfo : new FontInfo());
        fi.setEventListener(new FontEventAdapter(getUserAgent().getEventBroadcaster()));
        fontManager.setup(fi, fontCollections);
        setFontInfo(fi);
    }
View Full Code Here

      workFlowBean.getResponse().setContentType(contentType);
      byte[] content = null;
      if (contentType.indexOf("html") == -1) {
        FopFactory fopFactory = FopFactory.newInstance();
        fopFactory.setUserConfig(workFlowBean.getRequest().getRealPath("/WEB-INF/fop-config/userconfig.xml"));
        FontInfo fontInfo = new FontInfo();
        Map map = fontInfo.getFonts();
        FOUserAgent foUserAgent = fopFactory.newFOUserAgent();
        Fop fop = fopFactory.newFop(mimeConstants, foUserAgent, out);
        TransformerFactory factory = TransformerFactory.newInstance();
        Transformer transformer = factory.newTransformer(new StreamSource(xslt));
        transformer.setParameter("versionParam", "2.0");
View Full Code Here

        // Setup output
        OutputStream out = new java.io.FileOutputStream(pdffile);
        out = new java.io.BufferedOutputStream(out);
        try {
            //Setup fonts and user agent
            FontInfo fontInfo = new FontInfo();
            FOUserAgent userAgent = fopFactory.newFOUserAgent();

            //Construct the AreaTreeModel that will received the individual pages
            AreaTreeModel treeModel = new RenderPagesModel(userAgent,
                    MimeConstants.MIME_PDF, fontInfo, out);
View Full Code Here

TOP

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

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.