本文整理了Java中com.itextpdf.text.Font.getColor()
方法的一些代码示例,展示了Font.getColor()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Font.getColor()
方法的具体详情如下:
包路径:com.itextpdf.text.Font
类名称:Font
方法名:getColor
[英]Gets the color of this font.
[中]获取此字体的颜色。
代码示例来源:origin: com.itextpdf/itextg
/**
* Creates a new instance of the LineSeparator class.
* @param font the font
*/
public LineSeparator(Font font) {
this.lineWidth = PdfChunk.UNDERLINE_THICKNESS * font.getSize();
this.offset = PdfChunk.UNDERLINE_OFFSET * font.getSize();
this.percentage = 100;
this.lineColor = font.getColor();
}
代码示例来源:origin: com.itextpdf/itextpdf
/**
* Creates a new instance of the LineSeparator class.
* @param font the font
*/
public LineSeparator(Font font) {
this.lineWidth = PdfChunk.UNDERLINE_THICKNESS * font.getSize();
this.offset = PdfChunk.UNDERLINE_OFFSET * font.getSize();
this.percentage = 100;
this.lineColor = font.getColor();
}
代码示例来源:origin: com.itextpdf/itextg
/**
* Adds a <CODE>Font</CODE> to be searched for valid characters.
* @param font the <CODE>Font</CODE>
*/
public void addFont(Font font) {
if (font.getBaseFont() != null) {
fonts.add(font);
return;
}
BaseFont bf = font.getCalculatedBaseFont(true);
Font f2 = new Font(bf, font.getSize(), font.getCalculatedStyle(), font.getColor());
fonts.add(f2);
}
代码示例来源:origin: com.itextpdf/itextpdf
/**
* Adds a <CODE>Font</CODE> to be searched for valid characters.
* @param font the <CODE>Font</CODE>
*/
public void addFont(Font font) {
if (!isSupported(font)) {
unsupportedFonts.add(font);
return;
}
if (font.getBaseFont() != null) {
fonts.add(font);
return;
}
BaseFont bf = font.getCalculatedBaseFont(true);
Font f2 = new Font(bf, font.getSize(), font.getCalculatedStyle(), font.getColor());
fonts.add(f2);
}
代码示例来源:origin: com.itextpdf/itextpdf
/**
* Gets a chunk with a symbol character.
* @param c a character that has to be changed into a symbol
* @param font Font if there is no SYMBOL character corresponding with c
* @return a SYMBOL version of a character
*/
public static Chunk get(char c, Font font) {
char greek = SpecialSymbol.getCorrespondingSymbol(c);
if (greek == ' ') {
return new Chunk(String.valueOf(c), font);
}
Font symbol = new Font(FontFamily.SYMBOL, font.getSize(), font.getStyle(), font.getColor());
String s = String.valueOf(greek);
return new Chunk(s, symbol);
}
代码示例来源:origin: com.itextpdf/itextg
/**
* Gets a chunk with a symbol character.
* @param c a character that has to be changed into a symbol
* @param font Font if there is no SYMBOL character corresponding with c
* @return a SYMBOL version of a character
*/
public static Chunk get(char c, Font font) {
char greek = SpecialSymbol.getCorrespondingSymbol(c);
if (greek == ' ') {
return new Chunk(String.valueOf(c), font);
}
Font symbol = new Font(FontFamily.SYMBOL, font.getSize(), font.getStyle(), font.getColor());
String s = String.valueOf(greek);
return new Chunk(s, symbol);
}
代码示例来源:origin: com.itextpdf/itextpdf
/**
* Gets a chunk with a symbol character.
* @param e a symbol value (see Entities class: alfa is greek alfa,...)
* @param font the font if the symbol isn't found (otherwise Font.SYMBOL)
* @return a Chunk
*/
public static Chunk get(final String e, final Font font) {
char s = getCorrespondingSymbol(e);
if (s == (char)0) {
try {
return new Chunk(String.valueOf((char)Integer.parseInt(e)), font);
}
catch(Exception exception) {
return new Chunk(e, font);
}
}
Font symbol = new Font(FontFamily.SYMBOL, font.getSize(), font.getStyle(), font.getColor());
return new Chunk(String.valueOf(s), symbol);
}
代码示例来源:origin: com.itextpdf/itextg
/**
* Gets a chunk with a symbol character.
* @param e a symbol value (see Entities class: alfa is greek alfa,...)
* @param font the font if the symbol isn't found (otherwise Font.SYMBOL)
* @return a Chunk
*/
public static Chunk get(final String e, final Font font) {
char s = getCorrespondingSymbol(e);
if (s == (char)0) {
try {
return new Chunk(String.valueOf((char)Integer.parseInt(e)), font);
}
catch(Exception exception) {
return new Chunk(e, font);
}
}
Font symbol = new Font(FontFamily.SYMBOL, font.getSize(), font.getStyle(), font.getColor());
return new Chunk(String.valueOf(s), symbol);
}
代码示例来源:origin: com.itextpdf/itextpdf
attributes.put(Chunk.ACTION, action);
noStroke.put(Chunk.COLOR, f.getColor());
noStroke.put(Chunk.ENCODING, font.getFont().getEncoding());
代码示例来源:origin: org.technbolts/gutenberg
public static FontDescriptor fontDescriptor(Font font) {
return new FontDescriptor(font, font.getBaseFont(), null, font.getSize(), font.getStyle(), font.getColor());
}
代码示例来源:origin: com.itextpdf/itextg
string = string.substring(index);
Font symbol = new Font(FontFamily.SYMBOL, font.getSize(), font.getStyle(), font.getColor());
StringBuffer buf = new StringBuffer();
buf.append(SpecialSymbol.getCorrespondingSymbol(string.charAt(0)));
代码示例来源:origin: com.itextpdf/itextpdf
string = string.substring(index);
Font symbol = new Font(FontFamily.SYMBOL, font.getSize(), font.getStyle(), font.getColor());
StringBuffer buf = new StringBuffer();
buf.append(SpecialSymbol.getCorrespondingSymbol(string.charAt(0)));
代码示例来源:origin: com.itextpdf/itextpdf
return 4;
if (this.color.equals(font.getColor())) {
return 0;
代码示例来源:origin: com.itextpdf/itextg
return 4;
if (this.color.equals(font.getColor())) {
return 0;
代码示例来源:origin: org.technbolts/gutenberg
public static Font adjustWithStyles(Font fontToAdjust, Font ref) {
return new FontCopier(fontToAdjust)
.size(ref.getSize())
.style(ref.getStyle())
.color(ref.getColor())
.get();
}
代码示例来源:origin: com.itextpdf/itextpdf
if ((chunk.getFont() != null) && (chunk.getFont().getColor() != null)) {
BaseColor c = chunk.getFont().getColor();
setColorAttribute(c, obj, PdfName.COLOR);
代码示例来源:origin: com.itextpdf/itextg
if ((chunk.getFont() != null) && (chunk.getFont().getColor() != null)) {
BaseColor c = chunk.getFont().getColor();
setColorAttribute(c, obj, PdfName.COLOR);
代码示例来源:origin: org.technbolts/gutenberg
public Font modify(Font font) {
if (noModifier())
return font;
int fontStyle = styleOf(font);
fontStyle = overrideIfNotNull(fontStyle, style);
fontStyle = applyStyleModifier(fontStyle, bold, Font.BOLD);
fontStyle = applyStyleModifier(fontStyle, italic, Font.ITALIC);
return new Font(font.getBaseFont(),
val(size, font.getSize()),
val(fontStyle, font.getStyle()),
val(color, font.getColor()));
}
代码示例来源:origin: com.itextpdf/itextpdf
if ((paragraph.getFont() != null) && (paragraph.getFont().getColor() != null)) {
BaseColor c = paragraph.getFont().getColor();
setColorAttribute(c, obj, PdfName.COLOR);
代码示例来源:origin: com.itextpdf/itextg
if ((paragraph.getFont() != null) && (paragraph.getFont().getColor() != null)) {
BaseColor c = paragraph.getFont().getColor();
setColorAttribute(c, obj, PdfName.COLOR);
内容来源于网络,如有侵权,请联系作者删除!