private static IdentValue guessStyle(BaseFont font) { String[][] names = font.getFullFontName(); for (String[] name : names) { String lower = name[3].toLowerCase(); if (lower.contains("italic")) { return IdentValue.ITALIC; } else if (lower.contains("oblique")) { return IdentValue.OBLIQUE; } } return IdentValue.NORMAL; }
private static IdentValue guessStyle(BaseFont font) { String[][] names = font.getFullFontName(); for (String[] name : names) { String lower = name[3].toLowerCase(); if (lower.contains("italic")) { return IdentValue.ITALIC; } else if (lower.contains("oblique")) { return IdentValue.OBLIQUE; } } return IdentValue.NORMAL; }
private static IdentValue guessStyle(BaseFont font) { String[][] names = font.getFullFontName(); for (int i = 0; i < names.length; i++) { String name[] = names[i]; String lower = name[3].toLowerCase(); if (lower.indexOf("italic") != -1) { return IdentValue.ITALIC; } else if (lower.indexOf("oblique") != -1) { return IdentValue.OBLIQUE; } } return IdentValue.NORMAL; }
private static IdentValue guessStyle(BaseFont font) { String[][] names = font.getFullFontName(); for (int i = 0; i < names.length; i++) { String name[] = names[i]; String lower = name[3].toLowerCase(); if (lower.indexOf("italic") != -1) { return IdentValue.ITALIC; } else if (lower.indexOf("oblique") != -1) { return IdentValue.OBLIQUE; } } return IdentValue.NORMAL; }
private static IdentValue guessStyle(BaseFont font) { String[][] names = font.getFullFontName(); for (int i = 0; i < names.length; i++) { String name[] = names[i]; String lower = name[3].toLowerCase(); if (lower.indexOf("italic") != -1) { return IdentValue.ITALIC; } else if (lower.indexOf("oblique") != -1) { return IdentValue.OBLIQUE; } } return IdentValue.NORMAL; }
private String getFontName( final BaseFont font ) { final String[][] names = font.getFullFontName(); final int nameCount = names.length; if ( nameCount == 1 ) { return names[ 0 ][ 3 ]; } String nameExtr = null; for ( int k = 0; k < nameCount; ++k ) { final String[] name = names[ k ]; // Macintosh language english if ( "1".equals( name[ 0 ] ) && "0".equals( name[ 1 ] ) ) { nameExtr = name[ 3 ]; } // Microsoft language code for US-English ... else if ( "1033".equals( name[ 2 ] ) ) { nameExtr = name[ 3 ]; break; } } if ( nameExtr != null ) { return nameExtr; } return names[ 0 ][ 3 ]; } }
String names[][] = font.getFullFontName(); if (names.length == 1) return new Font(names[0][3], 0, size);
String[][] names = font.getFullFontName(); if (names.length == 1) { return new Font(names[0][3], Font.PLAIN, size);
/** Gets the full name of the font. If it is a True Type font * each array element will have {Platform ID, Platform Encoding ID, * Language ID, font name}. The interpretation of this values can be * found in the Open Type specification, chapter 2, in the 'name' table.<br> * For the other fonts the array has a single element with {"", "", "", * font name}. * @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 the full name of the font */ public static String[][] getFullFontName(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 fontBuilt.getFullFontName(); }
/** Gets the full name of the font. If it is a True Type font * each array element will have {Platform ID, Platform Encoding ID, * Language ID, font name}. The interpretation of this values can be * found in the Open Type specification, chapter 2, in the 'name' table.<br> * For the other fonts the array has a single element with {"", "", "", * font name}. * @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 the full name of the font */ public static String[][] getFullFontName(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 fontBuilt.getFullFontName(); }
String names[][] = font.getFullFontName(); if (names.length == 1) return new Font(names[0][3], 0, size);
/** 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()}; }
fontBuilt = createFont(name, encoding, false, false, ttfAfm, null); return fontBuilt.getFullFontName();
fontBuilt.getFamilyFontName(), fontBuilt.getFullFontName() };
String fullName = bf.getFullFontName()[0][3].toLowerCase(); String familyName = bf.getFamilyFontName()[0][3].toLowerCase(); String psName = bf.getPostscriptFontName().toLowerCase();
String fullName = bf.getFullFontName()[0][3].toLowerCase(); String familyName = bf.getFamilyFontName()[0][3].toLowerCase(); String psName = bf.getPostscriptFontName().toLowerCase();
String fullName = bf.getFullFontName()[0][3].toLowerCase(); String familyName = bf.getFamilyFontName()[0][3].toLowerCase(); String psName = bf.getPostscriptFontName().toLowerCase();
String[][] fontNames = font.getBaseFont().getFullFontName(); for(int i = 0; i < fontNames.length; i++) { if(fontNames[i][2].equals("0")) {
String[][] fontNames = font.getBaseFont().getFullFontName(); for(int i = 0; i < fontNames.length; i++) { if(fontNames[i][2].equals("0")) {