Package org.apache.pdfbox.pdmodel.font.encoding

Examples of org.apache.pdfbox.pdmodel.font.encoding.Encoding


        int firstchar = 255;
        int lastchar = 0;

        // widths
        List<CharMetric> listmetric = metrics.getCharMetrics();
        Encoding encoding = getFontEncoding();
        int maxWidths = 256;
        List<Integer> widths = new ArrayList<Integer>(maxWidths);
        int zero = 250;

        Iterator<CharMetric> iter = listmetric.iterator();
View Full Code Here


            /*
             * only MacRomanEncoding or WinAnsiEncoding are allowed for a non symbolic font.
             */
            if (fd.isNonSymbolic())
            {
                Encoding encodingValue = ttFont.getEncoding();
                if (encodingValue == null
                        || !(encodingValue instanceof MacRomanEncoding || encodingValue instanceof WinAnsiEncoding))
                {
                    this.fontContainer.push(new ValidationError(ERROR_FONTS_ENCODING,
                            "The Encoding is invalid for the NonSymbolic TTF"));
View Full Code Here

                }
            }
            else if (encoding instanceof COSDictionary)
            {
                COSDictionary encodingDict = (COSDictionary)encoding;
                Encoding builtIn = null;
                if (!encodingDict.containsKey(COSName.BASE_ENCODING) && isSymbolic())
                {
                    builtIn = readEncodingFromFont();
                }
                Boolean symbolic = getSymbolicFlag();
View Full Code Here

        stream.getStream().setInt(COSName.LENGTH1, stream.getByteArray().length); // todo: wrong?
        stream.addCompression();

        // only support winansi encoding right now, should really
        // just use Identity-H with unicode mapping
        Encoding encoding = new WinAnsiEncoding(); // fixme: read encoding from TTF

        this.fontEncoding = encoding;
        dict.setItem(COSName.ENCODING, encoding.getCOSObject());

        // as the stream was close within the PDStream constructor, we have to recreate it
        InputStream stream2 = null;
        PDFontDescriptor fd;
        try
View Full Code Here

TOP

Related Classes of org.apache.pdfbox.pdmodel.font.encoding.Encoding

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.