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

public Interface FontInfo

Known Direct Implementers
org.apache.poi.sl.draw.DrawFontInfo, org.apache.poi.common.usermodel.fonts.FontHeader
Annotations
@SuppressWarnings:unused
Imports
java.util.Collections, .List, org.apache.poi.util.Beta

A FontInfo object holds information about a font configuration. It is roughly an equivalent to the LOGFONT structure in Windows GDI.

If an implementation doesn't provide a property, the getter will return null - if the value is unset, a default value will be returned.

Setting an unsupported property results in an UnsupportedOperationException.

Since
POI 3.17-beta2
See Also
LOGFONT structure

Method Summary

Modifier and TypeMethod and Description
public default FontCharset

Returns:

the font charset
getCharset
()

public default List<? extends FontFacet>

Returns:

the list of embedded EOT font data
getFacets
()

If font facets are embedded in the document, return the list of embedded facets.

public default FontFamily

Returns:

the family class
getFamily
()

public default Integer

Returns:

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

Get the index within the collection of Font objects

public default byte[]

Returns:

panose info in binary form or null if unknown
getPanose
()

public default FontPitch

Returns:

the font pitch or null if unsupported
getPitch
()

public String

Returns:

the full name of the font, i.e. font family + type face
getTypeface
()

public default void
setCharset(FontCharset
the charset
charset
)

Sets the charset

public default void
setFamily(FontFamily
the font family class
family
)

Sets the font family class

public default void
setIndex(int
the index within the collection of Font objects
index
)

Sets the index within the collection of Font objects

public default void
setPanose(byte[]
the panose bytes
panose
)

Set the panose in binary form

public default void
setPitch(FontPitch
the font pitch
pitch
)

Set the font pitch

public default void
setTypeface(String
the full name of the font, when null removes the font definition - removal is implementation specific
typeface
)

Sets the font name

Method Detail

getCharsetback to summary
public default FontCharset getCharset()
Returns:FontCharset

the font charset

getFacetsback to summary
public default List<? extends FontFacet> getFacets()

If font facets are embedded in the document, return the list of embedded facets. The font embedding is experimental, therefore the API can change.

Returns:List<? extends FontFacet>

the list of embedded EOT font data

Annotations
@Beta
getFamilyback to summary
public default FontFamily getFamily()
Returns:FontFamily

the family class

getIndexback to summary
public default Integer getIndex()

Get the index within the collection of Font objects

Returns:Integer

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

getPanoseback to summary
public default byte[] getPanose()
Returns:byte[]

panose info in binary form or null if unknown

getPitchback to summary
public default FontPitch getPitch()
Returns:FontPitch

the font pitch or null if unsupported

getTypefaceback to summary
public String getTypeface()
Returns:String

the full name of the font, i.e. font family + type face

setCharsetback to summary
public default void setCharset(FontCharset charset)

Sets the charset

Parameters
charset:FontCharset

the charset

Exceptions
UnsupportedOperationException:
can return UnsupportedOperationException when FontInfo is read-only
setFamilyback to summary
public default void setFamily(FontFamily family)

Sets the font family class

Parameters
family:FontFamily

the font family class

Exceptions
UnsupportedOperationException:
can return UnsupportedOperationException when FontInfo is read-only
setIndexback to summary
public default void setIndex(int index)

Sets the index within the collection of Font objects

Parameters
index:int

the index within the collection of Font objects

Exceptions
UnsupportedOperationException:
if unsupported
setPanoseback to summary
public default void setPanose(byte[] panose)

Set the panose in binary form

Parameters
panose:byte[]

the panose bytes

Exceptions
UnsupportedOperationException:
can return UnsupportedOperationException when FontInfo is read-only
setPitchback to summary
public default void setPitch(FontPitch pitch)

Set the font pitch

Parameters
pitch:FontPitch

the font pitch

Exceptions
UnsupportedOperationException:
if unsupported
setTypefaceback to summary
public default void setTypeface(String typeface)

Sets the font name

Parameters
typeface:String

the full name of the font, when null removes the font definition - removal is implementation specific

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