コード例 #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();
                }
            }
        }
コード例 #2
0
ファイル: DftUtil.cs プロジェクト: MagistrTot/DGLE
 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);
 }
コード例 #3
0
ファイル: DftUtil.cs プロジェクト: AuthenticEshkinKot/DGLE
 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);
 }
コード例 #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);
 }
コード例 #5
0
ファイル: DftUtil.cs プロジェクト: MagistrTot/DGLE
        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 ();
        }
コード例 #6
0
ファイル: DftUtil.cs プロジェクト: whztt07/DGLE
        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();
            }
        }