Examples of BaseFont


Examples of com.lowagie.text.pdf.BaseFont

            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

Examples of com.lowagie.text.pdf.BaseFont

           
            // 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

Examples of com.lowagie.text.pdf.BaseFont

   */
  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

Examples of com.lowagie.text.pdf.BaseFont

            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

Examples of com.lowagie.text.pdf.BaseFont

   */
  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

Examples of com.lowagie.text.pdf.BaseFont

           
            // 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

Examples of com.lowagie.text.pdf.BaseFont

                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

Examples of com.lowagie.text.pdf.BaseFont

           
            // 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

Examples of com.lowagie.text.pdf.BaseFont

            document.open();
           
            // step 4:
           
            // we create some content
            BaseFont bf = BaseFont.createFont(BaseFont.COURIER, BaseFont.CP1252, BaseFont.NOT_EMBEDDED);
            LwgFont font = new LwgFont(bf, 11, LwgFont.NORMAL);
           
            LwgPhrase unicodes = new LwgPhrase(15, "UNI\n", font);
            LwgPhrase characters = new LwgPhrase(15, "\n", font);
            LwgPhrase names = new LwgPhrase(15, "NAME\n", font);
View Full Code Here

Examples of com.lowagie.text.pdf.BaseFont

            cb.lineTo(360, 504);
            cb.lineTo(72, 144);
            cb.lineTo(144, 288);
            cb.stroke();
           
            BaseFont bf = BaseFont.createFont(BaseFont.HELVETICA, BaseFont.CP1252, BaseFont.NOT_EMBEDDED);
            cb.beginText();
            cb.setFontAndSize(bf, 12);
            cb.showTextAligned(PdfContentByte.ALIGN_CENTER, "(3\" * 1.2, 10\" * .75)", 216 + 25, 720 + 5, 0);
            cb.showTextAligned(PdfContentByte.ALIGN_CENTER, "(5\" * 1.2, 5\" * .75)", 360 + 25, 360 + 5, 0);
            cb.showTextAligned(PdfContentByte.ALIGN_CENTER, "(5\" * 1.2, 7\" * .75)", 360 + 25, 504 + 5, 0);
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.