List of usage examples for com.lowagie.text Font getFamilyIndex
public static int getFamilyIndex(String family)
String
-value of a certain family into the index that is used for this family in this class. From source file:is.idega.idegaweb.egov.printing.business.DocumentBusinessBean.java
License:Open Source License
private Font decodeFont(String fontstring, Font returnFont) { if (fontstring != null) { int family = -1; StringTokenizer tokener = new StringTokenizer(fontstring, "-"); // family part if (tokener.hasMoreTokens()) { family = Font.getFamilyIndex(tokener.nextToken()); }/*from www . j a v a2 s.com*/ if (family > -1) { Font font = new Font(family); // size part if (tokener.hasMoreTokens()) { float size = Float.parseFloat(tokener.nextToken()); font.setSize(size); } // style part if (tokener.hasMoreTokens()) { font.setStyle(tokener.nextToken()); } // color part if (tokener.hasMoreTokens()) { font.setColor(IWColor.getAWTColorFromHex(tokener.nextToken())); } return font; } } return returnFont; }