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

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

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

Font.getCalculatedStyle介绍

[英]Gets the style that can be used with the calculated BaseFont.
[中]获取可用于计算的BaseFont的样式。

代码示例

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

  1. /**
  2. * Adds a <CODE>Font</CODE> to be searched for valid characters.
  3. * @param font the <CODE>Font</CODE>
  4. */
  5. public void addFont(Font font) {
  6. if (font.getBaseFont() != null) {
  7. fonts.add(font);
  8. return;
  9. }
  10. BaseFont bf = font.getCalculatedBaseFont(true);
  11. Font f2 = new Font(bf, font.getSize(), font.getCalculatedStyle(), font.getColor());
  12. fonts.add(f2);
  13. }

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

  1. /**
  2. * Adds a <CODE>Font</CODE> to be searched for valid characters.
  3. * @param font the <CODE>Font</CODE>
  4. */
  5. public void addFont(Font font) {
  6. if (!isSupported(font)) {
  7. unsupportedFonts.add(font);
  8. return;
  9. }
  10. if (font.getBaseFont() != null) {
  11. fonts.add(font);
  12. return;
  13. }
  14. BaseFont bf = font.getCalculatedBaseFont(true);
  15. Font f2 = new Font(bf, font.getSize(), font.getCalculatedStyle(), font.getColor());
  16. fonts.add(f2);
  17. }

相关文章