com.itextpdf.text.Font.getSize()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(6.5k)|赞(0)|评价(0)|浏览(168)

本文整理了Java中com.itextpdf.text.Font.getSize()方法的一些代码示例,展示了Font.getSize()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Font.getSize()方法的具体详情如下:
包路径:com.itextpdf.text.Font
类名称:Font
方法名:getSize

Font.getSize介绍

[英]Gets the size of this font.
[中]获取此字体的大小。

代码示例

代码示例来源:origin: com.itextpdf/itextg

  1. /**
  2. * Creates a new instance of the LineSeparator class.
  3. * @param font the font
  4. */
  5. public LineSeparator(Font font) {
  6. this.lineWidth = PdfChunk.UNDERLINE_THICKNESS * font.getSize();
  7. this.offset = PdfChunk.UNDERLINE_OFFSET * font.getSize();
  8. this.percentage = 100;
  9. this.lineColor = font.getColor();
  10. }

代码示例来源:origin: com.itextpdf/itextpdf

  1. /**
  2. * Creates a new instance of the LineSeparator class.
  3. * @param font the font
  4. */
  5. public LineSeparator(Font font) {
  6. this.lineWidth = PdfChunk.UNDERLINE_THICKNESS * font.getSize();
  7. this.offset = PdfChunk.UNDERLINE_OFFSET * font.getSize();
  8. this.percentage = 100;
  9. this.lineColor = font.getColor();
  10. }

代码示例来源:origin: com.itextpdf/itextpdf

  1. /**
  2. * Sets the dingbat's color.
  3. *
  4. * @param zapfDingbatColor color for the ZapfDingbat
  5. */
  6. public void setDingbatColor(BaseColor zapfDingbatColor) {
  7. float fontsize = symbol.getFont().getSize();
  8. symbol.setFont(FontFactory.getFont(FontFactory.ZAPFDINGBATS, fontsize, Font.NORMAL, zapfDingbatColor));
  9. }

代码示例来源:origin: com.itextpdf/itextpdf

  1. /**
  2. * change the font to SYMBOL
  3. */
  4. protected void setGreekFont() {
  5. float fontsize = symbol.getFont().getSize();
  6. symbol.setFont(FontFactory.getFont(FontFactory.SYMBOL, fontsize, Font.NORMAL));
  7. }

代码示例来源:origin: com.itextpdf/itextpdf

  1. /**
  2. * Creates a ZapfDingbatsList
  3. *
  4. * @param zn a char-number
  5. */
  6. public ZapfDingbatsList(int zn) {
  7. super(true);
  8. this.zn = zn;
  9. float fontsize = symbol.getFont().getSize();
  10. symbol.setFont(FontFactory.getFont(FontFactory.ZAPFDINGBATS, fontsize, Font.NORMAL));
  11. postSymbol = " ";
  12. }

代码示例来源:origin: com.itextpdf/itextg

  1. /**
  2. * Creates a ZapfDingbatsList
  3. *
  4. * @param zn a char-number
  5. */
  6. public ZapfDingbatsList(int zn) {
  7. super(true);
  8. this.zn = zn;
  9. float fontsize = symbol.getFont().getSize();
  10. symbol.setFont(FontFactory.getFont(FontFactory.ZAPFDINGBATS, fontsize, Font.NORMAL));
  11. postSymbol = " ";
  12. }

代码示例来源:origin: com.itextpdf/itextg

  1. /**
  2. * Sets the dingbat's color.
  3. *
  4. * @param zapfDingbatColor color for the ZapfDingbat
  5. */
  6. public void setDingbatColor(BaseColor zapfDingbatColor) {
  7. float fontsize = symbol.getFont().getSize();
  8. symbol.setFont(FontFactory.getFont(FontFactory.ZAPFDINGBATS, fontsize, Font.NORMAL, zapfDingbatColor));
  9. }

代码示例来源:origin: com.itextpdf/itextpdf

  1. /**
  2. * Creates a ZapfDingbatsList
  3. *
  4. * @param zn a char-number
  5. * @param symbolIndent indent
  6. */
  7. public ZapfDingbatsList(int zn, int symbolIndent) {
  8. super(true, symbolIndent);
  9. this.zn = zn;
  10. float fontsize = symbol.getFont().getSize();
  11. symbol.setFont(FontFactory.getFont(FontFactory.ZAPFDINGBATS, fontsize, Font.NORMAL));
  12. postSymbol = " ";
  13. }

代码示例来源:origin: com.itextpdf/itextg

  1. /**
  2. * Creates a ZapdDingbatsNumberList
  3. * @param type the type of list
  4. */
  5. public ZapfDingbatsNumberList(int type) {
  6. super(true);
  7. this.type = type;
  8. float fontsize = symbol.getFont().getSize();
  9. symbol.setFont(FontFactory.getFont(FontFactory.ZAPFDINGBATS, fontsize, Font.NORMAL));
  10. postSymbol = " ";
  11. }

代码示例来源:origin: com.itextpdf/itextpdf

  1. /**
  2. * Creates a ZapdDingbatsNumberList
  3. * @param type the type of list
  4. */
  5. public ZapfDingbatsNumberList(int type) {
  6. super(true);
  7. this.type = type;
  8. float fontsize = symbol.getFont().getSize();
  9. symbol.setFont(FontFactory.getFont(FontFactory.ZAPFDINGBATS, fontsize, Font.NORMAL));
  10. postSymbol = " ";
  11. }

