本文整理了Java中org.apache.poi.hssf.usermodel.HSSFFont.setTypeOffset()
方法的一些代码示例,展示了HSSFFont.setTypeOffset()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。HSSFFont.setTypeOffset()
方法的具体详情如下:
包路径:org.apache.poi.hssf.usermodel.HSSFFont
类名称:HSSFFont
方法名:setTypeOffset
[英]set normal,super or subscript.
[中]设置普通、超级或下标。
代码示例来源:origin: org.apache.poi/poi
private HSSFFont matchFont( Font matchFont )
{
HSSFColor hssfColor = workbook.getCustomPalette()
.findColor((byte)foreground.getRed(), (byte)foreground.getGreen(), (byte)foreground.getBlue());
if (hssfColor == null)
hssfColor = workbook.getCustomPalette().findSimilarColor((byte)foreground.getRed(), (byte)foreground.getGreen(), (byte)foreground.getBlue());
boolean bold = (matchFont.getStyle() & Font.BOLD) != 0;
boolean italic = (matchFont.getStyle() & Font.ITALIC) != 0;
HSSFFont hssfFont = workbook.findFont(bold,
hssfColor.getIndex(),
(short)(matchFont.getSize() * 20),
matchFont.getName(),
italic,
false,
(short)0,
(byte)0);
if (hssfFont == null)
{
hssfFont = workbook.createFont();
hssfFont.setBold(bold);
hssfFont.setColor(hssfColor.getIndex());
hssfFont.setFontHeight((short)(matchFont.getSize() * 20));
hssfFont.setFontName(matchFont.getName());
hssfFont.setItalic(italic);
hssfFont.setStrikeout(false);
hssfFont.setTypeOffset((short) 0);
hssfFont.setUnderline((byte) 0);
}
return hssfFont;
}
代码示例来源:origin: com.haulmont.thirdparty/poi
private HSSFFont matchFont( Font font )
{
HSSFColor hssfColor = workbook.getCustomPalette()
.findColor((byte)foreground.getRed(), (byte)foreground.getGreen(), (byte)foreground.getBlue());
if (hssfColor == null)
hssfColor = workbook.getCustomPalette().findSimilarColor((byte)foreground.getRed(), (byte)foreground.getGreen(), (byte)foreground.getBlue());
boolean bold = (font.getStyle() & Font.BOLD) != 0;
boolean italic = (font.getStyle() & Font.ITALIC) != 0;
HSSFFont hssfFont = workbook.findFont(bold ? HSSFFont.BOLDWEIGHT_BOLD : 0,
hssfColor.getIndex(),
(short)(font.getSize() * 20),
font.getName(),
italic,
false,
(short)0,
(byte)0);
if (hssfFont == null)
{
hssfFont = workbook.createFont();
hssfFont.setBoldweight(bold ? HSSFFont.BOLDWEIGHT_BOLD : 0);
hssfFont.setColor(hssfColor.getIndex());
hssfFont.setFontHeight((short)(font.getSize() * 20));
hssfFont.setFontName(font.getName());
hssfFont.setItalic(italic);
hssfFont.setStrikeout(false);
hssfFont.setTypeOffset((short) 0);
hssfFont.setUnderline((byte) 0);
}
return hssfFont;
}
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.poi
private HSSFFont matchFont( Font matchFont )
{
HSSFColor hssfColor = workbook.getCustomPalette()
.findColor((byte)foreground.getRed(), (byte)foreground.getGreen(), (byte)foreground.getBlue());
if (hssfColor == null)
hssfColor = workbook.getCustomPalette().findSimilarColor((byte)foreground.getRed(), (byte)foreground.getGreen(), (byte)foreground.getBlue());
boolean bold = (matchFont.getStyle() & Font.BOLD) != 0;
boolean italic = (matchFont.getStyle() & Font.ITALIC) != 0;
HSSFFont hssfFont = workbook.findFont(bold,
hssfColor.getIndex(),
(short)(matchFont.getSize() * 20),
matchFont.getName(),
italic,
false,
(short)0,
(byte)0);
if (hssfFont == null)
{
hssfFont = workbook.createFont();
hssfFont.setBold(bold);
hssfFont.setColor(hssfColor.getIndex());
hssfFont.setFontHeight((short)(matchFont.getSize() * 20));
hssfFont.setFontName(matchFont.getName());
hssfFont.setItalic(italic);
hssfFont.setStrikeout(false);
hssfFont.setTypeOffset((short) 0);
hssfFont.setUnderline((byte) 0);
}
return hssfFont;
}
代码示例来源:origin: org.openl.rules/org.openl.lib.poi.dev
private HSSFFont matchFont( Font font )
{
HSSFColor hssfColor = workbook.getCustomPalette()
.findColor((byte)foreground.getRed(), (byte)foreground.getGreen(), (byte)foreground.getBlue());
if (hssfColor == null)
hssfColor = workbook.getCustomPalette().findSimilarColor((byte)foreground.getRed(), (byte)foreground.getGreen(), (byte)foreground.getBlue());
boolean bold = (font.getStyle() & Font.BOLD) != 0;
boolean italic = (font.getStyle() & Font.ITALIC) != 0;
HSSFFont hssfFont = workbook.findFont(bold ? HSSFFont.BOLDWEIGHT_BOLD : 0,
hssfColor.getIndex(),
(short)(font.getSize() * 20),
font.getName(),
italic,
false,
(short)0,
(byte)0);
if (hssfFont == null)
{
hssfFont = workbook.createFont();
hssfFont.setBoldweight(bold ? HSSFFont.BOLDWEIGHT_BOLD : 0);
hssfFont.setColor(hssfColor.getIndex());
hssfFont.setFontHeight((short)(font.getSize() * 20));
hssfFont.setFontName(font.getName());
hssfFont.setItalic(italic);
hssfFont.setStrikeout(false);
hssfFont.setTypeOffset((short) 0);
hssfFont.setUnderline((byte) 0);
}
return hssfFont;
}
代码示例来源:origin: stackoverflow.com
fontNew.setItalic(fontOld.getItalic());
fontNew.setStrikeout(fontOld.getStrikeout());
fontNew.setTypeOffset(fontOld.getTypeOffset());
fontNew.setUnderline(fontOld.getUnderline());
return fontNew;
代码示例来源:origin: jasperreports/jasperreports
cellFont.setTypeOffset(superscriptType);
loadedFonts.add(cellFont);
代码示例来源:origin: cuba-platform/yarg
newFont.setItalic(cellFont.getItalic());
newFont.setStrikeout(cellFont.getStrikeout());
newFont.setTypeOffset(cellFont.getTypeOffset());
newFont.setBold(cellFont.getBold());
newFont.setCharSet(cellFont.getCharSet());
代码示例来源:origin: com.haulmont.yarg/yarg
newFont.setItalic(cellFont.getItalic());
newFont.setStrikeout(cellFont.getStrikeout());
newFont.setTypeOffset(cellFont.getTypeOffset());
newFont.setBoldweight(cellFont.getBoldweight());
newFont.setCharSet(cellFont.getCharSet());
内容来源于网络,如有侵权,请联系作者删除!