private static EMFFont Process(byte[] RecordData)
{
//put the Data into a stream and use a binary reader to read the data
MemoryStream _ms = null;
BinaryReader _br = null;
try
{
_ms = new MemoryStream(RecordData);
_br = new BinaryReader(_ms);
UInt32 Version = _br.ReadUInt32();
Single EmSize = _br.ReadSingle();
UInt32 SizeUnit = _br.ReadUInt32();
Int32 FontStyleFlags = _br.ReadInt32();
_br.ReadUInt32();
UInt32 NameLength = _br.ReadUInt32();
char[] FontFamily = new char[NameLength];
System.Text.UnicodeEncoding d = new System.Text.UnicodeEncoding();
d.GetChars(_br.ReadBytes((int)NameLength * 2),0,(int)NameLength * 2,FontFamily,0);
Font aFont = new Font(new String(FontFamily), EmSize, (FontStyle)FontStyleFlags, (GraphicsUnit)SizeUnit);
EMFFont ThisFont = new EMFFont();
ThisFont.myFont = aFont;
return ThisFont;
}
finally
{
if (_br != null)
_br.Close();
if (_ms != null)
_ms.Dispose();
}
}