Top Description Methods
org.apache.poi.common.usermodel.fonts

public Interface FontFacet

Annotations
@SuppressWarnings:unused
@Beta
Imports
org.apache.poi.util.Beta

A FontFacet holds the font data for a shape of a font, i.e. a regular, italic, bold or bold-italic version of a Font.

Method Summary

Modifier and TypeMethod and Description
public default Object

Returns:

the wrapper object holding the font data
getFontData
()

public default int

Returns:

the font weight
getWeight
()

Get the font weight.

public default boolean

Returns:

true, if the font is italic
isItalic
()

public default void
setItalic(boolean
true for italic, false for regular
italic
)

Set the font posture

public default void
setWeight(int
the font weight
weight
)

Set the font weight

Method Detail

getFontDataback to summary
public default Object getFontData()
Returns:Object

the wrapper object holding the font data

getWeightback to summary
public default int getWeight()

Get the font weight.

The weight of the font in the range 0 through 1000. For example, 400 is normal and 700 is bold. If this value is zero, a default weight is used.

Returns:int

the font weight

Since
POI 4.1.0
isItalicback to summary
public default boolean isItalic()
Returns:boolean

true, if the font is italic

setItalicback to summary
public default void setItalic(boolean italic)

Set the font posture

Parameters
italic:boolean

true for italic, false for regular

Exceptions
UnsupportedOperationException:
can return UnsupportedOperationException when FontFacet is read-only
setWeightback to summary
public default void setWeight(int weight)

Set the font weight

Parameters
weight:int

the font weight

Exceptions
UnsupportedOperationException:
can return UnsupportedOperationException when FontFacet is read-only