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

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

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

Font.getStyle介绍

[英]Gets the style of this font.
[中]获取此字体的样式。

代码示例

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

  1. private static int styleOf(Font font) {
  2. return ((font.getStyle() != Font.UNDEFINED) ? font.getStyle() : Font.NORMAL);
  3. }
  4. }

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

  1. /**
  2. * Gets a chunk with a symbol character.
  3. * @param c a character that has to be changed into a symbol
  4. * @param font Font if there is no SYMBOL character corresponding with c
  5. * @return a SYMBOL version of a character
  6. */
  7. public static Chunk get(char c, Font font) {
  8. char greek = SpecialSymbol.getCorrespondingSymbol(c);
  9. if (greek == ' ') {
  10. return new Chunk(String.valueOf(c), font);
  11. }
  12. Font symbol = new Font(FontFamily.SYMBOL, font.getSize(), font.getStyle(), font.getColor());
  13. String s = String.valueOf(greek);
  14. return new Chunk(s, symbol);
  15. }

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

  1. /**
  2. * Gets a chunk with a symbol character.
  3. * @param c a character that has to be changed into a symbol
  4. * @param font Font if there is no SYMBOL character corresponding with c
  5. * @return a SYMBOL version of a character
  6. */
  7. public static Chunk get(char c, Font font) {
  8. char greek = SpecialSymbol.getCorrespondingSymbol(c);
  9. if (greek == ' ') {
  10. return new Chunk(String.valueOf(c), font);
  11. }
  12. Font symbol = new Font(FontFamily.SYMBOL, font.getSize(), font.getStyle(), font.getColor());
  13. String s = String.valueOf(greek);
  14. return new Chunk(s, symbol);
  15. }

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

  1. /**
  2. * Gets a chunk with a symbol character.
  3. * @param e a symbol value (see Entities class: alfa is greek alfa,...)
  4. * @param font the font if the symbol isn't found (otherwise Font.SYMBOL)
  5. * @return a Chunk
  6. */
  7. public static Chunk get(final String e, final Font font) {
  8. char s = getCorrespondingSymbol(e);
  9. if (s == (char)0) {
  10. try {
  11. return new Chunk(String.valueOf((char)Integer.parseInt(e)), font);
  12. }
  13. catch(Exception exception) {
  14. return new Chunk(e, font);
  15. }
  16. }
  17. Font symbol = new Font(FontFamily.SYMBOL, font.getSize(), font.getStyle(), font.getColor());
  18. return new Chunk(String.valueOf(s), symbol);
  19. }

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

  1. /**
  2. * Gets a chunk with a symbol character.
  3. * @param e a symbol value (see Entities class: alfa is greek alfa,...)
  4. * @param font the font if the symbol isn't found (otherwise Font.SYMBOL)
  5. * @return a Chunk
  6. */
  7. public static Chunk get(final String e, final Font font) {
  8. char s = getCorrespondingSymbol(e);
  9. if (s == (char)0) {
  10. try {
  11. return new Chunk(String.valueOf((char)Integer.parseInt(e)), font);
  12. }
  13. catch(Exception exception) {
  14. return new Chunk(e, font);
  15. }
  16. }
  17. Font symbol = new Font(FontFamily.SYMBOL, font.getSize(), font.getStyle(), font.getColor());
  18. return new Chunk(String.valueOf(s), symbol);
  19. }

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

  1. size = 12;
  2. baseFont = f.getBaseFont();
  3. int style = f.getStyle();
  4. if (style == Font.UNDEFINED) {
  5. style = Font.NORMAL;

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

  1. public static FontDescriptor fontDescriptor(Font font) {
  2. return new FontDescriptor(font, font.getBaseFont(), null, font.getSize(), font.getStyle(), font.getColor());
  3. }

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

  1. size = 12;
  2. baseFont = f.getBaseFont();
  3. int style = f.getStyle();
  4. if (style == Font.UNDEFINED) {
  5. style = Font.NORMAL;

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

  1. string = string.substring(index);
  2. Font symbol = new Font(FontFamily.SYMBOL, font.getSize(), font.getStyle(), font.getColor());
  3. StringBuffer buf = new StringBuffer();
  4. buf.append(SpecialSymbol.getCorrespondingSymbol(string.charAt(0)));

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

  1. return 2;
  2. if (this.style != font.getStyle()) {
  3. return 3;

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

  1. string = string.substring(index);
  2. Font symbol = new Font(FontFamily.SYMBOL, font.getSize(), font.getStyle(), font.getColor());
  3. StringBuffer buf = new StringBuffer();
  4. buf.append(SpecialSymbol.getCorrespondingSymbol(string.charAt(0)));

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

  1. return 2;
  2. if (this.style != font.getStyle()) {
  3. return 3;

代码示例来源: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: com.itextpdf/itextg

  1. int style2 = font.getStyle();
  2. if (style1 != UNDEFINED || style2 != UNDEFINED) {
  3. if (style1 == UNDEFINED)

代码示例来源: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. }

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

  1. int style2 = font.getStyle();
  2. if (style1 != UNDEFINED || style2 != UNDEFINED) {
  3. if (style1 == UNDEFINED)

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

  1. if (f.isUnderlined() || f.isStrikethru()) {
  2. f = new Font(f);
  3. int style = f.getStyle();
  4. style &= ~Font.UNDERLINE;
  5. style &= ~Font.STRIKETHRU;

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

  1. if (f.isUnderlined() || f.isStrikethru()) {
  2. f = new Font(f);
  3. int style = f.getStyle();
  4. style &= ~Font.UNDERLINE;
  5. style &= ~Font.STRIKETHRU;

相关文章