Examples of FontResolver


Examples of org.apache.fop.fonts.FontResolver

        fontCollections.add(new Base14FontCollection(graphics2D));
        fontCollections.add(new InstalledFontCollection(graphics2D));

        Configuration cfg = super.getRendererConfig(documentHandler.getMimeType());
        if (cfg != null) {
            FontResolver fontResolver = new DefaultFontResolver(userAgent);
            FontEventListener listener = new FontEventAdapter(
                    userAgent.getEventBroadcaster());
            List fontList = buildFontList(cfg, fontResolver, listener);
            fontCollections.add(new ConfiguredFontCollection(fontResolver, fontList));
        }
View Full Code Here

Examples of org.apache.fop.fonts.FontResolver

    @Test
    public void testUseKerning() throws IOException {
        boolean useComplexScriptFeatures = false;
        File file = new File("test/resources/fonts/ttf/DejaVuLGCSerif.ttf");
        String absoluteFilePath = file.toURI().toURL().toExternalForm();
        FontResolver resolver = FontManager.createMinimalFontResolver(useComplexScriptFeatures);
        String fontName = "Deja Vu";
        boolean embedded = false;
        boolean useKerning = true;

        TTFFontLoader fontLoader = new TTFFontLoader(absoluteFilePath, fontName, embedded,
View Full Code Here

Examples of org.apache.fop.fonts.FontResolver

            log.trace("no configuration found for " + renderer);
            return;
        }

        PrintRenderer printRenderer = (PrintRenderer)renderer;
        FontResolver fontResolver = printRenderer.getFontResolver();

        FontEventListener listener = new FontEventAdapter(
                renderer.getUserAgent().getEventBroadcaster());
        List<EmbedFontInfo> embedFontInfoList = buildFontList(cfg, fontResolver, listener);
        printRenderer.addFontList(embedFontInfoList);
View Full Code Here

Examples of org.apache.fop.fonts.FontResolver

        List<FontCollection> fontCollections = new ArrayList<FontCollection>();
        fontCollections.add(new Base14FontCollection(fontManager.isBase14KerningEnabled()));

        Configuration cfg = super.getRendererConfig(documentHandler.getMimeType());
        if (cfg != null) {
            FontResolver fontResolver = new DefaultFontResolver(userAgent);
            FontEventListener listener = new FontEventAdapter(
                    userAgent.getEventBroadcaster());
            List<EmbedFontInfo> fontList = buildFontList(cfg, fontResolver, listener);
            fontCollections.add(new CustomFontCollection(fontResolver, fontList,
                                userAgent.isComplexScriptFeaturesEnabled()));
View Full Code Here

Examples of org.apache.fop.fonts.FontResolver

        fontCollections.add(new Base14FontCollection(java2DFontMetrics));
        fontCollections.add(new InstalledFontCollection(java2DFontMetrics));

        Configuration cfg = super.getRendererConfig(documentHandler.getMimeType());
        if (cfg != null) {
            FontResolver fontResolver = new DefaultFontResolver(userAgent);
            FontEventListener listener = new FontEventAdapter(
                    userAgent.getEventBroadcaster());
            List fontList = buildFontList(cfg, fontResolver, listener);
            fontCollections.add(new ConfiguredFontCollection(fontResolver, fontList,
                                userAgent.isComplexScriptFeaturesEnabled()));
View Full Code Here

Examples of org.apache.fop.fonts.FontResolver

        fontCollections.add(new Base14FontCollection(java2DFontMetrics));
        fontCollections.add(new InstalledFontCollection(java2DFontMetrics));

        Configuration cfg = super.getRendererConfig(documentHandler.getMimeType());
        if (cfg != null) {
            FontResolver fontResolver = new DefaultFontResolver(userAgent);
            FontEventListener listener = new FontEventAdapter(
                    userAgent.getEventBroadcaster());
            List fontList = buildFontList(cfg, fontResolver, listener);
            fontCollections.add(new ConfiguredFontCollection(fontResolver, fontList,
                                userAgent.isComplexScriptFeaturesEnabled()));
View Full Code Here

Examples of org.apache.fop.fonts.FontResolver

     */
    public static FontInfo createFontInfo(Configuration cfg, boolean useComplexScriptFeatures)
        throws FOPException {
        FontInfo fontInfo = new FontInfo();
        final boolean strict = false;
        FontResolver fontResolver = FontManager.createMinimalFontResolver(useComplexScriptFeatures);
        //TODO The following could be optimized by retaining the FontManager somewhere
        FontManager fontManager = new FontManager();
        if (cfg != null) {
            FontManagerConfigurator fmConfigurator = new FontManagerConfigurator(cfg);
            fmConfigurator.configure(fontManager, strict);
        }

        List fontCollections = new java.util.ArrayList();
        fontCollections.add(new Base14FontCollection(fontManager.isBase14KerningEnabled()));

        if (cfg != null) {
            //TODO Wire in the FontEventListener
            FontEventListener listener = null; //new FontEventAdapter(eventBroadcaster);
            FontInfoConfigurator fontInfoConfigurator
                = new FontInfoConfigurator(cfg, fontManager, fontResolver, listener, strict);
            List/*<EmbedFontInfo>*/ fontInfoList = new java.util.ArrayList/*<EmbedFontInfo>*/();
            fontInfoConfigurator.configure(fontInfoList);
            fontCollections.add(new CustomFontCollection(fontResolver, fontInfoList,
                                fontResolver.isComplexScriptFeaturesEnabled()));
        }
        fontManager.setup(fontInfo,
                (FontCollection[])fontCollections.toArray(
                        new FontCollection[fontCollections.size()]));
        return fontInfo;
View Full Code Here

Examples of org.apache.fop.fonts.FontResolver

     *
     * @param inFontInfo  font info to set up
     */
    public void setupFontInfo(FontInfo inFontInfo) {
        this.fontInfo = inFontInfo;
        FontResolver resolver = new DefaultFontResolver(userAgent);
        FontSetup.setup(fontInfo, fontList, resolver,
                userAgent.getFactory().isBase14KerningEnabled());
    }
View Full Code Here

Examples of org.apache.fop.fonts.FontResolver

     * @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();

            //TODO Make use of fontBaseURL, font substitution and referencing configuration
            //Requires a change to the expected configuration layout
View Full Code Here

Examples of org.apache.fop.fonts.FontResolver

        fontCollections.add(new Base14FontCollection(graphics2D));
        fontCollections.add(new InstalledFontCollection(graphics2D));

        Configuration cfg = super.getRendererConfig(documentHandler.getMimeType());
        if (cfg != null) {
            FontResolver fontResolver = new DefaultFontResolver(userAgent);
            FontEventListener listener = new FontEventAdapter(
                    userAgent.getEventBroadcaster());
            List fontList = buildFontList(cfg, fontResolver, listener);
            fontCollections.add(new ConfiguredFontCollection(fontResolver, fontList));
        }
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.