}
// create a private Font Collection and add the font data
@cli.System.Security.SecuritySafeCriticalAttribute.Annotation
private static PrivateFontCollection createPrivateFontCollection(byte[] fontData) throws cli.System.IO.FileNotFoundException {
GCHandle handle = GCHandle.Alloc(fontData, GCHandleType.wrap(GCHandleType.Pinned));
try {
PrivateFontCollection pfc = new PrivateFontCollection();
// AddMemoryFont throws a cli.System.IO.FileNotFoundException if the data are corrupt
pfc.AddMemoryFont( handle.AddrOfPinnedObject(), fontData.length );
return pfc;
} finally {
handle.Free();
}
}