org.apache.pdfbox.pdmodel.font

## Class FontCache

- java.lang.Object
- - org.apache.pdfbox.pdmodel.font.FontCache

    public final class FontCache
    extends Object

An in-memory cache for system fonts. This allows PDFBox to manage caching for a `FontProvider`. PDFBox is free to purge this cache at will.

Author:
  John Hewson

### Constructor Summary

Constructors
Constructor and Description
`FontCache()`

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `addFont(FontInfo info, org.apache.fontbox.FontBoxFont font)` Adds the given FontBox font to the cache.
`org.apache.fontbox.FontBoxFont` `getFont(FontInfo info)` Returns the FontBox font associated with the given FontInfo.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### FontCache

    public FontCache()

### Method Detail

#### addFont

    public void addFont(FontInfo info,
                        org.apache.fontbox.FontBoxFont font)

Adds the given FontBox font to the cache.

Parameters:
  `info` - the FontInfo to be used as key
  `font` - the font to be cached

#### getFont

    public org.apache.fontbox.FontBoxFont getFont(FontInfo info)

Returns the FontBox font associated with the given FontInfo.

Parameters:
  `info` - the FontInfo of the cached font
Returns:
  the cached font if available, otherwise null