Example usage for org.apache.pdfbox.pdmodel.font PDType1Font COURIER_BOLD_OBLIQUE

List of usage examples for org.apache.pdfbox.pdmodel.font PDType1Font COURIER_BOLD_OBLIQUE

Introduction

In this page you can find the example usage for org.apache.pdfbox.pdmodel.font PDType1Font COURIER_BOLD_OBLIQUE.

Prototype

PDType1Font COURIER_BOLD_OBLIQUE

To view the source code for org.apache.pdfbox.pdmodel.font PDType1Font COURIER_BOLD_OBLIQUE.

Click Source Link

Usage

From source file:TestPdfLayoutMgr.java

License:Apache License

@Test
public void testPdf() throws IOException, COSVisitorException {
    // Nothing happens without a PdfLayoutMgr.
    PdfLayoutMgr pageMgr = PdfLayoutMgr.newRgbPageMgr();

    // One inch is 72 document units.  40 is about a half-inch - enough margin to satisfy most
    // printers. A typical monitor has 72 dots per inch, so you can think of these as pixels
    // even though they aren't.  Things can be aligned right, center, top, or anywhere within
    // a "pixel".
    final float pMargin = 40;

    // A LogicalPage is a group of pages with the same settings.  When your contents scroll off
    // the bottom of a page, a new page is automatically created for you with the settings taken
    // from the LogicPage grouping. If you don't want a new page, be sure to stay within the
    // bounds of the current one!
    LogicalPage lp = pageMgr.logicalPageStart();

    // Set up some useful constants for later.
    final float tableWidth = lp.pageWidth() - (2 * pMargin);
    final float pageRMargin = pMargin + tableWidth;
    final float colWidth = tableWidth / 4f;
    final float[] colWidths = new float[] { colWidth + 10, colWidth + 10, colWidth + 10, colWidth - 30 };
    final Padding textCellPadding = Padding.of(2f);

    // Set up some useful styles for later
    final TextStyle heading = TextStyle.of(PDType1Font.HELVETICA_BOLD, 9.5f, WHITE);
    final CellStyle headingCell = CellStyle.of(BOTTOM_CENTER, textCellPadding, BLUE,
            BorderStyle.builder().left(LineStyle.of(BLUE)).right(LineStyle.of(WHITE)).build());
    final CellStyle headingCellR = CellStyle.of(BOTTOM_CENTER, textCellPadding, BLACK,
            BorderStyle.builder().left(LineStyle.of(WHITE)).right(LineStyle.of(BLACK)).build());

    final TextStyle regular = TextStyle.of(PDType1Font.HELVETICA, 9.5f, BLACK);
    final CellStyle regularCell = CellStyle.of(TOP_LEFT, textCellPadding, null, BorderStyle.builder()
            .left(LineStyle.of(BLACK)).right(LineStyle.of(BLACK)).bottom(LineStyle.of(BLACK)).build());

    // Let's draw three tables on our first landscape-style page grouping.

    // Draw the first table with lots of extra room to show off the vertical and horizontal
    // alignment.
    XyOffset xya = lp.tableBuilder(XyOffset.of(40f, lp.yPageTop())).addCellWidths(vec(120f, 120f, 120f))
            .textStyle(TextStyle.of(PDType1Font.COURIER_BOLD_OBLIQUE, 12f, YELLOW.brighter())).partBuilder()
            .cellStyle(CellStyle.of(BOTTOM_CENTER, Padding.of(2), decode("#3366cc"), BorderStyle.of(BLACK)))
            .rowBuilder().addTextCells("First", "Second", "Third").buildRow().buildPart().partBuilder()
            .cellStyle(CellStyle.of(MIDDLE_CENTER, Padding.of(2), decode("#ccffcc"), BorderStyle.of(DARK_GRAY)))
            .minRowHeight(120f).textStyle(TextStyle.of(PDType1Font.COURIER, 12f, BLACK)).rowBuilder()
            .cellBuilder().align(TOP_LEFT).add("Line 1", "Line two", "Line three").buildCell().cellBuilder()
            .align(TOP_CENTER).add("Line 1", "Line two", "Line three").buildCell().cellBuilder()
            .align(TOP_RIGHT).add("Line 1", "Line two", "Line three").buildCell().buildRow().rowBuilder()
            .cellBuilder().align(MIDDLE_LEFT).add("Line 1", "Line two", "Line three").buildCell().cellBuilder()
            .align(MIDDLE_CENTER).add("Line 1", "Line two", "Line three").buildCell().cellBuilder()
            .align(MIDDLE_RIGHT).add("Line 1", "Line two", "Line three").buildCell().buildRow().rowBuilder()
            .cellBuilder().align(BOTTOM_LEFT).add("Line 1", "Line two", "Line three").buildCell().cellBuilder()
            .align(BOTTOM_CENTER).add("Line 1", "Line two", "Line three").buildCell().cellBuilder()
            .align(BOTTOM_RIGHT).add("Line 1", "Line two", "Line three").buildCell().buildRow().buildPart()
            .buildTable();/*from  www  .  ja  v a 2  s . c o m*/

    // The second table uses the x and y offsets from the previous table to position it to the
    // right of the first.
    XyOffset xyb = lp.tableBuilder(XyOffset.of(xya.x() + 10, lp.yPageTop()))
            .addCellWidths(vec(100f, 100f, 100f))
            .textStyle(TextStyle.of(PDType1Font.COURIER_BOLD_OBLIQUE, 12f, YELLOW.brighter())).partBuilder()
            .cellStyle(CellStyle.of(BOTTOM_CENTER, Padding.of(2), decode("#3366cc"), BorderStyle.of(BLACK)))
            .rowBuilder().addTextCells("First", "Second", "Third").buildRow().buildPart().partBuilder()
            .cellStyle(CellStyle.of(MIDDLE_CENTER, Padding.of(2), decode("#ccffcc"), BorderStyle.of(DARK_GRAY)))
            .minRowHeight(100f).textStyle(TextStyle.of(PDType1Font.COURIER, 12f, BLACK)).rowBuilder()
            .cellBuilder().align(BOTTOM_RIGHT).add("Line 1", "Line two", "Line three").buildCell().cellBuilder()
            .align(BOTTOM_CENTER).add("Line 1", "Line two", "Line three").buildCell().cellBuilder()
            .align(BOTTOM_LEFT).add("Line 1", "Line two", "Line three").buildCell().buildRow().rowBuilder()
            .cellBuilder().align(MIDDLE_RIGHT).add("Line 1", "Line two", "Line three").buildCell().cellBuilder()
            .align(MIDDLE_CENTER).add("Line 1", "Line two", "Line three").buildCell().cellBuilder()
            .align(MIDDLE_LEFT).add("Line 1", "Line two", "Line three").buildCell().buildRow().rowBuilder()
            .cellBuilder().align(TOP_RIGHT).add("Line 1", "Line two", "Line three").buildCell().cellBuilder()
            .align(TOP_CENTER).add("Line 1", "Line two", "Line three").buildCell().cellBuilder().align(TOP_LEFT)
            .add("Line 1", "Line two", "Line three").buildCell().buildRow().buildPart().buildTable();

    // The third table uses the x and y offsets from the previous tables to position it to the
    // right of the first and below the second.  Negative Y is down.  This third table showcases
    // the way cells extend vertically (but not horizontally) to fit the text you put in them.
    lp.tableBuilder(XyOffset.of(xya.x() + 10, xyb.y() - 10)).addCellWidths(vec(100f, 100f, 100f))
            .textStyle(TextStyle.of(PDType1Font.COURIER_BOLD_OBLIQUE, 12f, YELLOW.brighter())).partBuilder()
            .cellStyle(CellStyle.of(BOTTOM_CENTER, Padding.of(2), decode("#3366cc"), BorderStyle.of(BLACK)))
            .rowBuilder().addTextCells("First", "Second", "Third").buildRow().buildPart().partBuilder()
            .cellStyle(CellStyle.of(MIDDLE_CENTER, Padding.of(2), decode("#ccffcc"), BorderStyle.of(DARK_GRAY)))
            .textStyle(TextStyle.of(PDType1Font.COURIER, 12f, BLACK)).rowBuilder().cellBuilder()
            .align(BOTTOM_RIGHT).add("Line 1").buildCell().cellBuilder().align(BOTTOM_CENTER)
            .add("Line 1", "Line two").buildCell().cellBuilder().align(BOTTOM_LEFT)
            .add("Line 1", "Line two", "[Line three is long enough to wrap]").buildCell().buildRow()
            .rowBuilder().cellBuilder().align(MIDDLE_RIGHT).add("Line 1", "Line two").buildCell().cellBuilder()
            .align(MIDDLE_CENTER).add("").buildCell().cellBuilder().align(MIDDLE_LEFT).add("Line 1").buildCell()
            .buildRow().rowBuilder().cellBuilder().align(TOP_RIGHT).add("L1").buildCell().cellBuilder()
            .align(TOP_CENTER).add("Line 1", "Line two").buildCell().cellBuilder().align(TOP_LEFT).add("Line 1")
            .buildCell().buildRow().buildPart().buildTable();

    lp.commit();

    // Let's do a portrait page now.  I just copied this from the previous page.
    lp = pageMgr.logicalPageStart(LogicalPage.Orientation.PORTRAIT);
    lp.tableBuilder(XyOffset.of(40f, lp.yPageTop())).addCellWidths(vec(120f, 120f, 120f))
            .textStyle(TextStyle.of(PDType1Font.COURIER_BOLD_OBLIQUE, 12f, YELLOW.brighter())).partBuilder()
            .cellStyle(CellStyle.of(BOTTOM_CENTER, Padding.of(2), decode("#3366cc"), BorderStyle.of(BLACK)))
            .rowBuilder().addTextCells("First", "Second", "Third").buildRow().buildPart().partBuilder()
            .cellStyle(CellStyle.of(MIDDLE_CENTER, Padding.of(2), decode("#ccffcc"), BorderStyle.of(DARK_GRAY)))
            .minRowHeight(120f).textStyle(TextStyle.of(PDType1Font.COURIER, 12f, BLACK)).rowBuilder()
            .cellBuilder().align(TOP_LEFT).add("Line 1", "Line two", "Line three").buildCell().cellBuilder()
            .align(TOP_CENTER).add("Line 1", "Line two", "Line three").buildCell().cellBuilder()
            .align(TOP_RIGHT).add("Line 1", "Line two", "Line three").buildCell().buildRow().rowBuilder()
            .cellBuilder().align(MIDDLE_LEFT).add("Line 1", "Line two", "Line three").buildCell().cellBuilder()
            .align(MIDDLE_CENTER).add("Line 1", "Line two", "Line three").buildCell().cellBuilder()
            .align(MIDDLE_RIGHT).add("Line 1", "Line two", "Line three").buildCell().buildRow().rowBuilder()
            .cellBuilder().align(BOTTOM_LEFT).add("Line 1", "Line two", "Line three").buildCell().cellBuilder()
            .align(BOTTOM_CENTER).add("Line 1", "Line two", "Line three").buildCell().cellBuilder()
            .align(BOTTOM_RIGHT).add("Line 1", "Line two", "Line three").buildCell().buildRow().buildPart()
            .buildTable();

    // Where's the lower-right-hand corner?  Put a cell there.
    lp.tableBuilder(XyOffset.of(lp.pageWidth() - (100 + pMargin), lp.yPageBottom() + 15 + pMargin))
            .addCellWidths(vec(100f))
            .textStyle(TextStyle.of(PDType1Font.COURIER_BOLD_OBLIQUE, 12f, YELLOW.brighter())).partBuilder()
            .cellStyle(CellStyle.of(MIDDLE_CENTER, Padding.of(2), decode("#3366cc"), BorderStyle.of(BLACK)))
            .rowBuilder().addTextCells("Lower-Right").buildRow().buildPart().buildTable();

    lp.commit();

    // More landscape pages
    lp = pageMgr.logicalPageStart();
    TextStyle pageHeadTextStyle = TextStyle.of(PDType1Font.HELVETICA, 7f, BLACK);
    CellStyle pageHeadCellStyle = CellStyle.of(TOP_CENTER, null, null, null);

    lp.putCellAsHeaderFooter(pMargin, lp.yPageTop() + 10,
            Cell.of(pageHeadCellStyle, tableWidth, pageHeadTextStyle, "Test Logical Page Three"));

    //        y = pageMgr.putRect(XyPair.of(pMargin, y), XyPair.of(100f,100f), Color.BLUE).y();

    // We're going to reset and reuse this y variable.
    float y = lp.yPageTop();

    y = lp.putRow(pMargin, y,
            Cell.of(headingCell, colWidths[0], heading,
                    "Transliterated Russian (with un-transliterated Chinese below)"),
            Cell.of(headingCellR, colWidths[1], heading, "US English"),
            Cell.of(headingCellR, colWidths[2], heading, "Finnish"),
            Cell.of(headingCellR, colWidths[3], heading, "German"));

    File f = new File("target/test-classes/melon.jpg");
    System.out.println(f.getAbsolutePath());
    BufferedImage melonPic = ImageIO.read(f);

    y = lp.putRow(pMargin, y, Cell.builder(regularCell, colWidths[0]).add(regular, vec(
            "???  ???  ,",
            "???  ?  ?.",
            "? ?, ? ? ",
            " ??  ? !", null, "Chorus:", null,
            "??, ?  ?, ?  ?"
                    + " ,  ? ? ?! ??, ?!"
                    + "  ?? !",
            null,
            "    ? ? ??  ? "
                    + " ?.    ?!   ?  ?  "
                    + "? ?!",
            null, "Chorus:", null, " ? ?   ? ",
            "?   .",
            "? ?   ? .",
            " ,  ?    ?!", null, "Chorus", null, null,
            null,
            "Chinese will not print.  The substitution character is a"
                    + " bullet, so below should be lots of bullets.",
            null,
            "???? " + "?? "
                    + "??? " + "??? "
                    + "??? " + "? "
                    + "??? " + "??? "
                    + "?????",
            null,
            "Here is a picture with the default and other sizes.  Though"
                    + " it shows up several times, the image data is only attached"
                    + " to the file once and reused."))
            .add(ScaledJpeg.of(melonPic), ScaledJpeg.of(melonPic, 50, 50), ScaledJpeg.of(melonPic, 50, 50),
                    ScaledJpeg.of(melonPic, 170, 100))
            .build(),
            Cell.builder(regularCell, colWidths[1]).add(regular,
                    // Flowing text
                    vec("O say can you see by the dawn's early light, "
                            + "What so proudly we hailed at the twilight's last gleaming, "
                            + "Whose broad stripes and bright stars " + "through the perilous fight, "
                            + "O'er the ramparts we watched, were so gallantly streaming? "
                            + "And the rockets' red glare, the bombs bursting in air, "
                            + "Gave proof through the night that our flag was still there; "
                            + "O say does that star-spangled banner yet wave, "
                            + "O'er the land of the free and the home of the brave? ",
                            // Tiny space
                            null,
                            // Set line breaks:
                            "On the shore dimly seen through the mists of the deep, ",
                            "Where the foe's haughty host in dread silence reposes, ",
                            "What is that which the breeze, o'er the towering steep, ",
                            "As it fitfully blows, half conceals, half discloses? ",
                            "Now it catches the gleam of the morning's first beam, ",
                            "In full glory reflected now shines in the stream: ",
                            "'Tis the star-spangled banner, O! long may it wave ",
                            "O'er the land of the free and the home of the brave. ",
                            // Big space.
                            null, null, null, null, null, null, null, null,
                            // Flowing text
                            "And where is that band who so vauntingly swore "
                                    + "That the havoc of war and the battle's confusion, "
                                    + "A home and a country, should leave us no more? "
                                    + "Their blood has washed out their foul footsteps' pollution. "
                                    + "No refuge could save the hireling and slave "
                                    + "From the terror of flight, or the gloom of the grave: "
                                    + "And the star-spangled banner in triumph doth wave, "
                                    + "O'er the land of the free and the home of the brave. " + null,
                            "O thus be it ever, when freemen shall stand "
                                    + "Between their loved home and the war's desolation. "
                                    + "Blest with vict'ry and peace, may the Heav'n rescued land "
                                    + "Praise the Power that hath made and preserved us a nation! "
                                    + "Then conquer we must, when our cause it is just, "
                                    + "And this be our motto: \"In God is our trust.\" "
                                    + "And the star-spangled banner in triumph shall wave "
                                    + "O'er the land of the free and the home of the brave!"))
                    .build(),
            Cell.builder(regularCell, colWidths[2]).add(regular, vec("Maamme", null,
                    "Monument to the Vrt Land poem in Helsinki. " + "Oi maamme, Suomi, synnyinmaa, "
                            + "soi, sana kultainen! " + "Ei laaksoa, ei kukkulaa, "
                            + "ei vett, rantaa rakkaampaa " + "kuin kotimaa t pohjoinen, "
                            + "maa kallis isien. " + "Sun kukoistukses kuorestaan " + "kerrankin puhkeaa; "
                            + "viel' lempemme saa nousemaan " + "sun toivos, riemus loistossaan, "
                            + "ja kerran laulus, synnyinmaa " + "korkeemman kaiun saa. ",
                    null, "Vrt land ", null,
                    "(the original, by Johan Ludvig Runeberg) " + "Vrt land, vrt land, vrt fosterland, "
                            + "ljud hgt, o dyra ord! " + "Ej lyfts en hjd mot himlens rand, "
                            + "ej snks en dal, ej skljs en strand, " + "mer lskad n vr bygd i nord, "
                            + "n vra fders jord! " + "Din blomning, sluten n i knopp, "
                            + "Skall mogna ur sitt tvng; " + "Se, ur vr krlek skall g opp "
                            + "Ditt ljus, din glans, din frjd, ditt hopp. "
                            + "Och hgre klinga skall en gng " + "Vr fosterlndska sng."))
                    .build(),
            Cell.builder(regularCell, colWidths[3]).add(regular, vec(// Older first 2 verses obsolete.
                    "Einigkeit und Recht und Freiheit " + "Fr das deutsche Vaterland! "
                            + "Danach lasst uns alle streben " + "Brderlich mit Herz und Hand! "
                            + "Einigkeit und Recht und Freiheit " + "Sind des Glckes Unterpfand;"
                            + "Blh' im Glanze dieses Glckes, " + "  Blhe, deutsches Vaterland!"))
                    .build());

    lp.putRow(pMargin, y, Cell.of(regularCell, colWidths[0], regular, "Another row of cells"),
            Cell.of(regularCell, colWidths[1], regular, "On the second page"),
            Cell.of(regularCell, colWidths[2], regular, "Just like any other page"),
            Cell.of(regularCell, colWidths[3], regular, "That's it!"));
    lp.commit();

    final LineStyle lineStyle = LineStyle.of(BLACK, 1);

    lp = pageMgr.logicalPageStart();

    lp.putCellAsHeaderFooter(pMargin, lp.yPageTop() + 10,
            Cell.of(pageHeadCellStyle, tableWidth, pageHeadTextStyle, "Test Logical Page Four"));

    // Make a big 3-page X in a box.  Notice that we code it as though it's on one page, and the
    // API adds two more pages as needed.  This is a great test for how geometric shapes break
    // across pages.

    // top lne
    lp.putLine(pMargin, lp.yPageTop(), pageRMargin, lp.yPageTop(), lineStyle);
    // left line
    lp.putLine(pMargin, lp.yPageTop(), pMargin, -lp.yPageTop(), lineStyle);
    // 3-page-long X
    lp.putLine(pMargin, lp.yPageTop(), pageRMargin, -lp.yPageTop(), lineStyle);
    // middle line
    lp.putLine(pMargin, 0, pageRMargin, 0, lineStyle);
    lp.putLine(pageRMargin, lp.yPageTop(), pMargin, -lp.yPageTop(), lineStyle);
    // right line
    lp.putLine(pageRMargin, lp.yPageTop(), pageRMargin, -lp.yPageTop(), lineStyle);
    // bottom line
    lp.putLine(pMargin, -lp.yPageTop(), pageRMargin, -lp.yPageTop(), lineStyle);
    lp.commit();

    // All done - write it out!

    // In a web application, this could be:
    //
    // httpServletResponse.setContentType("application/pdf") // your server may do this for you.
    // os = httpServletResponse.getOutputStream()            // you probably have to do this
    //
    // Also, in a web app, you probably want name your action something.pdf and put
    // target="_blank" on your link to the PDF download action.

    // We're just going to write to a file.
    OutputStream os = new FileOutputStream("test.pdf");

    // Commit it to the output stream!
    pageMgr.save(os);
}

