Package org.apache.fop.fonts

Examples of org.apache.fop.fonts.CustomFont


                ((PDFFontType0)font).setDescendantFonts(cidFont);
            } else {
                int firstChar = 0;
                int lastChar = 255;
                if (metrics instanceof CustomFont) {
                    CustomFont cf = (CustomFont)metrics;
                    firstChar = cf.getFirstChar();
                    lastChar = cf.getLastChar();
                }
                font.setWidthMetrics(firstChar,
                                     lastChar,
                                     makeArray(metrics.getWidths()));
            }
View Full Code Here


        if (!(tempFont instanceof CustomFont)) {
            throw new IllegalArgumentException(
                      "FontDescriptor must be instance of CustomFont, but is a "
                       + desc.getClass().getName());
        }
        CustomFont font = (CustomFont)tempFont;

        InputStream in = null;
        try {
            // Get file first
            if (font.getEmbedFileName() != null) {
                try {
                    in = getDocument().resolveURI(font.getEmbedFileName());
                } catch (Exception e) {
                    log.error("Failed to embed fontfile: "
                                       + font.getEmbedFileName()
                                       + "(" + e.getMessage() + ")");
                }
            }

            // Get resource
            if (in == null && font.getEmbedResourceName() != null) {
                try {
                    in = new java.io.BufferedInputStream(
                            this.getClass().getResourceAsStream(
                                font.getEmbedResourceName()));
                } catch (Exception e) {
                    log.error(
                                         "Failed to embed fontresource: "
                                       + font.getEmbedResourceName()
                                       + "(" + e.getMessage() + ")");
                }
            }

            if (in == null) {
View Full Code Here

TOP

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

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.