org.apache.poi.ss.usermodel
Interface Font

All Known Implementing Classes:
HSSFFont

public interface Font


Field Summary
static byteANSI_CHARSET
          ANSI character set
static shortBOLDWEIGHT_BOLD
          Bold boldness (bold)
static shortBOLDWEIGHT_NORMAL
          Normal boldness (not bold)
static shortCOLOR_NORMAL
          normal type of black color.
static shortCOLOR_RED
          Dark Red color
static byteDEFAULT_CHARSET
          Default character set.
static shortSS_NONE
          no type offsetting (not super or subscript)
static shortSS_SUB
          subscript
static shortSS_SUPER
          superscript
static byteSYMBOL_CHARSET
          Symbol character set
static byteU_DOUBLE
          double underlined
static byteU_DOUBLE_ACCOUNTING
          accounting style double underline
static byteU_NONE
          not underlined
static byteU_SINGLE
          single (normal) underline
static byteU_SINGLE_ACCOUNTING
          accounting style single underline
 
Method Summary
 booleangetBold()
           
 shortgetBoldweight()
           
 intgetCharSet()
          get character-set to use.
 shortgetColor()
          get the color for the font
 shortgetFontHeight()
          Get the font height in unit's of 1/20th of a point.
 shortgetFontHeightInPoints()
          Get the font height in points.
 java.lang.StringgetFontName()
          get the name for the font (i.e.
 shortgetIndex()
          get the index within the XSSFWorkbook (sequence within the collection of Font objects)
 booleangetItalic()
          get whether to use italics or not
 booleangetStrikeout()
          get whether to use a strikeout horizontal line through the text or not
 shortgetTypeOffset()
          get normal,super or subscript.
 bytegetUnderline()
          get type of text underlining to use
 voidsetBold(boolean bold)
           
 voidsetBoldweight(short boldweight)
           
 voidsetCharSet(byte charset)
          set character-set to use.
 voidsetCharSet(int charset)
          set character-set to use.
 voidsetColor(short color)
          set the color for the font
 voidsetFontHeight(short height)
          set the font height in unit's of 1/20th of a point.
 voidsetFontHeightInPoints(short height)
          set the font height
 voidsetFontName(java.lang.String name)
          set the name for the font (i.e.
 voidsetItalic(boolean italic)
          set whether to use italics or not
 voidsetStrikeout(boolean strikeout)
          set whether to use a strikeout horizontal line through the text or not
 voidsetTypeOffset(short offset)
          set normal,super or subscript.
 voidsetUnderline(byte underline)
          set type of text underlining to use
 

Field Detail

BOLDWEIGHT_NORMAL

static final short BOLDWEIGHT_NORMAL
Normal boldness (not bold)

See Also:
Constant Field Values


BOLDWEIGHT_BOLD

static final short BOLDWEIGHT_BOLD
Bold boldness (bold)

See Also:
Constant Field Values


COLOR_NORMAL

static final short COLOR_NORMAL
normal type of black color.

See Also:
Constant Field Values


COLOR_RED

static final short COLOR_RED
Dark Red color

See Also:
Constant Field Values


SS_NONE

static final short SS_NONE
no type offsetting (not super or subscript)

See Also:
Constant Field Values


SS_SUPER

static final short SS_SUPER
superscript

See Also:
Constant Field Values


SS_SUB

static final short SS_SUB
subscript

See Also:
Constant Field Values


U_NONE

static final byte U_NONE
not underlined

See Also:
Constant Field Values


U_SINGLE

static final byte U_SINGLE
single (normal) underline

See Also:
Constant Field Values


U_DOUBLE

static final byte U_DOUBLE
double underlined

See Also:
Constant Field Values


U_SINGLE_ACCOUNTING

static final byte U_SINGLE_ACCOUNTING
accounting style single underline

See Also:
Constant Field Values


U_DOUBLE_ACCOUNTING

static final byte U_DOUBLE_ACCOUNTING
accounting style double underline

See Also:
Constant Field Values


ANSI_CHARSET

static final byte ANSI_CHARSET
ANSI character set

See Also:
Constant Field Values


DEFAULT_CHARSET

static final byte DEFAULT_CHARSET
Default character set.

See Also:
Constant Field Values


SYMBOL_CHARSET

static final byte SYMBOL_CHARSET
Symbol character set

See Also:
Constant Field Values

Method Detail

setFontName

void setFontName(java.lang.String name)
set the name for the font (i.e. Arial)

Parameters:
name - String representing the name of the font to use

getFontName

java.lang.String getFontName()
get the name for the font (i.e. Arial)

Returns:
String representing the name of the font to use

setFontHeight

void setFontHeight(short height)
set the font height in unit's of 1/20th of a point. Maybe you might want to use the setFontHeightInPoints which matches to the familiar 10, 12, 14 etc..

Parameters:
height - height in 1/20ths of a point
See Also:
setFontHeightInPoints(short)

setFontHeightInPoints

void setFontHeightInPoints(short height)
set the font height

Parameters:
height - height in the familiar unit of measure - points
See Also:
setFontHeight(short)

getFontHeight

short getFontHeight()
Get the font height in unit's of 1/20th of a point.

For many users, the related getFontHeightInPoints() will be more helpful, as that returns font heights in the more familiar points units, eg 10, 12, 14.

Returns:
short - height in 1/20ths of a point
See Also:
getFontHeightInPoints()

getFontHeightInPoints

short getFontHeightInPoints()
Get the font height in points.

This will return the same font height that is shown in Excel, such as 10 or 14 or 28.

Returns:
short - height in the familiar unit of measure - points
See Also:
getFontHeight()

setItalic

void setItalic(boolean italic)
set whether to use italics or not

Parameters:
italic - italics or not

getItalic

boolean getItalic()
get whether to use italics or not

Returns:
italics or not

setStrikeout

void setStrikeout(boolean strikeout)
set whether to use a strikeout horizontal line through the text or not

Parameters:
strikeout - or not

getStrikeout

boolean getStrikeout()
get whether to use a strikeout horizontal line through the text or not

Returns:
strikeout or not

setColor

void setColor(short color)
set the color for the font

Parameters:
color - to use
See Also:
Note: Use this rather than HSSFColor.AUTOMATIC for default font color, COLOR_RED

getColor

short getColor()
get the color for the font

Returns:
color to use
See Also:
COLOR_NORMAL, COLOR_RED, HSSFPalette.getColor(short)

setTypeOffset

void setTypeOffset(short offset)
set normal,super or subscript.

Parameters:
offset - type to use (none,super,sub)
See Also:
SS_NONE, SS_SUPER, SS_SUB

getTypeOffset

short getTypeOffset()
get normal,super or subscript.

Returns:
offset type to use (none,super,sub)
See Also:
SS_NONE, SS_SUPER, SS_SUB

setUnderline

void setUnderline(byte underline)
set type of text underlining to use

Parameters:
underline - type
See Also:
U_NONE, U_SINGLE, U_DOUBLE, U_SINGLE_ACCOUNTING, U_DOUBLE_ACCOUNTING

getUnderline

byte getUnderline()
get type of text underlining to use

Returns:
underlining type
See Also:
U_NONE, U_SINGLE, U_DOUBLE, U_SINGLE_ACCOUNTING, U_DOUBLE_ACCOUNTING

getCharSet

int getCharSet()
get character-set to use.

Returns:
character-set
See Also:
ANSI_CHARSET, DEFAULT_CHARSET, SYMBOL_CHARSET

setCharSet

void setCharSet(byte charset)
set character-set to use.

See Also:
ANSI_CHARSET, DEFAULT_CHARSET, SYMBOL_CHARSET

setCharSet

void setCharSet(int charset)
set character-set to use.

See Also:
ANSI_CHARSET, DEFAULT_CHARSET, SYMBOL_CHARSET

getIndex

short getIndex()
get the index within the XSSFWorkbook (sequence within the collection of Font objects)

Returns:
unique index number of the underlying record this Font represents (probably you don't care unless you're comparing which one is which)

setBoldweight

void setBoldweight(short boldweight)

setBold

void setBold(boolean bold)

getBoldweight

short getBoldweight()

getBold

boolean getBold()




NOTHING
NOTHING
Add the Maven Dependecy to your project: maven dependecy for com.amazonaws : aws-java-sdk : 1.3.14