/** * Creates a new instance of the LineSeparator class. * @param font the font */ public LineSeparator(Font font) { this.lineWidth = PdfChunk.UNDERLINE_THICKNESS * font.getSize(); this.offset = PdfChunk.UNDERLINE_OFFSET * font.getSize(); this.percentage = 100; this.lineColor = font.getColor(); }
/** * Creates a new instance of the LineSeparator class. * @param font the font */ public LineSeparator(Font font) { this.lineWidth = PdfChunk.UNDERLINE_THICKNESS * font.getSize(); this.offset = PdfChunk.UNDERLINE_OFFSET * font.getSize(); this.percentage = 100; this.lineColor = font.getColor(); }
/** * Adds a <CODE>Font</CODE> to be searched for valid characters. * @param font the <CODE>Font</CODE> */ public void addFont(Font font) { if (font.getBaseFont() != null) { fonts.add(font); return; } BaseFont bf = font.getCalculatedBaseFont(true); Font f2 = new Font(bf, font.getSize(), font.getCalculatedStyle(), font.getColor()); fonts.add(f2); }
/** * Adds a <CODE>Font</CODE> to be searched for valid characters. * @param font the <CODE>Font</CODE> */ public void addFont(Font font) { if (!isSupported(font)) { unsupportedFonts.add(font); return; } if (font.getBaseFont() != null) { fonts.add(font); return; } BaseFont bf = font.getCalculatedBaseFont(true); Font f2 = new Font(bf, font.getSize(), font.getCalculatedStyle(), font.getColor()); fonts.add(f2); }
/** * Gets a chunk with a symbol character. * @param c a character that has to be changed into a symbol * @param font Font if there is no SYMBOL character corresponding with c * @return a SYMBOL version of a character */ public static Chunk get(char c, Font font) { char greek = SpecialSymbol.getCorrespondingSymbol(c); if (greek == ' ') { return new Chunk(String.valueOf(c), font); } Font symbol = new Font(FontFamily.SYMBOL, font.getSize(), font.getStyle(), font.getColor()); String s = String.valueOf(greek); return new Chunk(s, symbol); }
/** * Gets a chunk with a symbol character. * @param c a character that has to be changed into a symbol * @param font Font if there is no SYMBOL character corresponding with c * @return a SYMBOL version of a character */ public static Chunk get(char c, Font font) { char greek = SpecialSymbol.getCorrespondingSymbol(c); if (greek == ' ') { return new Chunk(String.valueOf(c), font); } Font symbol = new Font(FontFamily.SYMBOL, font.getSize(), font.getStyle(), font.getColor()); String s = String.valueOf(greek); return new Chunk(s, symbol); }
/** * Gets a chunk with a symbol character. * @param e a symbol value (see Entities class: alfa is greek alfa,...) * @param font the font if the symbol isn't found (otherwise Font.SYMBOL) * @return a Chunk */ public static Chunk get(final String e, final Font font) { char s = getCorrespondingSymbol(e); if (s == (char)0) { try { return new Chunk(String.valueOf((char)Integer.parseInt(e)), font); } catch(Exception exception) { return new Chunk(e, font); } } Font symbol = new Font(FontFamily.SYMBOL, font.getSize(), font.getStyle(), font.getColor()); return new Chunk(String.valueOf(s), symbol); }
/** * Gets a chunk with a symbol character. * @param e a symbol value (see Entities class: alfa is greek alfa,...) * @param font the font if the symbol isn't found (otherwise Font.SYMBOL) * @return a Chunk */ public static Chunk get(final String e, final Font font) { char s = getCorrespondingSymbol(e); if (s == (char)0) { try { return new Chunk(String.valueOf((char)Integer.parseInt(e)), font); } catch(Exception exception) { return new Chunk(e, font); } } Font symbol = new Font(FontFamily.SYMBOL, font.getSize(), font.getStyle(), font.getColor()); return new Chunk(String.valueOf(s), symbol); }
attributes.put(Chunk.ACTION, action); noStroke.put(Chunk.COLOR, f.getColor()); noStroke.put(Chunk.ENCODING, font.getFont().getEncoding());
public static FontDescriptor fontDescriptor(Font font) { return new FontDescriptor(font, font.getBaseFont(), null, font.getSize(), font.getStyle(), font.getColor()); }
string = string.substring(index); Font symbol = new Font(FontFamily.SYMBOL, font.getSize(), font.getStyle(), font.getColor()); StringBuffer buf = new StringBuffer(); buf.append(SpecialSymbol.getCorrespondingSymbol(string.charAt(0)));
string = string.substring(index); Font symbol = new Font(FontFamily.SYMBOL, font.getSize(), font.getStyle(), font.getColor()); StringBuffer buf = new StringBuffer(); buf.append(SpecialSymbol.getCorrespondingSymbol(string.charAt(0)));
return 4; if (this.color.equals(font.getColor())) { return 0;
return 4; if (this.color.equals(font.getColor())) { return 0;
public static Font adjustWithStyles(Font fontToAdjust, Font ref) { return new FontCopier(fontToAdjust) .size(ref.getSize()) .style(ref.getStyle()) .color(ref.getColor()) .get(); }
public Font modify(Font font) { if (noModifier()) return font; int fontStyle = styleOf(font); fontStyle = overrideIfNotNull(fontStyle, style); fontStyle = applyStyleModifier(fontStyle, bold, Font.BOLD); fontStyle = applyStyleModifier(fontStyle, italic, Font.ITALIC); return new Font(font.getBaseFont(), val(size, font.getSize()), val(fontStyle, font.getStyle()), val(color, font.getColor())); }