/** * 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); }
size = 12; baseFont = f.getBaseFont(); int style = f.getStyle(); if (style == Font.UNDEFINED) { style = Font.NORMAL;
public static FontDescriptor fontDescriptor(Font font) { return new FontDescriptor(font, font.getBaseFont(), null, font.getSize(), font.getStyle(), font.getColor()); }
size = 12; baseFont = f.getBaseFont(); int style = f.getStyle(); if (style == Font.UNDEFINED) { style = Font.NORMAL;
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 2; if (this.style != font.getStyle()) { return 3;
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 2; if (this.style != font.getStyle()) { return 3;
public static Font adjustWithStyles(Font fontToAdjust, Font ref) { return new FontCopier(fontToAdjust) .size(ref.getSize()) .style(ref.getStyle()) .color(ref.getColor()) .get(); }
@Override public void process(int level, Node node, InvocationContext context) { Font font = context.peekFont(); int style = Font.STRIKETHRU; context.pushFont(new Font(font.getBaseFont(), font.getSize(), font.getStyle() | style)); context.processChildren(level, node); context.popFont(); } }
@Override public void process(int level, Node node, InvocationContext context) { StrongEmphSuperNode emNode = (StrongEmphSuperNode) node; Font font = context.peekFont(); int style = emNode.isStrong() ? Font.BOLD : Font.ITALIC; context.pushFont(new Font(font.getBaseFont(), font.getSize(), font.getStyle() | style)); context.processChildren(level, node); context.popFont(); } }
int style2 = font.getStyle(); if (style1 != UNDEFINED || style2 != UNDEFINED) { if (style1 == UNDEFINED)
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())); }
int style2 = font.getStyle(); if (style1 != UNDEFINED || style2 != UNDEFINED) { if (style1 == UNDEFINED)
if (f.isUnderlined() || f.isStrikethru()) { f = new Font(f); int style = f.getStyle(); style &= ~Font.UNDERLINE; style &= ~Font.STRIKETHRU;
if (f.isUnderlined() || f.isStrikethru()) { f = new Font(f); int style = f.getStyle(); style &= ~Font.UNDERLINE; style &= ~Font.STRIKETHRU;