public Resource create(final ResourceManager manager,
final ResourceData data,
final ResourceKey context)
throws ResourceCreationException, ResourceLoadingException
{
final ResourceKey key = data.getKey();
final Map factoryParameters = key.getFactoryParameters();
final boolean embedded = Boolean.TRUE.equals(factoryParameters.get(EMBEDDED));
final String encoding = String.valueOf(factoryParameters.get(ENCODING));
final String fontType = String.valueOf(factoryParameters.get(FONTNAME));
final DependencyCollector dc = new DependencyCollector
(key, data.getVersion(manager));
final byte[] ttfAfm = data.getResource(manager);
byte[] pfb = null;
if (embedded && (fontType.endsWith(".afm") || fontType.endsWith(".pfm")))
{
final String pfbFileName = fontType.substring
(0, fontType.length() - 4) + ".pfb";
try
{
final ResourceKey pfbKey = manager.deriveKey(key, pfbFileName);
ResourceData res = manager.load(pfbKey);
pfb = res.getResource(manager);
dc.add(pfbKey, res.getVersion(manager));
}
catch (ResourceException e)