本文整理了Java中com.lowagie.text.Phrase.setLeading()
方法的一些代码示例,展示了Phrase.setLeading()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Phrase.setLeading()
方法的具体详情如下:
包路径:com.lowagie.text.Phrase
类名称: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;
}
内容来源于网络,如有侵权,请联系作者删除!