本文整理匯總了Java中org.apache.poi.hssf.usermodel.HSSFFont.BOLDWEIGHT_NORMAL屬性的典型用法代碼示例。如果您正苦於以下問題:Java HSSFFont.BOLDWEIGHT_NORMAL屬性的具體用法?Java HSSFFont.BOLDWEIGHT_NORMAL怎麽用?Java HSSFFont.BOLDWEIGHT_NORMAL使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類org.apache.poi.hssf.usermodel.HSSFFont
的用法示例。
在下文中一共展示了HSSFFont.BOLDWEIGHT_NORMAL屬性的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: fontStyle
private void fontStyle(CellStyle style) {
Font font = wb.getFontAt(style.getFontIndex());
if (font.getBoldweight() >= HSSFFont.BOLDWEIGHT_NORMAL)
out.format(" font-weight: bold;%n");
if (font.getItalic())
out.format(" font-style: italic;%n");
int fontheight = font.getFontHeightInPoints();
if (fontheight == 9) {
//fix for stupid ol Windows
fontheight = 10;
}
out.format(" font-size: %dpt;%n", fontheight);
// Font color is handled with the other colors
}
示例2: processCellStyleFont
protected void processCellStyleFont( HSSFWorkbook workbook,
Element blockTarget, HSSFFont font )
{
Triplet triplet = new Triplet();
triplet.fontName = font.getFontName();
switch ( font.getBoldweight() )
{
case HSSFFont.BOLDWEIGHT_BOLD:
triplet.bold = true;
break;
case HSSFFont.BOLDWEIGHT_NORMAL:
triplet.bold = false;
break;
}
if ( font.getItalic() )
{
triplet.italic = true;
}
getFontReplacer().update( triplet );
setBlockProperties( blockTarget, triplet );
final HSSFColor fontColor = workbook.getCustomPalette().getColor(
font.getColor() );
if ( fontColor != null )
blockTarget.setAttribute( "color",
ExcelToHtmlUtils.getColor( fontColor ) );
if ( font.getFontHeightInPoints() != 0 )
blockTarget.setAttribute( "font-size", font.getFontHeightInPoints()*0.8
+ "pt" );
}
示例3: buildStyle_font
void buildStyle_font( HSSFWorkbook workbook, StringBuilder style,
HSSFFont font )
{
switch ( font.getBoldweight() )
{
case HSSFFont.BOLDWEIGHT_BOLD:
style.append( "font-weight:bold;" );
break;
case HSSFFont.BOLDWEIGHT_NORMAL:
// by default, not not increase HTML size
// style.append( "font-weight: normal; " );
break;
}
final HSSFColor fontColor = workbook.getCustomPalette().getColor(
font.getColor() );
if ( fontColor != null )
style.append( "color: " + ExcelToHtmlUtils.getColor( fontColor )
+ "; " );
if ( font.getFontHeightInPoints() != 0 )
style.append( "font-size:" + font.getFontHeightInPoints()*0.65*scale + "pt;" );
if ( font.getItalic() )
{
style.append( "font-style:italic;" );
}
}