代码示例来源:origin: com.itextpdf/itextpdf

  1. /**
  2. * Creates a ZapdDingbatsNumberList
  3. * @param type the type of list
  4. * @param symbolIndent indent
  5. */
  6. public ZapfDingbatsNumberList(int type, int symbolIndent) {
  7. super(true, symbolIndent);
  8. this.type = type;
  9. float fontsize = symbol.getFont().getSize();
  10. symbol.setFont(FontFactory.getFont(FontFactory.ZAPFDINGBATS, fontsize, Font.NORMAL));
  11. postSymbol = " ";
  12. }

代码示例来源:origin: com.itextpdf/itextg

  1. /**
  2. * Creates a ZapfDingbatsList
  3. *
  4. * @param zn a char-number
  5. * @param symbolIndent indent
  6. */
  7. public ZapfDingbatsList(int zn, int symbolIndent) {
  8. super(true, symbolIndent);
  9. this.zn = zn;
  10. float fontsize = symbol.getFont().getSize();
  11. symbol.setFont(FontFactory.getFont(FontFactory.ZAPFDINGBATS, fontsize, Font.NORMAL));
  12. postSymbol = " ";
  13. }

代码示例来源:origin: com.itextpdf/itextg

  1. /**
  2. * Creates a ZapdDingbatsNumberList
  3. * @param type the type of list
  4. * @param symbolIndent indent
  5. */
  6. public ZapfDingbatsNumberList(int type, int symbolIndent) {
  7. super(true, symbolIndent);
  8. this.type = type;
  9. float fontsize = symbol.getFont().getSize();
  10. symbol.setFont(FontFactory.getFont(FontFactory.ZAPFDINGBATS, fontsize, Font.NORMAL));
  11. postSymbol = " ";
  12. }

代码示例来源:origin: com.itextpdf/itextg

  1. /**
  2. * change the font to SYMBOL
  3. */
  4. protected void setGreekFont() {
  5. float fontsize = symbol.getFont().getSize();
  6. symbol.setFont(FontFactory.getFont(FontFactory.SYMBOL, fontsize, Font.NORMAL));
  7. }

代码示例来源:origin: com.github.hazendaz/displaytag

  1. /**
  2. * Makes chunk content bold.
  3. * @param chunk The chunk whose content is to be rendered bold.
  4. * @param color The font color desired.
  5. */
  6. private void setBoldStyle(Chunk chunk, BaseColor color)
  7. {
  8. Font font = chunk.getFont();
  9. chunk.setFont(FontFactory.getFont(font.getFamilyname(), font.getSize(), Font.BOLD, color));
  10. }

代码示例来源:origin: org.technbolts.tzatziki/tzatziki-pdf

  1. private float widthPercent(FluentIterable<Tag> tags, ITextContext emitterContext) {
  2. Rectangle artBox = emitterContext.getDocumentArtBox();
  3. Font font = headerCellStyler.cellFont();
  4. BaseFont baseFont = font.getBaseFont();
  5. float len = 0;
  6. for (Tag tag : tags) {
  7. float sLen = baseFont.getWidthPoint(tag.getTag(), font.getSize());
  8. len = Math.max(len, sLen);
  9. }
  10. len = Math.min(artBox.getWidth() / 2, len);
  11. return len / artBox.getWidth();
  12. }

代码示例来源:origin: org.technbolts/gutenberg

  1. public static Font adjustWithStyles(Font fontToAdjust, Font ref) {
  2. return new FontCopier(fontToAdjust)
  3. .size(ref.getSize())
  4. .style(ref.getStyle())
  5. .color(ref.getColor())
  6. .get();
  7. }

代码示例来源:origin: org.technbolts/gutenberg

  1. @Override
  2. public void process(int level, Node node, InvocationContext context) {
  3. Font font = context.peekFont();
  4. int style = Font.STRIKETHRU;
  5. context.pushFont(new Font(font.getBaseFont(), font.getSize(), font.getStyle() | style));
  6. context.processChildren(level, node);
  7. context.popFont();
  8. }
  9. }

代码示例来源:origin: org.technbolts/gutenberg

  1. @Override
  2. public void process(int level, Node node, InvocationContext context) {
  3. StrongEmphSuperNode emNode = (StrongEmphSuperNode) node;
  4. Font font = context.peekFont();
  5. int style = emNode.isStrong() ? Font.BOLD : Font.ITALIC;
  6. context.pushFont(new Font(font.getBaseFont(), font.getSize(), font.getStyle() | style));
  7. context.processChildren(level, node);
  8. context.popFont();
  9. }
  10. }

代码示例来源:origin: org.technbolts/gutenberg

  1. public Font modify(Font font) {
  2. if (noModifier())
  3. return font;
  4. int fontStyle = styleOf(font);
  5. fontStyle = overrideIfNotNull(fontStyle, style);
  6. fontStyle = applyStyleModifier(fontStyle, bold, Font.BOLD);
  7. fontStyle = applyStyleModifier(fontStyle, italic, Font.ITALIC);
  8. return new Font(font.getBaseFont(),
  9. val(size, font.getSize()),
  10. val(fontStyle, font.getStyle()),
  11. val(color, font.getColor()));
  12. }

相关文章