com.lowagie.text.Phrase.setLeading()方法的使用及代码示例

x33g5p2x  于2022-01-26 转载在 其他  
字(4.5k)|赞(0)|评价(0)|浏览(232)

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

Phrase.setLeading介绍

[英]Sets the leading of this phrase.
[中]设置此短语的开头。

代码示例

代码示例来源:origin: javamelody/javamelody

Element createParagraphElement(String paragraphTitle, String iconName)
    throws DocumentException, IOException {
  final Paragraph paragraph = new Paragraph("", paragraphTitleFont);
  paragraph.setSpacingBefore(5);
  paragraph.setSpacingAfter(5);
  if (iconName != null) {
    paragraph.add(new Chunk(getParagraphImage(iconName), 0, -5));
  }
  final Phrase element = new Phrase(' ' + paragraphTitle, paragraphTitleFont);
  element.setLeading(12);
  paragraph.add(element);
  // chapter pour avoir la liste des signets
  final ChapterAutoNumber chapter = new ChapterAutoNumber(paragraph);
  // sans numéro de chapitre
  chapter.setNumberDepth(0);
  chapter.setBookmarkOpen(false);
  chapter.setTriggerNewPage(false);
  return chapter;
}

代码示例来源:origin: com.github.librepdf/openpdf

/**
 * Creates a Phrase object based on a list of properties.
 * @param attributes
 * @return a Phrase
 */
public static Phrase getPhrase(Properties attributes) {
  Phrase phrase = new Phrase();
  phrase.setFont(FontFactory.getFont(attributes));
  String value;
  value = attributes.getProperty(ElementTags.LEADING);
  if (value != null) {
    phrase.setLeading(Float.parseFloat(value + "f"));
  }
  value = attributes.getProperty(Markup.CSS_KEY_LINEHEIGHT);
  if (value != null) {
    phrase.setLeading(Markup.parseLength(value,
        Markup.DEFAULT_FONT_SIZE));
  }
  value = attributes.getProperty(ElementTags.ITEXT);
  if (value != null) {
    Chunk chunk = new Chunk(value);
    if ((value = attributes.getProperty(ElementTags.GENERICTAG)) != null) {
      chunk.setGenericTag(value);
    }
    phrase.add(chunk);
  }
  return phrase;
}

代码示例来源:origin: es.gob.afirma/afirma-crypto-pdf-itext

/**
 * Creates a Phrase object based on a list of properties.
 * @param attributes
 * @return a Phrase
 */
public static Phrase getPhrase(Properties attributes) {
  Phrase phrase = new Phrase();
  phrase.setFont(FontFactory.getFont(attributes));
  String value;
  value = attributes.getProperty(ElementTags.LEADING);
  if (value != null) {
    phrase.setLeading(Float.parseFloat(value + "f"));
  }
  value = attributes.getProperty(Markup.CSS_KEY_LINEHEIGHT);
  if (value != null) {
    phrase.setLeading(Markup.parseLength(value,
        Markup.DEFAULT_FONT_SIZE));
  }
  value = attributes.getProperty(ElementTags.ITEXT);
  if (value != null) {
    Chunk chunk = new Chunk(value);
    if ((value = attributes.getProperty(ElementTags.GENERICTAG)) != null) {
      chunk.setGenericTag(value);
    }
    phrase.add(chunk);
  }
  return phrase;
}

代码示例来源:origin: fr.opensagres.xdocreport.itext-gae/itext-gae

/**
 * Creates a Phrase object based on a list of properties.
 * @param attributes
 * @return a Phrase
 */
public static Phrase getPhrase(Properties attributes) {
  Phrase phrase = new Phrase();
  phrase.setFont(FontFactory.getFont(attributes));
  String value;
  value = attributes.getProperty(ElementTags.LEADING);
  if (value != null) {
    phrase.setLeading(Float.parseFloat(value + "f"));
  }
  value = attributes.getProperty(Markup.CSS_KEY_LINEHEIGHT);
  if (value != null) {
    phrase.setLeading(Markup.parseLength(value,
        Markup.DEFAULT_FONT_SIZE));
  }
  value = attributes.getProperty(ElementTags.ITEXT);
  if (value != null) {
    Chunk chunk = new Chunk(value);
    if ((value = attributes.getProperty(ElementTags.GENERICTAG)) != null) {
      chunk.setGenericTag(value);
    }
    phrase.add(chunk);
  }
  return phrase;
}

代码示例来源:origin: es.gob.afirma/afirma-crypto-pdf-itext

p.setLeading(leading);
p.font = font;
if (font.getFamily() != Font.SYMBOL && font.getFamily() != Font.ZAPFDINGBATS && font.getBaseFont() == null) {

代码示例来源:origin: fr.opensagres.xdocreport.itext-gae/itext-gae

p.setLeading(leading);
p.font = font;
if (font.getFamily() != Font.SYMBOL && font.getFamily() != Font.ZAPFDINGBATS && font.getBaseFont() == null) {

代码示例来源:origin: com.github.librepdf/openpdf

p.setLeading(leading);
p.font = font;
if (font.getFamily() != Font.SYMBOL && font.getFamily() != Font.ZAPFDINGBATS && font.getBaseFont() == null) {

代码示例来源:origin: net.bull.javamelody/javamelody-core

Element createParagraphElement(String paragraphTitle, String iconName)
    throws DocumentException, IOException {
  final Paragraph paragraph = new Paragraph("", paragraphTitleFont);
  paragraph.setSpacingBefore(5);
  paragraph.setSpacingAfter(5);
  if (iconName != null) {
    paragraph.add(new Chunk(getParagraphImage(iconName), 0, -5));
  }
  final Phrase element = new Phrase(' ' + paragraphTitle, paragraphTitleFont);
  element.setLeading(12);
  paragraph.add(element);
  // chapter pour avoir la liste des signets
  final ChapterAutoNumber chapter = new ChapterAutoNumber(paragraph);
  // sans numéro de chapitre
  chapter.setNumberDepth(0);
  chapter.setBookmarkOpen(false);
  chapter.setTriggerNewPage(false);
  return chapter;
}

相关文章