From source file:com.baseprogramming.pdwriter.html.HtmlStyle.java

License:Apache License

private void createFontMap() {
    fontMap = new HashMap<>();
    fontMap.put("TIMES NEW ROMAN", PDType1Font.TIMES_ROMAN);
    fontMap.put("TIMES NEW ROMAN_BOLD", PDType1Font.TIMES_BOLD);
    fontMap.put("TIMES NEW ROMAN_ITALIC", PDType1Font.TIMES_ITALIC);
    fontMap.put("TIMES NEW ROMAN_OBLIQUE", PDType1Font.TIMES_ITALIC);
    fontMap.put("TIMES NEW ROMAN_BOLD_ITALIC", PDType1Font.TIMES_BOLD_ITALIC);

    fontMap.put("COURIER", PDType1Font.COURIER);
    fontMap.put("COURIER_BOLD", PDType1Font.COURIER_BOLD);
    fontMap.put("COURIER_ITALIC", PDType1Font.COURIER_OBLIQUE);
    fontMap.put("COURIER_OBLIQUE", PDType1Font.COURIER_OBLIQUE);
    fontMap.put("COURIER_BOLD_ITALIC", PDType1Font.COURIER_BOLD_OBLIQUE);

    fontMap.put("HELVATICA", PDType1Font.TIMES_ROMAN);
    fontMap.put("HELVATICA_ITALIC", PDType1Font.HELVETICA_BOLD);
    fontMap.put("HELVATICA_OBLIQUE", PDType1Font.HELVETICA_BOLD);
    fontMap.put("HELVATICA_BOLD_ITALIC", PDType1Font.HELVETICA_OBLIQUE);
    fontMap.put("HELVATICA_BOLD_ITALIC", PDType1Font.HELVETICA_BOLD_OBLIQUE);
}

