Top Description Fields Constructors Methods
org.apache.poi.hssf.usermodel

pack-priv final Class StaticFontMetrics

extends Object
Class Inheritance
Imports
java.awt.Font, java.io.File, .IOException, .InputStream, java.nio.file.Files, java.util.HashMap, .Map, .Properties, org.apache.logging.log4j.LogManager, .Logger

Allows the user to lookup the font metrics for a particular font without actually having the font on the system. The font details are loaded as a resource from the POI jar file (or classpath) and should be contained in path "/font_metrics.properties". The font widths are for a 10 point version of the font. Use a multiplier for other sizes.

Field Summary

Modifier and TypeField and Description
private static final Map<String, FontDetails>
fontDetailsMap

Our cache of font details we've already looked up

private static Properties
fontMetricsProps

The font metrics property file we're using

private static final Logger

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static synchronized FontDetails

Returns:

the fake font.
getFontDetails
(Font
the font to lookup.
font
)

Retrieves the fake font details for a given font.

private static Properties
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

fontDetailsMapback to summary
private static final Map<String, FontDetails> fontDetailsMap

Our cache of font details we've already looked up

fontMetricsPropsback to summary
private static Properties fontMetricsProps

The font metrics property file we're using

LOGGERback to summary
private static final Logger LOGGER

Constructor Detail

StaticFontMetricsback to summary
private StaticFontMetrics()

Method Detail

getFontDetailsback to summary
public static synchronized FontDetails getFontDetails(Font font)

Retrieves the fake font details for a given font.

Parameters
font:Font

the font to lookup.

Returns:FontDetails

the fake font.

loadMetricsback to summary
private static Properties loadMetrics() throws IOException