List of usage examples for com.lowagie.text ExceptionConverter getException
public Exception getException()
From source file:com.amphisoft.epub2pdf.content.TextFactory.java
License:Open Source License
public static boolean setDefaultFontByName(String fontName) { fontName = fontName.toLowerCase().trim(); if (TextFactory.fontFamilyRegistered(fontName)) { Font newDefaultFont = null; try {//from ww w . j a v a2 s.c o m newDefaultFont = FontFactory.getFont(fontName, BaseFont.IDENTITY_H, BaseFont.EMBEDDED); } catch (ExceptionConverter eC) { if (eC.getException() instanceof UnsupportedEncodingException) { newDefaultFont = FontFactory.getFont(fontName, FontFactory.defaultEncoding, BaseFont.EMBEDDED); } else { throw new RuntimeException(eC); } } newDefaultFont.setSize(_defaultFontSize); _defaultFont = newDefaultFont; return true; } else { return false; } }