public static String[] getFamilyNames(BaseFont font) { String[][] names = font.getFamilyFontName(); if (names.length == 1) { return new String[]{names[0][3]}; } List<String> result = new ArrayList<String>(); for (String[] name : names) { if ((name[0].equals("1") && name[1].equals("0")) || name[2].equals("1033")) { result.add(name[3]); } } return result.toArray(new String[result.size()]); }
default: if (baseFont != null) { String[][] names = baseFont.getFamilyFontName(); for (String[] name : names) { if ("0".equals(name[2])) {
default: if (baseFont != null) { String[][] names = baseFont.getFamilyFontName(); for (String[] name : names) { if ("0".equals(name[2])) {
/** Gets all the names from the font. Only the required tables are read. * @param name the name of the font * @param encoding the encoding of the font * @param ttfAfm the true type font or the afm in a byte array * @throws DocumentException on error * @throws IOException on error * @return an array of Object[] built with {getPostscriptFontName(), getFamilyFontName(), getFullFontName()} */ public static Object[] getAllFontNames(String name, String encoding, byte ttfAfm[]) throws DocumentException, IOException { String nameBase = getBaseName(name); BaseFont fontBuilt = null; if (nameBase.toLowerCase().endsWith(".ttf") || nameBase.toLowerCase().endsWith(".otf") || nameBase.toLowerCase().indexOf(".ttc,") > 0) fontBuilt = new TrueTypeFont(name, CP1252, false, ttfAfm, true, false); else fontBuilt = createFont(name, encoding, false, false, ttfAfm, null); return new Object[]{fontBuilt.getPostscriptFontName(), fontBuilt.getFamilyFontName(), fontBuilt.getFullFontName()}; }
/** Gets all the names from the font. Only the required tables are read. * @param name the name of the font * @param encoding the encoding of the font * @param ttfAfm the true type font or the afm in a byte array * @throws DocumentException on error * @throws IOException on error * @return an array of Object[] built with {getPostscriptFontName(), getFamilyFontName(), getFullFontName()} */ public static Object[] getAllFontNames(String name, String encoding, byte ttfAfm[]) throws DocumentException, IOException { String nameBase = getBaseName(name); BaseFont fontBuilt = null; if (nameBase.toLowerCase().endsWith(".ttf") || nameBase.toLowerCase().endsWith(".otf") || nameBase.toLowerCase().indexOf(".ttc,") > 0) fontBuilt = new TrueTypeFont(name, CP1252, false, ttfAfm, true, false); else fontBuilt = createFont(name, encoding, false, false, ttfAfm, null); return new Object[]{fontBuilt.getPostscriptFontName(), fontBuilt.getFamilyFontName(), fontBuilt.getFullFontName()}; }
BaseFont bf = BaseFont.createFont(path, BaseFont.CP1252, false); String fullName = bf.getFullFontName()[0][3].toLowerCase(); String familyName = bf.getFamilyFontName()[0][3].toLowerCase(); String psName = bf.getPostscriptFontName().toLowerCase(); registerFamily(familyName, fullName, null);
BaseFont bf = BaseFont.createFont(path, BaseFont.CP1252, false); String fullName = bf.getFullFontName()[0][3].toLowerCase(); String familyName = bf.getFamilyFontName()[0][3].toLowerCase(); String psName = bf.getPostscriptFontName().toLowerCase(); registerFamily(familyName, fullName, null);
name, encoding, embedded, false, afmttf, pfb); String fontFamilyName = font.getFamilyFontName()[0][3]; FontFamily fontFamily = getFontFamily(fontFamilyName);
fontFamilyName = fontFamilyNameOverride; } else { fontFamilyName = font.getFamilyFontName()[0][3];