本文整理了Java中com.lowagie.text.Phrase.setFont()
方法的一些代码示例,展示了Phrase.setFont()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Phrase.setFont()
方法的具体详情如下:
包路径:com.lowagie.text.Phrase
类名称:Phrase
方法名:setFont
[英]Sets the main font of this phrase.
[中]设置此短语的主字体。
代码示例来源:origin: fr.opensagres/org.odftoolkit.odfdom.converter
public void applyStyles(Style style) {
this.lastStyleApplied = style;
StyleTextProperties textProperties = style.getTextProperties();
if (textProperties != null) {
// Font
Font font = textProperties.getFont();
if (font != null) {
super.setFont(font);
}
}
}
代码示例来源:origin: fr.opensagres.xdocreport/org.apache.poi.xwpf.converter
public void applyStyles( Object ele, Style style )
{
this.lastStyleApplied = style;
StyleTextProperties textProperties = style.getTextProperties();
if ( textProperties != null )
{
// Font
Font font = textProperties.getFont();
if ( font != null )
{
super.setFont( font );
}
}
}
代码示例来源:origin: fr.opensagres.xdocreport/fr.opensagres.odfdom.converter.pdf
public void applyStyles( Style style )
{
this.lastStyleApplied = style;
StyleTextProperties textProperties = style.getTextProperties();
if ( textProperties != null )
{
// Font
Font font = textProperties.getFont();
if ( font != null )
{
super.setFont( font );
}
}
}
代码示例来源:origin: fr.opensagres.xdocreport/org.odftoolkit.odfdom.converter.pdf
public void applyStyles( Style style )
{
this.lastStyleApplied = style;
StyleTextProperties textProperties = style.getTextProperties();
if ( textProperties != null )
{
// Font
Font font = textProperties.getFont();
if ( font != null )
{
super.setFont( font );
}
}
}
代码示例来源: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: stackoverflow.com
PdfPCell cellProduto = new PdfPCell();
Phrase phraseProduto = new Phrase(String.valueOf(produto));
phraseProduto.setFont(new Font(Font.FontFamily.HELVETICA, 11, Font.BOLD|Font.UNDERLINE, new BaseColor(50, 65, 200)));
cellProduto.addElement(phraseProduto);
cellProduto.setColspan(5);
PdfPCell cellMapa = new PdfPCell();
Phrase phraseMapa = new Phrase(mapa);
phraseMapa.setFont(new Font(Font.FontFamily.HELVETICA, 9, Font.BOLD, new BaseColor(215, 100, 0)));
cellMapa.addElement(phraseMapa);
List<PrePedidoItem> itensDoMapa = mapas.get(mapa);
DecimalFormat df = new DecimalFormat("###,##0.00");
Phrase phraseItem = new Phrase(df.format(item.getLargura()) + " x " + df.format(item.getComprimento()));
phraseItem.setFont(new Font(Font.FontFamily.HELVETICA, 9, Font.NORMAL, BaseColor.BLACK));
cellMapa.addElement(phraseItem);
代码示例来源:origin: stackoverflow.com
f.setFont(subFont);
PdfPCell cell = new PdfPCell(f);
cell.setPadding(0);
内容来源于网络,如有侵权,请联系作者删除!