Esempio n. 1
0
        public void Save(string filename, FontService fontService)
        {
            Gdk.Pixbuf   pixbuf = null;
            BinaryWriter file   = null;

            try
            {
                pixbuf = BuildImage(fontService);
                //pixbuf.Save (String.Format("{0}.bmp", filename), "bmp");
                file = new BinaryWriter(File.Create(String.Format("{0}.dft", filename)), Encoding.ASCII);

                TFontHeader header = new TFontHeader(1, pixbuf.Width, pixbuf.Height);
                file.Write(header);
                file.Write(boxes);
                file.Write(pixbuf);
            }
            finally
            {
                if (file != null)
                {
                    file.Close();
                }
                // manual dispose
                if (pixbuf != null)
                {
                    (pixbuf as IDisposable).Dispose();
                }
            }
        }
Esempio n. 2
0
 public static void Write(BinaryWriter file, TFontHeader header)
 {
     // "DFT 1.1"
     file.Write(new char[] { 'D', 'F', 'T', ' ', '1', '.', '1' });
     file.Write(header.BitDepth);
     file.Write(header.Width);
     file.Write(header.Height);
 }
Esempio n. 3
0
 public static void Write(BinaryWriter file, TFontHeader header)
 {
     // "DFT 1.1"
     file.Write(DftUtil.HEADER.ToCharArray ());
     file.Write(header.BitDepth);
     file.Write(header.Width);
     file.Write(header.Height);
 }
Esempio n. 4
0
 public static void Write(this BinaryWriter file, TFontHeader header)
 {
     // "DFT 1.1"
     file.Write(DftUtil.HEADER.ToCharArray());
     file.Write(header.BitDepth);
     file.Write(header.Width);
     file.Write(header.Height);
 }
Esempio n. 5
0
        public void Save(string filename, FontService fontService)
        {
            Gdk.Pixbuf pixbuf = BuildImage (fontService);

            //pixbuf.Save (String.Format("{0}.bmp", filename), "bmp");

            BinaryWriter file =
                new BinaryWriter(File.Create(String.Format("{0}.dft", filename)), Encoding.ASCII);

            TFontHeader header = new TFontHeader(1, pixbuf.Width, pixbuf.Height);

            // extensions doesn;t work on mono2
            DFTExtensions.Write(file, header);
            DFTExtensions.Write(file, boxes);
            DFTExtensions.Write(file, pixbuf);

            file.Close();

            // manual dispose
            (pixbuf as IDisposable).Dispose ();
        }
Esempio n. 6
0
        public void Save(string filename, FontService fontService)
        {
            Gdk.Pixbuf pixbuf = null;
            BinaryWriter file = null;
            try
            {
                pixbuf = BuildImage(fontService);
                //pixbuf.Save (String.Format("{0}.bmp", filename), "bmp");
                file = new BinaryWriter(File.Create(String.Format("{0}.dft", filename)), Encoding.ASCII);

                TFontHeader header = new TFontHeader(1, pixbuf.Width, pixbuf.Height);
                file.Write(header);
                file.Write(boxes);
                file.Write(pixbuf);
            }
            finally
            {
                if (file != null)
                    file.Close();
                // manual dispose
                if (pixbuf != null)
                    (pixbuf as IDisposable).Dispose();
            }
        }