From source file:org.fit.cssbox.render.PDFRenderer.java

License:Open Source License

private PDFont tryBuiltinFallback(String fontFamily, boolean isItalic, boolean isBold) {
    PDFont font;/*from   ww w .  j  a  v a 2s.  com*/

    fontFamily = fontFamily.toLowerCase();
    switch (fontFamily) {
    case "courier":
    case "courier new":
    case "lucida console":
        if (isBold && isItalic) {
            font = PDType1Font.COURIER_BOLD_OBLIQUE;
        } else if (isBold) {
            font = PDType1Font.COURIER_BOLD;
        } else if (isItalic) {
            font = PDType1Font.COURIER_OBLIQUE;
        } else {
            font = PDType1Font.COURIER;
        }
        break;
    case "times":
    case "garamond":
    case "georgia":
    case "times new roman":
    case "serif":
        if (isBold && isItalic) {
            font = PDType1Font.TIMES_BOLD_ITALIC;
        } else if (isBold) {
            font = PDType1Font.TIMES_BOLD;
        } else if (isItalic) {
            font = PDType1Font.TIMES_ITALIC;
        } else {
            font = PDType1Font.TIMES_ROMAN;
        }
        break;
    default:
        if (isBold && isItalic) {
            font = PDType1Font.HELVETICA_BOLD_OBLIQUE;
        } else if (isBold) {
            font = PDType1Font.HELVETICA_BOLD;
        } else if (isItalic) {
            font = PDType1Font.HELVETICA_OBLIQUE;
        } else {
            font = PDType1Font.HELVETICA;
        }
        break;
    }
    return font;
}

