Package com.lowagie.text.pdf

Examples of com.lowagie.text.pdf.BaseFont


    if (style == UNDEFINED) {
      style = NORMAL;
    }
    String fontName = BaseFont.HELVETICA;
    String encoding = BaseFont.WINANSI;
    BaseFont cfont = null;
    switch (family) {
    case COURIER:
      switch (style & BOLDITALIC) {
      case BOLD:
        fontName = BaseFont.COURIER_BOLD;
View Full Code Here


            if (font.getColor() != null) {
                writeCssProperty(Markup.CSS_KEY_COLOR, HtmlEncoder.encode(font.getColor()));
            }
           
            int fontstyle = font.getStyle();
            BaseFont bf = font.getBaseFont();
            if (bf != null) {
                String ps = bf.getPostscriptFontName().toLowerCase();
                if (ps.indexOf("bold") >= 0) {
                    if (fontstyle == LwgFont.UNDEFINED)
                        fontstyle = 0;
                    fontstyle |= LwgFont.BOLD;
                }
View Full Code Here

            document.open();
           
            // step 4: we grab the ContentByte and do some stuff with it
            PdfContentByte cb = writer.getDirectContent();
           
            BaseFont bf = BaseFont.createFont("Times-Roman", "winansi", false);
           
            // step 5: we create some PdfPatternPainter instances for drawing path, text, or placing image
           
            // LwgImage instance to be placed in PdfPatternPainter canvas. Any nice one?
            LwgImage img = LwgImage.getInstance("pngnow.png");
View Full Code Here

           
            // step 3: we open the document
            document.open();
           
            // step 4: we add content to the document
            BaseFont bfComic = BaseFont.createFont("c:\\windows\\fonts\\comic.ttf", BaseFont.IDENTITY_H, BaseFont.EMBEDDED);
            LwgFont font = new LwgFont(bfComic, 12);
            String text1 = "This is the quite popular True Type font 'Comic'.";
            String text2 = "Some greek characters: \u0393\u0394\u03b6";
            String text3 = "Some cyrillic characters: \u0418\u044f";
            document.add(new Paragraph(text1, font));
View Full Code Here

   */
  public static void main(String[] args) {
    System.out.println("Listing Font properties");
    try {
      BufferedWriter out = new BufferedWriter(new FileWriter("encodings.txt"));
      BaseFont bfComic = BaseFont.createFont("c:\\windows\\fonts\\comicbd.ttf", BaseFont.CP1252, BaseFont.NOT_EMBEDDED);
      out.write("postscriptname: " + bfComic.getPostscriptFontName());
      out.write("\r\n\r\n");
          String[] codePages = bfComic.getCodePagesSupported();
          out.write("All available encodings:\n\n");
          for (int i = 0; i < codePages.length; i++) {
            out.write(codePages[i]);
            out.write("\r\n");
          }
View Full Code Here

            document.open();

            PdfShading shading = PdfShading.simpleAxial(writer, 100, 100, 400, 100, Color.red, Color.cyan);
            PdfShadingPattern shadingPattern = new PdfShadingPattern(shading);
            PdfContentByte cb = writer.getDirectContent();
            BaseFont bf = BaseFont.createFont(BaseFont.TIMES_BOLD, BaseFont.WINANSI, false);
            cb.setShadingFill(shadingPattern);
            cb.beginText();
            cb.setTextMatrix(100, 100);
            cb.setFontAndSize(bf, 40);
            cb.showText("Look at this text!");
View Full Code Here

   */
  public static void main(String[] args) {
    try
    {
      BufferedWriter out = new BufferedWriter(new FileWriter("fullfontname_arialbi.txt"));
          BaseFont bf = BaseFont.createFont("c:\\windows\\fonts\\arialbi.ttf", "winansi", BaseFont.NOT_EMBEDDED);
      out.write("postscriptname: " + bf.getPostscriptFontName());
      out.write("\r\n\r\n");
          String names[][] = bf.getFullFontName();
          out.write("\n\nListing the full font name:\n\n");
          for (int k = 0; k < names.length; ++k) {
              if (names[k][0].equals("3") && names[k][1].equals("1")) // Microsoft encoding
                  out.write(names[k][3] + "\r\n");
          }
View Full Code Here

           
            // step 3: we open the document
            document.open();
           
            // step 4: we add content to the document
            BaseFont bfComic = BaseFont.createFont("c:\\windows\\fonts\\comicbd.ttf", BaseFont.CP1252, BaseFont.NOT_EMBEDDED);
            LwgFont font = new LwgFont(bfComic, 12);
            String text1 = "This is the quite popular True Type font 'Comic'.";
            document.add(new Paragraph(text1, font));
        }
        catch(DocumentException de) {
View Full Code Here

                char tb[];
                if (z == 0)
                    tb = SYMBOL_TABLE;
                else
                    tb = DINGBATS_TABLE;
                BaseFont bf;
                bf = BaseFont.createFont(file, file, true);
                LwgFont f = new LwgFont(bf, 12);
                LwgPdfPTable table = new LwgPdfPTable(16);
                table.setWidthPercentage(100);
                table.getDefaultCell().setBorderWidth(1);
                table.getDefaultCell().setHorizontalAlignment(LwgElement.ALIGN_CENTER);
                for (int k = 0; k < tb.length; ++k) {
                    char c = tb[k];
                    if (bf.charExists(c)) {
                        LwgPhrase ph = new LwgPhrase(12, new String(new char[]{c}), f);
                        ph.add(new LwgPhrase(12, "\n\n" + cst(c), hex));
                        table.add(ph);
                    }
                    else {
View Full Code Here

           
            // step 3: we open the document
            document.open();
           
            // step 4: we add content to the document
            BaseFont helvetica = BaseFont.createFont(BaseFont.HELVETICA, BaseFont.CP1252, BaseFont.EMBEDDED);
            LwgFont font = new LwgFont(helvetica, 12, LwgFont.NORMAL);
            Chunk chunk = new Chunk("Sponsor this example and send me 1\u20ac. These are some special characters: \u0152\u0153\u0160\u0161\u0178\u017D\u0192\u02DC\u2020\u2021\u2030", font);
            document.add(chunk);
        }
        catch(DocumentException de) {
View Full Code Here

TOP

Related Classes of com.lowagie.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.