本文整理了Java中com.itextpdf.text.Font.getSize()
方法的一些代码示例,展示了Font.getSize()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Font.getSize()
方法的具体详情如下:
包路径:com.itextpdf.text.Font
类名称:Font
方法名:getSize
[英]Gets the size of this font.
[中]获取此字体的大小。
代码示例来源:origin: com.itextpdf/itextg
/**
* 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();
}
代码示例来源:origin: com.itextpdf/itextpdf
/**
* 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();
}
代码示例来源:origin: com.itextpdf/itextpdf
/**
* 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));
}
代码示例来源:origin: com.itextpdf/itextpdf
/**
* change the font to SYMBOL
*/
protected void setGreekFont() {
float fontsize = symbol.getFont().getSize();
symbol.setFont(FontFactory.getFont(FontFactory.SYMBOL, fontsize, Font.NORMAL));
}
代码示例来源:origin: com.itextpdf/itextpdf
/**
* 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 = " ";
}
代码示例来源:origin: com.itextpdf/itextg
/**
* 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 = " ";
}
代码示例来源:origin: com.itextpdf/itextg
/**
* 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));
}
代码示例来源:origin: com.itextpdf/itextpdf
/**
* 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 = " ";
}
代码示例来源:origin: com.itextpdf/itextg
/**
* 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 = " ";
}
代码示例来源:origin: com.itextpdf/itextpdf
/**
* 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 = " ";
}
代码示例来源:origin: com.itextpdf/itextpdf
/**
* 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 = " ";
}
代码示例来源:origin: com.itextpdf/itextg
/**
* 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 = " ";
}
代码示例来源:origin: com.itextpdf/itextg
/**
* 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 = " ";
}
代码示例来源:origin: com.itextpdf/itextg
/**
* change the font to SYMBOL
*/
protected void setGreekFont() {
float fontsize = symbol.getFont().getSize();
symbol.setFont(FontFactory.getFont(FontFactory.SYMBOL, fontsize, Font.NORMAL));
}
代码示例来源:origin: com.github.hazendaz/displaytag
/**
* 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));
}
代码示例来源:origin: org.technbolts.tzatziki/tzatziki-pdf
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();
}
代码示例来源:origin: org.technbolts/gutenberg
public static Font adjustWithStyles(Font fontToAdjust, Font ref) {
return new FontCopier(fontToAdjust)
.size(ref.getSize())
.style(ref.getStyle())
.color(ref.getColor())
.get();
}
代码示例来源:origin: org.technbolts/gutenberg
@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();
}
}
代码示例来源:origin: org.technbolts/gutenberg
@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();
}
}
代码示例来源:origin: org.technbolts/gutenberg
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()));
}
内容来源于网络,如有侵权,请联系作者删除!