* @return The metrics file for this font.
* @throws IOException For errors reading the metrics file.
* @throws FontException For internal errors in the metrics file.
*/
private MetricsFile getMetricsFile() throws IOException, FontException {
MetricsFile metricsFile = null;
final URL serializedMetricsFile = this.getRegisteredFont()
.getSerializedMetricsFile();
if (serializedMetricsFile == null) {
final MetricsFileReader reader = this.getRegisteredFont()
.getMetricsFileReader();
metricsFile = reader.metricsFileFactory();
if (metricsFile == null) {
throw new FontException("Unknown Metric Format: "
+ reader.getDescription());
}
if (metricsFile.getInternalEncoding() == null) {
throw new FontException("Unusable Internal Encoding: "
+ reader.getDescription());
}
return metricsFile;
} else {