Examples of CFFParser


Examples of org.apache.fontbox.cff.CFFParser

            return;
        }

        byte[] cffBytes = loadBytes();

        CFFParser cffParser = new CFFParser();
        List<CFFFont> fonts = cffParser.parse(cffBytes);

        this.cffFont = (CFFFont)fonts.get(0);

        CFFEncoding encoding = this.cffFont.getEncoding();
        PDFEncoding pdfEncoding = new PDFEncoding(encoding);
View Full Code Here

Examples of org.apache.fontbox.cff.CFFParser

        boolean fontIsDamaged = false;
        CFFType1Font cffEmbedded = null;
        try
        {
            // note: this could be an OpenType file, fortunately CFFParser can handle that
            CFFParser cffParser = new CFFParser();
            cffEmbedded = (CFFType1Font)cffParser.parse(bytes).get(0);
        }
        catch (IOException e)
        {
            LOG.error("Can't read the embedded Type1C font " + getName(), e);
            fontIsDamaged = true;
View Full Code Here

Examples of org.apache.fontbox.cff.CFFParser

            InputStream input = null;
            try
            {
                input = new FileInputStream(file);
                byte[] bytes = IOUtils.toByteArray(input);
                CFFParser cffParser = new CFFParser();
                cff = cffParser.parse(bytes).get(0);
                cffFonts.put(postScriptName, cff);
                if (LOG.isDebugEnabled())
                {
                    LOG.debug("Loaded " + postScriptName + " from " + file);
                }
View Full Code Here

Examples of org.apache.fontbox.cff.CFFParser

        }

        if (bytes != null)
        {
            // embedded
            CFFParser cffParser = new CFFParser();
            boolean fontIsDamaged = false;
            CFFFont cffFont = null;
            try
            {
                cffFont = cffParser.parse(bytes).get(0);
            }
            catch (IOException e)
            {
                LOG.error("Can't read the embedded CFF font " + fd.getFontName(), e);
                fontIsDamaged = true;
View Full Code Here

Examples of org.apache.fontbox.cff.CFFParser

     */
    public void read(TrueTypeFont ttf, TTFDataStream data) throws IOException
    {
        byte[] bytes = data.read((int)getLength());

        CFFParser parser = new CFFParser();
        cffFont = parser.parse(bytes).get(0);

        initialized = true;
    }
View Full Code Here

Examples of org.apache.fontbox.cff.CFFParser

        /*
         * try to load the font using the java.awt.font object. if the font is invalid, an exception will be thrown
         */
        try
        {
            CFFParser cffParser = new CFFParser();
            List<CFFFont> lCFonts = cffParser.parse(fontFile.getByteArray());
            if (lCFonts == null || lCFonts.isEmpty())
            {
                this.fContainer.push(new ValidationError(ERROR_FONTS_CID_DAMAGED, "The FontFile can't be read"));
            }
            fContainer.setlCFonts(lCFonts);
View Full Code Here

Examples of org.apache.fontbox.cff.CFFParser

     */
    protected void processFontFile3(PDFontDescriptorDictionary fontDescriptor, PDStream fontFile)
    {
        try
        {
            CFFParser cffParser = new CFFParser();
            List<CFFFont> lCFonts = cffParser.parse(fontFile.getByteArray());
            if (lCFonts == null || lCFonts.isEmpty())
            {
                this.fContainer.push(new ValidationError(ERROR_FONTS_CID_DAMAGED, "The FontFile can't be read"));
            }
            this.fContainer.setCFFFontObjects(lCFonts);
View Full Code Here

Examples of org.apache.fontbox.cff.CFFParser

    private void load() throws IOException
    {
        byte[] cffBytes = loadBytes();

        CFFParser cffParser = new CFFParser();
        List<CFFFont> fonts = cffParser.parse(cffBytes);

        String baseFontName = getBaseFont();
        if (fonts.size() > 1 && baseFontName != null)
        {
            for (CFFFont font: fonts)
View Full Code Here

Examples of org.apache.fontbox.cff.CFFParser

    private void load() throws IOException
    {
        byte[] cffBytes = loadBytes();

        CFFParser cffParser = new CFFParser();
        List<CFFFont> fonts = cffParser.parse(cffBytes);

        this.cffFont = (CFFFont)fonts.get(0);

        CFFEncoding encoding = this.cffFont.getEncoding();
        PDFEncoding pdfEncoding = new PDFEncoding(encoding);
View Full Code Here

Examples of org.apache.fontbox.cff.CFFParser

    private void load() throws IOException
    {
        byte[] cffBytes = loadBytes();

        CFFParser cffParser = new CFFParser();
        List<CFFFont> fonts = cffParser.parse(cffBytes);

        this.cffFont = (CFFFont)fonts.get(0);

        CFFEncoding encoding = this.cffFont.getEncoding();
        PDFEncoding pdfEncoding = new PDFEncoding(encoding);
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.