Examples of EmbedFontInfo


Examples of org.apache.fop.fonts.EmbedFontInfo

                    if (this.eventListener != null) {
                        this.eventListener.fontLoadingErrorAtAutoDetection(this, embedUrl, e);
                    }
                    continue;
                }
                EmbedFontInfo fi = getFontInfoFromCustomFont(fontUrl, customFont, fontCache);
                if (fi != null) {
                    embedFontInfoList.add(fi);
                }
            }
            return (EmbedFontInfo[])embedFontInfoList.toArray(
                    new EmbedFontInfo[embedFontInfoList.size()]);
        } else {
            // The normal case
            try {
                customFont = FontLoader.loadFont(fontUrl, null, true, EncodingMode.AUTO, resolver);
                if (this.eventListener != null) {
                    customFont.setEventListener(this.eventListener);
                }
            } catch (Exception e) {
                if (fontCache != null) {
                    fontCache.registerFailedFont(embedUrl, fileLastModified);
                }
                if (this.eventListener != null) {
                    this.eventListener.fontLoadingErrorAtAutoDetection(this, embedUrl, e);
                }
                return null;
            }
            EmbedFontInfo fi = getFontInfoFromCustomFont(fontUrl, customFont, fontCache);
            if (fi != null) {
                return new EmbedFontInfo[] {fi};
            } else {
                return null;
            }
View Full Code Here

Examples of org.apache.fop.fonts.EmbedFontInfo

        }
        String internalName = null;

        for (int i = 0; i < embedFontInfoList.size(); i++) {

            EmbedFontInfo configFontInfo = (EmbedFontInfo) embedFontInfoList.get(i);
            String fontFile = configFontInfo.getEmbedFile();
            internalName = "F" + num;
            num++;
            try {
                FontMetricsMapper font = null;
                String metricsUrl = configFontInfo.getMetricsFile();
                // If the user specified an XML-based metrics file, we'll use it
                // Otherwise, calculate metrics directly from the font file.
                if (metricsUrl != null) {
                    LazyFont fontMetrics = new LazyFont(configFontInfo, fontResolver);
                    Source fontSource = fontResolver.resolve(configFontInfo.getEmbedFile());
                    font = new CustomFontMetricsMapper(fontMetrics, fontSource);
                } else {
                    CustomFont fontMetrics = FontLoader.loadFont(
                            fontFile, null, true, EncodingMode.AUTO,
                            configFontInfo.getKerning(), fontResolver);
                    font = new CustomFontMetricsMapper(fontMetrics);
                }

                fontInfo.addMetrics(internalName, font);

                List triplets = configFontInfo.getFontTriplets();
                for (int c = 0; c < triplets.size(); c++) {
                    FontTriplet triplet = (FontTriplet) triplets.get(c);

                    if (log.isDebugEnabled()) {
                        log.debug("Registering: " + triplet + " under " + internalName);
View Full Code Here

Examples of org.apache.fop.fonts.EmbedFontInfo

        }
        String internalName = null;

        for (int i = 0; i < embedFontInfoList.size(); i++) {

            EmbedFontInfo configFontInfo = (EmbedFontInfo) embedFontInfoList.get(i);
            String fontFile = configFontInfo.getEmbedFile();
            internalName = "F" + num;
            num++;
            try {
                FontMetricsMapper font = null;
                String metricsUrl = configFontInfo.getMetricsFile();
                // If the user specified an XML-based metrics file, we'll use it
                // Otherwise, calculate metrics directly from the font file.
                if (metricsUrl != null) {
                    LazyFont fontMetrics = new LazyFont(configFontInfo, fontResolver);
                    Source fontSource = fontResolver.resolve(configFontInfo.getEmbedFile());
                    font = new CustomFontMetricsMapper(fontMetrics, fontSource);
                } else {
                    CustomFont fontMetrics = FontLoader.loadFont(
                            fontFile, null, true, configFontInfo.getEmbeddingMode(),
                            EncodingMode.AUTO,
                            configFontInfo.getKerning(),
                            configFontInfo.getAdvanced(), fontResolver);
                    font = new CustomFontMetricsMapper(fontMetrics);
                }

                fontInfo.addMetrics(internalName, font);

                List<FontTriplet> triplets = configFontInfo.getFontTriplets();
                for (int c = 0; c < triplets.size(); c++) {
                    FontTriplet triplet = (FontTriplet) triplets.get(c);

                    if (log.isDebugEnabled()) {
                        log.debug("Registering: " + triplet + " under " + internalName);
View Full Code Here

Examples of org.apache.fop.fonts.EmbedFontInfo

        embedUrl = fontURL.toExternalForm();
        String subFontName = null;
        if (customFont instanceof MultiByteFont) {
            subFontName = ((MultiByteFont)customFont).getTTCName();
        }
        EmbedFontInfo fontInfo = new EmbedFontInfo(null, customFont.isKerningEnabled(),
                customFont.isAdvancedEnabled(), fontTripletList, embedUrl, subFontName);
        fontInfo.setPostScriptName(customFont.getFontName());
        if (fontCache != null) {
            fontCache.addFont(fontInfo);
        }
        return fontInfo;
    }
View Full Code Here

Examples of org.apache.fop.fonts.EmbedFontInfo

                    if (this.eventListener != null) {
                        this.eventListener.fontLoadingErrorAtAutoDetection(this, embedURL, e);
                    }
                    continue;
                }
                EmbedFontInfo fi = getFontInfoFromCustomFont(fontURL, customFont, fontCache);
                if (fi != null) {
                    embedFontInfoList.add(fi);
                }
            }
            return embedFontInfoList.toArray(
                    new EmbedFontInfo[embedFontInfoList.size()]);
        } else {
            // The normal case
            try {
                customFont = FontLoader.loadFont(fontURL, null, true, EmbeddingMode.AUTO,
                        EncodingMode.AUTO, resolver);
                if (this.eventListener != null) {
                    customFont.setEventListener(this.eventListener);
                }
            } catch (Exception e) {
                if (fontCache != null) {
                    fontCache.registerFailedFont(embedURL, fileLastModified);
                }
                if (this.eventListener != null) {
                    this.eventListener.fontLoadingErrorAtAutoDetection(this, embedURL, e);
                }
                return null;
            }
            EmbedFontInfo fi = getFontInfoFromCustomFont(fontURL, customFont, fontCache);
            if (fi != null) {
                return new EmbedFontInfo[] {fi};
            } else {
                return null;
            }
View Full Code Here

Examples of org.apache.fop.fonts.EmbedFontInfo

        embedUrl = fontURL.toExternalForm();
        String subFontName = null;
        if (customFont instanceof MultiByteFont) {
            subFontName = ((MultiByteFont)customFont).getTTCName();
        }
        EmbedFontInfo fontInfo = new EmbedFontInfo(null, customFont.isKerningEnabled(),
                customFont.isAdvancedEnabled(), fontTripletList, embedUrl, subFontName);
        fontInfo.setPostScriptName(customFont.getFontName());
        if (fontCache != null) {
            fontCache.addFont(fontInfo);
        }
        return fontInfo;
    }
View Full Code Here

Examples of org.apache.fop.fonts.EmbedFontInfo

                    if (this.eventListener != null) {
                        this.eventListener.fontLoadingErrorAtAutoDetection(this, embedURL, e);
                    }
                    continue;
                }
                EmbedFontInfo fi = getFontInfoFromCustomFont(fontURL, customFont, fontCache);
                if (fi != null) {
                    embedFontInfoList.add(fi);
                }
            }
            return embedFontInfoList.toArray(
                    new EmbedFontInfo[embedFontInfoList.size()]);
        } else {
            // The normal case
            try {
                customFont = FontLoader.loadFont(fontURL, null, true, EmbeddingMode.AUTO,
                        EncodingMode.AUTO, resolver);
                if (this.eventListener != null) {
                    customFont.setEventListener(this.eventListener);
                }
            } catch (Exception e) {
                if (fontCache != null) {
                    fontCache.registerFailedFont(embedURL, fileLastModified);
                }
                if (this.eventListener != null) {
                    this.eventListener.fontLoadingErrorAtAutoDetection(this, embedURL, e);
                }
                return null;
            }
            EmbedFontInfo fi = getFontInfoFromCustomFont(fontURL, customFont, fontCache);
            if (fi != null) {
                return new EmbedFontInfo[] {fi};
            } else {
                return null;
            }
View Full Code Here

Examples of org.apache.fop.fonts.EmbedFontInfo

        }
        String internalName = null;

        for (int i = 0; i < embedFontInfoList.size(); i++) {

            EmbedFontInfo configFontInfo = (EmbedFontInfo) embedFontInfoList.get(i);
            String fontFile = configFontInfo.getEmbedFile();
            internalName = "F" + num;
            num++;
            try {
                FontMetricsMapper font = null;
                String metricsUrl = configFontInfo.getMetricsFile();
                // If the user specified an XML-based metrics file, we'll use it
                // Otherwise, calculate metrics directly from the font file.
                if (metricsUrl != null) {
                    LazyFont fontMetrics = new LazyFont(configFontInfo, fontResolver);
                    Source fontSource = fontResolver.resolve(configFontInfo.getEmbedFile());
                    font = new CustomFontMetricsMapper(fontMetrics, fontSource);
                } else {
                    CustomFont fontMetrics = FontLoader.loadFont(
                            fontFile, null, true, configFontInfo.getEmbeddingMode(),
                            EncodingMode.AUTO,
                            configFontInfo.getKerning(),
                            configFontInfo.getAdvanced(), fontResolver);
                    font = new CustomFontMetricsMapper(fontMetrics);
                }

                fontInfo.addMetrics(internalName, font);

                List<FontTriplet> triplets = configFontInfo.getFontTriplets();
                for (int c = 0; c < triplets.size(); c++) {
                    FontTriplet triplet = (FontTriplet) triplets.get(c);

                    if (log.isDebugEnabled()) {
                        log.debug("Registering: " + triplet + " under " + internalName);
View Full Code Here

Examples of org.docx4j.fonts.fop.fonts.EmbedFontInfo

        embedUrl = fontUrl.toExternalForm();
        String subFontName = null;
        if (customFont instanceof MultiByteFont) {
            subFontName = ((MultiByteFont)customFont).getTTCName();
        }
        EmbedFontInfo fontInfo = new EmbedFontInfo(null, customFont.isKerningEnabled(),
                fontTripletList, embedUrl, subFontName);
        fontInfo.setFamilyNames(customFont.getFamilyNames());
        fontInfo.setPanose(customFont.getPanose());
        fontInfo.setPostScriptName(customFont.getFontName());
        fontInfo.setEmbeddable(customFont.isEmbeddable());
       
        if (fontCache != null) {
            fontCache.addFont(fontInfo);
        }
        return fontInfo;
View Full Code Here

Examples of org.docx4j.fonts.fop.fonts.EmbedFontInfo

                    if (this.eventListener != null) {
                        this.eventListener.fontLoadingErrorAtAutoDetection(this, embedUrl, e);
                    }
                    continue;
                }
                EmbedFontInfo fi = getFontInfoFromCustomFont(fontUrl, customFont, fontCache);
                if (fi != null) {
                    embedFontInfoList.add(fi);
                }
            }
            return (EmbedFontInfo[])embedFontInfoList.toArray(
                    new EmbedFontInfo[embedFontInfoList.size()]);
        } else {
            // The normal case
            try {
                customFont = FontLoader.loadFont(fontUrl, null, true, EncodingMode.AUTO, resolver);
                if (this.eventListener != null) {
                    customFont.setEventListener(this.eventListener);
                }
            } catch (Exception e) {
                if (fontCache != null) {
                    fontCache.registerFailedFont(embedUrl, fileLastModified);
                }
                if (this.eventListener != null) {
                    this.eventListener.fontLoadingErrorAtAutoDetection(this, embedUrl, e);
                }
                return null;
            }
            EmbedFontInfo fi = getFontInfoFromCustomFont(fontUrl, customFont, fontCache);
            if (fi != null) {
                return new EmbedFontInfo[] {fi};
            } else {
                return null;
            }
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.