catch ( MalformedURLException e )
{
throw new MojoExecutionException( e.getMessage(), e );
}
FontTranscoder fontTranscoder;
if ( transcoder == Font2SWF.DefineFontKind.DEFINEFONT3 )
{
fontTranscoder = new DefineFont3Transcoder();
}
else if ( transcoder == Font2SWF.DefineFontKind.DEFINEFONT4 )
{
fontTranscoder = new DefineFont4Transcoder();
}
else
{
throw new IllegalStateException( "Unexpected font transcoder: " + transcoder );
}
if ( fontSwfFinalName == null )
{
fontSwfFinalName = finalName + "-" + alias;
}
OutputStream output = null;
try
{
File outputFile = new File( getTargetDirectory(), fontSwfFinalName + ".swf" );
output = new FileOutputStream( outputFile );
fontTranscoder.transcode( description, output );
}
catch ( FontTranscoderException e )
{
throw new MojoExecutionException( "Failed to create the font swf", e );
}