This is a method inside my Resources.class:
public static Font loadFont(String fontFileName)
{
BaseFont base = null;
try
{
Try to create an embedded font object and use this font to render your text:
//this code should run once at initialization/application startup
FontFactory.register("resources/wingding_font.ttf");
Font textFont = FontFactory.getFont("wingding", BaseFont.IDENTITY_H,
BaseFont.EMBEDDED, 10); //10 is the size
...
//reuse the reference to the font object when rendering your text
Paragraph p = new Paragraph("someText", textFont);
By the way, iText has the FontFactory
class to help load your fonts, you don't need anymore the loadFont
method in your Resources
.
Hope it helps.