/// <summary>
        ///     Write the font directory entry to a binary stream.
        /// </summary>
        /// <param name="w">Binary stream.</param>
        public void Write(BinaryWriter w)
        {
            w.Write(_fontOrdinal);
            w.Write(ResourceUtil.GetBytes(_font));

            // device name
            if (string.IsNullOrEmpty(_deviceName))
            {
                w.Write((byte)0);
            }
            else
            {
                w.Write(Encoding.ASCII.GetBytes(_deviceName));
            }

            // face name
            if (string.IsNullOrEmpty(_faceName))
            {
                w.Write((byte)0);
            }
            else
            {
                w.Write(Encoding.ASCII.GetBytes(_faceName));
            }
        }
Example #2
0
 /// <summary>
 ///     Write fixed file information to a binary stream.
 /// </summary>
 /// <param name="w">Binary stream.</param>
 public void Write(BinaryWriter w)
 {
     w.Write(ResourceUtil.GetBytes(_fixedfileinfo));
     ResourceUtil.PadToDWORD(w);
 }