Example usage for org.apache.pdfbox.pdmodel.font.encoding GlyphList getAdobeGlyphList

List of usage examples for org.apache.pdfbox.pdmodel.font.encoding GlyphList getAdobeGlyphList

Introduction

In this page you can find the example usage for org.apache.pdfbox.pdmodel.font.encoding GlyphList getAdobeGlyphList.

Prototype

public static GlyphList getAdobeGlyphList() 

Source Link

Document

Returns the Adobe Glyph List (AGL).

Usage

From source file:com.repeatability.pdf.PDFTextStreamEngine.java

License:Apache License

/**
 * Constructor.//from   w  w w.  j  av a2  s  .c  om
 */
PDFTextStreamEngine() throws IOException {
    addOperator(new BeginText());
    addOperator(new Concatenate());
    addOperator(new DrawObject()); // special text version
    addOperator(new EndText());
    addOperator(new SetGraphicsStateParameters());
    addOperator(new Save());
    addOperator(new Restore());
    addOperator(new NextLine());
    addOperator(new SetCharSpacing());
    addOperator(new MoveText());
    addOperator(new MoveTextSetLeading());
    addOperator(new SetFontAndSize());
    addOperator(new ShowText());
    addOperator(new ShowTextAdjusted());
    addOperator(new SetTextLeading());
    addOperator(new SetMatrix());
    addOperator(new SetTextRenderingMode());
    addOperator(new SetTextRise());
    addOperator(new SetWordSpacing());
    addOperator(new SetTextHorizontalScaling());
    addOperator(new ShowTextLine());
    addOperator(new ShowTextLineAndSpace());

    // load additional glyph list for Unicode mapping
    String path = "org/apache/pdfbox/resources/glyphlist/additional.txt";
    InputStream input = GlyphList.class.getClassLoader().getResourceAsStream(path);
    glyphList = new GlyphList(GlyphList.getAdobeGlyphList(), input);
}

From source file:org.apache.fop.render.pdf.pdfbox.FOPPDFMultiByteFont.java

License:Apache License

private Map<Integer, String> getStrings(CFFFont ff) throws IOException {
    CFFCharset cs = ff.getCharset();/*from w  w w  .j a  va 2  s  .  c  o m*/
    Map<Integer, String> strings = new LinkedHashMap<Integer, String>();
    for (int gid = 0; gid < 256; gid++) {
        int sid = cs.getCIDForGID(gid);
        if (sid != 0) {
            strings.put(sid, GlyphList.getAdobeGlyphList().toUnicode(readString(sid)));
        }
    }
    return strings;
}