Examples of AFMParser


Examples of org.apache.fontbox.afm.AFMParser

                "org/apache/pdfbox/resources/afm/" + name + ".afm";
            InputStream afmStream = ResourceLoader.loadResource( resource );
            if( afmStream != null )
            {
                try {
                    AFMParser parser = new AFMParser( afmStream );
                    parser.parse();
                    metrics.put( name, parser.getResult() );
                } finally {
                    afmStream.close();
                }
            }
        } catch (Exception e) {
View Full Code Here

Examples of org.apache.fontbox.afm.AFMParser

        byte[] afmBytes = AFMFormatter.format(font);

        InputStream is = new ByteArrayInputStream(afmBytes);
        try
        {
            AFMParser afmParser = new AFMParser(is);
            afmParser.parse();

           return afmParser.getResult();
        }
        finally
        {
            is.close();
        }
View Full Code Here

Examples of org.apache.fontbox.afm.AFMParser

                        InputStream afmStream = ResourceLoader.loadResource( resource );
                        if( afmStream == null )
                        {
                            throw new IOException( "Can't handle font width:" + resource );
                        }
                        AFMParser parser = new AFMParser( afmStream );
                        parser.parse();
                        afm = parser.getResult();
                        afmObjects.put( name, afm );
                    }
                }
            }
        }
View Full Code Here

Examples of org.apache.fontbox.afm.AFMParser

                               InputStream pfbStream) throws IOException
    {
        dict.setItem(COSName.SUBTYPE, COSName.TYPE1);

        // read the afm
        AFMParser afmParser = new AFMParser(afmStream);
        metrics = afmParser.parse();
        this.fontEncoding = encodingFromAFM(metrics);

        // build font descriptor
        PDFontDescriptor fd = buildFontDescriptor(metrics);
View Full Code Here

Examples of org.apache.fontbox.afm.AFMParser

        if (url != null)
        {
            InputStream afmStream = url.openStream();
            try
            {
                AFMParser parser = new AFMParser(afmStream);
                FontMetrics metric = parser.parse();
                STANDARD14_AFM_MAP.put(fontName, metric);
            }
            finally
            {
                afmStream.close();
View Full Code Here

Examples of org.apache.fontbox.afm.AFMParser

            InputStream afmStream = ResourceLoader.loadResource( resource );
            if( afmStream != null )
            {
                try
                {
                    AFMParser parser = new AFMParser( afmStream );
                    parser.parse();
                    metrics.put( name, parser.getResult() );
                }
                finally
                {
                    afmStream.close();
                }
View Full Code Here

Examples of org.apache.fontbox.afm.AFMParser

        byte[] afmBytes = AFMFormatter.format(font);

        InputStream is = new ByteArrayInputStream(afmBytes);
        try
        {
            AFMParser afmParser = new AFMParser(is);
            afmParser.parse();

            FontMetric result = afmParser.getResult();

            // Replace default FontBBox value with a newly computed one
            BoundingBox bounds = result.getFontBBox();
            List<Integer> numbers = Arrays.asList(
                    Integer.valueOf((int)bounds.getLowerLeftX()),
View Full Code Here

Examples of org.apache.fontbox.afm.AFMParser

        }
        fontStream.addCompression();
        fd.setFontFile(fontStream);

        // read the afm
        AFMParser parser = new AFMParser(afm);
        parser.parse();
        metric = parser.getResult();
        setFontEncoding(afmToDictionary(new AFMEncoding(metric)));

        // set the values
        setBaseFont(metric.getFontName());
        fd.setFontName(metric.getFontName());
View Full Code Here

Examples of org.apache.fontbox.afm.AFMParser

    public void parse(InputStream stream, ContentHandler handler,
                      Metadata metadata, ParseContext context)
                      throws IOException, SAXException, TikaException {
       FontMetric fontMetrics;
       AFMParser  parser      = new AFMParser( stream );

       // Have FontBox process the file
       parser.parse();
       fontMetrics = parser.getResult();

       // Get the comments in the file to display in xhtml
       List<String> comments = fontMetrics.getComments();

       // Get the creation date
View Full Code Here

Examples of org.apache.fontbox.afm.AFMParser

            InputStream afmStream = ResourceLoader.loadResource( resource );
            if( afmStream != null )
            {
                try
                {
                    AFMParser parser = new AFMParser( afmStream );
                    parser.parse();
                    metrics.put( name, parser.getResult() );
                }
                finally
                {
                    afmStream.close();
                }
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.