From source file:org.sejda.impl.pdfbox.util.FontUtilsTest.java

License:Apache License

@Test
public void testGetStandardType1Fontg() {
    assertEquals(PDType1Font.COURIER, FontUtils.getStandardType1Font(StandardType1Font.CURIER));
    assertEquals(PDType1Font.COURIER_BOLD, FontUtils.getStandardType1Font(StandardType1Font.CURIER_BOLD));
    assertEquals(PDType1Font.COURIER_BOLD_OBLIQUE,
            FontUtils.getStandardType1Font(StandardType1Font.CURIER_BOLD_OBLIQUE));
    assertEquals(PDType1Font.COURIER_OBLIQUE, FontUtils.getStandardType1Font(StandardType1Font.CURIER_OBLIQUE));
    assertEquals(PDType1Font.HELVETICA, FontUtils.getStandardType1Font(StandardType1Font.HELVETICA));
    assertEquals(PDType1Font.HELVETICA_BOLD, FontUtils.getStandardType1Font(StandardType1Font.HELVETICA_BOLD));
    assertEquals(PDType1Font.HELVETICA_BOLD_OBLIQUE,
            FontUtils.getStandardType1Font(StandardType1Font.HELVETICA_BOLD_OBLIQUE));
    assertEquals(PDType1Font.HELVETICA_OBLIQUE,
            FontUtils.getStandardType1Font(StandardType1Font.HELVETICA_OBLIQUE));
    assertEquals(PDType1Font.TIMES_BOLD, FontUtils.getStandardType1Font(StandardType1Font.TIMES_BOLD));
    assertEquals(PDType1Font.TIMES_BOLD_ITALIC,
            FontUtils.getStandardType1Font(StandardType1Font.TIMES_BOLD_ITALIC));
    assertEquals(PDType1Font.TIMES_ITALIC, FontUtils.getStandardType1Font(StandardType1Font.TIMES_ITALIC));
    assertEquals(PDType1Font.TIMES_ROMAN, FontUtils.getStandardType1Font(StandardType1Font.TIMES_ROMAN));
    assertEquals(PDType1Font.SYMBOL, FontUtils.getStandardType1Font(StandardType1Font.SYMBOL));
    assertEquals(PDType1Font.ZAPF_DINGBATS, FontUtils.getStandardType1Font(StandardType1Font.ZAPFDINGBATS));
}

From source file:src.view.controller.ViewTextAreaController.java

public void fillComboBoxTailleAndPolice() {
    for (int i = 5; i < 51; i++) {
        comboBoxTailleTextArea.getItems().add(i);
    }/* ww w  .  j a v  a 2  s .  c o m*/

    comboBoxPoliceTextArea.getItems().addAll(PDType1Font.COURIER, PDType1Font.COURIER_BOLD,
            PDType1Font.COURIER_BOLD_OBLIQUE, PDType1Font.COURIER_OBLIQUE, PDType1Font.HELVETICA,
            PDType1Font.HELVETICA_BOLD, PDType1Font.HELVETICA_BOLD_OBLIQUE, PDType1Font.HELVETICA_OBLIQUE,
            PDType1Font.SYMBOL, PDType1Font.TIMES_BOLD, PDType1Font.TIMES_BOLD_ITALIC, PDType1Font.TIMES_ROMAN,
            PDType1Font.ZAPF_DINGBATS);

    comboBoxTailleTextArea.getSelectionModel().select(7);
    comboBoxPoliceTextArea.getSelectionModel().select(0);
}