Package org.axsl.font.output

Examples of org.axsl.font.output.FontPdf


    /**
     * {@inheritDoc}
     */
    public String getFontName(final FontUse fontUse) {
        final FontPdf fontPdf = (FontPdf) fontUse.getFontOutput(Mime.PDF.getMimeString());
        final PDFFont pdfFont = this.getPdfFont(fontPdf);
        return pdfFont.getName();
    }
View Full Code Here


    /**
     * {@inheritDoc}
     */
    protected void finalizeStreamContent() throws PdfException {
        final FontPdf fontPDF = (FontPdf) this.font.getFontOutput(
                "application/pdf");
        final byte[] fontFileStream = fontPDF.getContents();
        /* The first filter specified is the last one applied. */
        addFilter("ascii-85");
        addFilter("flate");
        setData(fontFileStream);
    }
View Full Code Here

    /**
     * {@inheritDoc}
     */
    protected String specialStreamDictEntries() {
        final FontPdf fontPDF = (FontPdf) this.font.getFontOutput(
                "application/pdf");
        return fontPDF.getPdfFontFileStreamAdditional();
    }
View Full Code Here

        final StringBuilder builder = new StringBuilder();
        writeCIDInit(builder);
        writeCIDSystemInfo(builder);
        writeVersionTypeName(builder);
        writeCodeSpaceRange(builder);
        final FontPdf fontPDF = (FontPdf) this.fsFont.getFontOutput(
                "application/pdf");
        if (this.fsFont.getFont().isEmbeddable()) {
            final String bfEntries = fontPDF.getToUnicodeBf();
            builder.append(bfEntries);
            writeBFEntries(builder);
        }
        writeWrapUp(builder);
View Full Code Here

    /**
     * {@inheritDoc}
     */
    public void drawString(final String s, final float x, final float y) {
        FontPdf font;
        float size;
        if (this.overrideFont == null) {
            font = getImplicitFont();
            size = getFont().getSize();
        } else {
            font = this.overrideFont;
            size = this.overrideFontSize;
            this.overrideFont = null;
        }

        if (font != this.getGraphicsState().font
                || (size != this.getGraphicsState().fontSize)) {
            this.getGraphicsState().font = font;
            this.getGraphicsState().fontSize = size;
            final String fontName = this.pdfContext.getFontName(font.getFontUse());
            this.write("/" + fontName + " " + size + " Tf");
        }

        this.saveGraphicsState();

        final Shape imclip = getClip();
        writeClip(imclip);
        Color c = getColor();
        applyColor(c, true);
        c = getBackground();
        applyColor(c, false);

        this.write("BT");

        final AffineTransform trans = getTransform();
        trans.translate(x, y);
        final double[] vals = new double[PsUtil.MATRIX_QTY_ELEMENTS];
        trans.getMatrix(vals);

        final String matrixString = octalMatrixToString(vals);
        this.write(matrixString + "cm");
        this.write("1 0 0 -1 0 0 Tm ");

        final String outputString = font.textToPdf(s, true);
        this.write(outputString);

        this.write("ET");
        this.restoreGraphicsState();
    }
View Full Code Here

            } catch (final FontException e) {
                /* We can't find a font for this character, so skip it. */
                continue;
            }
            final float size = fontSize.floatValue();
            final FontPdf fontPdf = (FontPdf) font.getFontOutput(Mime.PDF.getMimeString());
            if ((fontPdf != this.getGraphicsState().font)
                    || (size != this.getGraphicsState().fontSize)) {
                this.getGraphicsState().font = fontPdf;
                this.getGraphicsState().fontSize = size;
                final String fontName = this.pdfContext.getFontName(font);
View Full Code Here

                        org.axsl.font.Font.Stretch.NORMAL,
                        fsize * WKConstants.MILLIPOINTS_PER_POINT,
                        ' ');
                if (font != null) {
                    if (g2d instanceof PDFGraphics2D) {
                        final FontPdf fontPdf = (FontPdf) font.getFontOutput(Mime.PDF.getMimeString());
                        ((PDFGraphics2D) g2d).setOverrideFontState(fontPdf, fsize);
                    }
                    return font;
                }
            }
View Full Code Here

    /**
     * {@inheritDoc}
     */
    public String toPDF() {
        final Font font = this.font.getFont().getFontUse().getFont();
        final FontPdf fontPDF = this.font.getFont();
        final StringBuilder p = new StringBuilder();
        p.append(this.pdfID() + EOL);
        p.append("<< /Type /FontDescriptor" + EOL);
        p.append("/FontName /" + this.font.getBaseFont());
        p.append(EOL + "/FontBBox ");
        p.append(new PDFRectangle(fontPDF.getFontBoundingBox()).toPDFString());
        p.append(EOL + "/Flags ");
        p.append(fontPDF.getFlags());
        p.append(EOL + "/CapHeight ");
        p.append(font.getCapHeight(WKConstants.MILLIPOINTS_PER_POINT));
        p.append(EOL + "/Ascent ");
        p.append(font.getAscender(WKConstants.MILLIPOINTS_PER_POINT));
        p.append(EOL + "/Descent ");
        p.append(font.getDescender(WKConstants.MILLIPOINTS_PER_POINT));
        p.append(EOL + "/ItalicAngle ");
        p.append(fontPDF.getItalicAngleFormatted());
        p.append(EOL + "/StemV ");
        p.append(font.getStemV());
        // optional fields
        if (this.stemH != 0) {
            p.append(EOL + "/StemH ");
View Full Code Here

            final CharSequence text, final int startIndex, final int size,
            final boolean kern) throws PdfException {
        if (size < 1) {
            return;
        }
        final FontPdf fontPdf = (FontPdf) fontUse.getFontOutput(Mime.PDF.getMimeString());
        final PdfFont pdfFont = this.getPDFDocument().getPdfFont(fontPdf);
        getContentStream().setFont(pdfFont, toPoints(area.traitFontSize()));

        /* Paint the text. */
        final CharSequence textToWrite = text.subSequence(startIndex, startIndex + size);
View Full Code Here

TOP

Related Classes of org.axsl.font.output.FontPdf

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.