public class FontCache
extends java.lang.Object
A FontCache
is used internally to keep track of
Fonts
. It defines and uses a string format for declaring
all possible font values that can be defined in a Font
. Its
lifetime is meant to last only during a single transformation. When
created, it reads in all pre-existing Font
information and
caches it for later reference.
Constructor | Description |
---|---|
FontCache(org.apache.poi.ss.usermodel.Workbook workbook) |
Constructs a
FontCache on a Workbook . |
Modifier and Type | Method | Description |
---|---|---|
void |
cacheFont(org.apache.poi.ss.usermodel.Font f) |
Caches the given
Font . |
org.apache.poi.ss.usermodel.Font |
findFont(org.apache.poi.ss.usermodel.Font f) |
Finds the given cached
Font with the font characteristics of
the given Font . |
int |
getNumEntries() |
Returns the number of entries in this cache.
|
org.apache.poi.ss.usermodel.Font |
retrieveFont(short fontBoldweight,
boolean fontItalic,
org.apache.poi.ss.usermodel.Color fontColor,
java.lang.String fontName,
short fontHeightInPoints,
byte fontUnderline,
boolean fontStrikeout,
int fontCharset,
short fontTypeOffset) |
Retrieve a
Font from the cache with the given
properties. |
public FontCache(org.apache.poi.ss.usermodel.Workbook workbook)
FontCache
on a Workbook
.
Caches all Fonts
found within.workbook
- A Workbook
.public int getNumEntries()
public org.apache.poi.ss.usermodel.Font retrieveFont(short fontBoldweight, boolean fontItalic, org.apache.poi.ss.usermodel.Color fontColor, java.lang.String fontName, short fontHeightInPoints, byte fontUnderline, boolean fontStrikeout, int fontCharset, short fontTypeOffset)
Font
from the cache with the given
properties.fontBoldweight
- The font boldweight.fontItalic
- Whether the font is italic.fontColor
- The font color.fontName
- The font name.fontHeightInPoints
- The font height in points.fontUnderline
- The font underline.fontStrikeout
- Whether the font is in strikeout.fontCharset
- The font charset.fontTypeOffset
- The font type offset.Font
that matches all given properties, or
null
if it doesn't exist.public void cacheFont(org.apache.poi.ss.usermodel.Font f)
Font
.f
- A Font
.public org.apache.poi.ss.usermodel.Font findFont(org.apache.poi.ss.usermodel.Font f)
Font
with the font characteristics of
the given Font
.f
- A Font
which may not be in the cache.Font
in the cache that matches f
's
font characteristics, if it exists, else null
.Copyright © 2012–2018 Jett Team. All rights reserved.