/** * Sets the dingbat's color. * * @param zapfDingbatColor color for the ZapfDingbat */ public void setDingbatColor(BaseColor zapfDingbatColor) { float fontsize = symbol.getFont().getSize(); symbol.setFont(FontFactory.getFont(FontFactory.ZAPFDINGBATS, fontsize, Font.NORMAL, zapfDingbatColor)); }
/** * change the font to SYMBOL */ protected void setGreekFont() { float fontsize = symbol.getFont().getSize(); symbol.setFont(FontFactory.getFont(FontFactory.SYMBOL, fontsize, Font.NORMAL)); }
/** * Creates a ZapfDingbatsList * * @param zn a char-number */ public ZapfDingbatsList(int zn) { super(true); this.zn = zn; float fontsize = symbol.getFont().getSize(); symbol.setFont(FontFactory.getFont(FontFactory.ZAPFDINGBATS, fontsize, Font.NORMAL)); postSymbol = " "; }
/** * Creates a ZapfDingbatsList * * @param zn a char-number */ public ZapfDingbatsList(int zn) { super(true); this.zn = zn; float fontsize = symbol.getFont().getSize(); symbol.setFont(FontFactory.getFont(FontFactory.ZAPFDINGBATS, fontsize, Font.NORMAL)); postSymbol = " "; }
/** * Sets the dingbat's color. * * @param zapfDingbatColor color for the ZapfDingbat */ public void setDingbatColor(BaseColor zapfDingbatColor) { float fontsize = symbol.getFont().getSize(); symbol.setFont(FontFactory.getFont(FontFactory.ZAPFDINGBATS, fontsize, Font.NORMAL, zapfDingbatColor)); }
/** * Creates a ZapfDingbatsList * * @param zn a char-number * @param symbolIndent indent */ public ZapfDingbatsList(int zn, int symbolIndent) { super(true, symbolIndent); this.zn = zn; float fontsize = symbol.getFont().getSize(); symbol.setFont(FontFactory.getFont(FontFactory.ZAPFDINGBATS, fontsize, Font.NORMAL)); postSymbol = " "; }
/** * Creates a ZapdDingbatsNumberList * @param type the type of list */ public ZapfDingbatsNumberList(int type) { super(true); this.type = type; float fontsize = symbol.getFont().getSize(); symbol.setFont(FontFactory.getFont(FontFactory.ZAPFDINGBATS, fontsize, Font.NORMAL)); postSymbol = " "; }
/** * Creates a ZapdDingbatsNumberList * @param type the type of list */ public ZapfDingbatsNumberList(int type) { super(true); this.type = type; float fontsize = symbol.getFont().getSize(); symbol.setFont(FontFactory.getFont(FontFactory.ZAPFDINGBATS, fontsize, Font.NORMAL)); postSymbol = " "; }
/** * Creates a ZapdDingbatsNumberList * @param type the type of list * @param symbolIndent indent */ public ZapfDingbatsNumberList(int type, int symbolIndent) { super(true, symbolIndent); this.type = type; float fontsize = symbol.getFont().getSize(); symbol.setFont(FontFactory.getFont(FontFactory.ZAPFDINGBATS, fontsize, Font.NORMAL)); postSymbol = " "; }
/** * Creates a ZapfDingbatsList * * @param zn a char-number * @param symbolIndent indent */ public ZapfDingbatsList(int zn, int symbolIndent) { super(true, symbolIndent); this.zn = zn; float fontsize = symbol.getFont().getSize(); symbol.setFont(FontFactory.getFont(FontFactory.ZAPFDINGBATS, fontsize, Font.NORMAL)); postSymbol = " "; }
/** * Creates a ZapdDingbatsNumberList * @param type the type of list * @param symbolIndent indent */ public ZapfDingbatsNumberList(int type, int symbolIndent) { super(true, symbolIndent); this.type = type; float fontsize = symbol.getFont().getSize(); symbol.setFont(FontFactory.getFont(FontFactory.ZAPFDINGBATS, fontsize, Font.NORMAL)); postSymbol = " "; }
/** * change the font to SYMBOL */ protected void setGreekFont() { float fontsize = symbol.getFont().getSize(); symbol.setFont(FontFactory.getFont(FontFactory.SYMBOL, fontsize, Font.NORMAL)); }
/** * Makes chunk content bold. * @param chunk The chunk whose content is to be rendered bold. * @param color The font color desired. */ private void setBoldStyle(Chunk chunk, BaseColor color) { Font font = chunk.getFont(); chunk.setFont(FontFactory.getFont(font.getFamilyname(), font.getSize(), Font.BOLD, color)); }
private float widthPercent(FluentIterable<Tag> tags, ITextContext emitterContext) { Rectangle artBox = emitterContext.getDocumentArtBox(); Font font = headerCellStyler.cellFont(); BaseFont baseFont = font.getBaseFont(); float len = 0; for (Tag tag : tags) { float sLen = baseFont.getWidthPoint(tag.getTag(), font.getSize()); len = Math.max(len, sLen); } len = Math.min(artBox.getWidth() / 2, len); return len / artBox.getWidth(); }
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(); } }
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())); }