Package com.itextpdf.text.pdf

Examples of com.itextpdf.text.pdf.BaseFont


        Font font = label.getFont();

        setFillColor(label.getColor());

        try {
            BaseFont bf = genBaseFont(font);
            float ascent = bf.getAscentPoint(label.getValue(), font.getSize());
            float descent = bf.getDescentPoint(label.getValue(), font.getSize());
            float textHeight = (ascent - descent) / 2f;

            cb.beginText();
            cb.setFontAndSize(bf, font.getSize());
            cb.showTextAligned(PdfContentByte.ALIGN_CENTER, label.getValue(), p.getX(), -p.getY() - textHeight, 0);
View Full Code Here


        Font font = label.getFont();

        setFillColor(label.getColor());

        try {
            BaseFont bf = genBaseFont(font);

            cb.beginText();
            cb.setFontAndSize(bf, font.getSize());
            cb.showTextAligned(PdfContentByte.ALIGN_CENTER, label.getValue(), p.getX(), -p.getY(), (float) (Math.toDegrees(-label.getAngle())));
            cb.endText();
View Full Code Here

        Font font = miniLabel.getFont();

        setFillColor(miniLabel.getColor());

        try {
            BaseFont bf = genBaseFont(font);

            cb.beginText();
            cb.setFontAndSize(bf, font.getSize());
            cb.showTextAligned(miniLabel.getHAlign().toIText(), miniLabel.getValue(), p.getX(), -p.getY(), (float) (Math.toDegrees(-miniLabel.getAngle())));
            cb.endText();
View Full Code Here

  private void prepareContent() {
    Document document = null;

    try {
      BaseFont bf = BaseFont.createFont(BaseFont.TIMES_ROMAN, BaseFont.CP1250,
          BaseFont.EMBEDDED);
      Font f = new Font(bf, 12, Font.NORMAL);

      document = new Document(PageSize.A4, 10, 10, 50, 50);
      PdfWriter instance = PdfWriter.getInstance(document, os);
View Full Code Here

        }
        boolean italic = fs.isFontItalic();
        if (italicToggle) {
            italic = !italic;
        }
        BaseFont bf = italic ? (bold ? ff.getBoldItalicFont() : ff.getItalicFont()) : (bold ? ff.getBoldFont() : ff.getRegularFont());
        return bf;
    }
View Full Code Here

    }

    public Font getFont()
            throws FB2toPDFException {

        BaseFont bf = getBaseFont();
        float points = getFontSize();
        if (halfSizeToggle) {
            points = points / 2;
        }
        final Font font = new Font(bf, points);
View Full Code Here

    }

    public Font getTinyFont()
            throws FB2toPDFException {
        FontFamily ff = getFontFamily();
        BaseFont bf = ff.getRegularFont();

        return new Font(bf, 0.01f);
    }
View Full Code Here

        baseFont = getCachedBaseFont(f);
    }

    private BaseFont getCachedBaseFont(Font f) {
        synchronized (baseFonts) {
            BaseFont bf = baseFonts.get(f.getFontName());
            if (bf == null) {
                bf = fontMapper.awtToPdf(f);
                baseFonts.put(f.getFontName(), bf);
            }
            return bf;
View Full Code Here

            }
            if (style != Font.UNDEFINED && found) {
                style &= ~fs;
            }
        }
        BaseFont basefont = null;
        try {
            try {
                // the font is a type 1 font or CJK font
                basefont = BaseFont.createFont(fontname, encoding, embedded, cached, null, null, true);
            }
View Full Code Here

                for (int i = 0; i < names.length; i++) {
                    register(path + "," + i);
                }
            }
            else if (path.toLowerCase().endsWith(".afm") || path.toLowerCase().endsWith(".pfm")) {
                BaseFont bf = BaseFont.createFont(path, BaseFont.CP1252, false);
                String fullName = bf.getFullFontName()[0][3].toLowerCase();
                String familyName = bf.getFamilyFontName()[0][3].toLowerCase();
                String psName = bf.getPostscriptFontName().toLowerCase();
                registerFamily(familyName, fullName, null);
                trueTypeFonts.put(psName, path);
                trueTypeFonts.put(fullName, path);
            }
        }
View Full Code Here

TOP

Related Classes of com.itextpdf.text.pdf.BaseFont

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.