Inheritance: System.Windows.Forms.Form
Beispiel #1
0
        public static int Execute(List <string> args)
        {
            if (args.Count != 2)
            {
                PrintUsage();
                return(-1);
            }

            string Filepath  = args[1];
            string ImagePath = args[0];
            //string Filepath2 = args[2];


            FontViewer form;

            try {
                byte[] File = System.IO.File.ReadAllBytes(Filepath);

                DRFontInfo f = new DRFontInfo(File);
                //DRFontInfo f2 = new DRFontInfo( System.IO.File.ReadAllBytes( Filepath2 ) );
                //f.CopyInfoFrom( f2 );

                DRFontChar apos = f.GetCharViaCharacter((ushort)'\'');
                DRFontChar quot = f.GetCharViaCharacter((ushort)'"');

                DRFontChar fontch = new DRFontChar();
                fontch.Character = (ushort)'’';
                DRFontInfo.CopyCharInfo(apos, fontch);
                f.ImportExternalCharacter(fontch);

                fontch           = new DRFontChar();
                fontch.Character = (ushort)'‘';
                DRFontInfo.CopyCharInfo(apos, fontch);
                f.ImportExternalCharacter(fontch);

                fontch           = new DRFontChar();
                fontch.Character = (ushort)'‛';
                DRFontInfo.CopyCharInfo(apos, fontch);
                f.ImportExternalCharacter(fontch);

                fontch           = new DRFontChar();
                fontch.Character = (ushort)'“';
                DRFontInfo.CopyCharInfo(quot, fontch);
                f.ImportExternalCharacter(fontch);

                fontch           = new DRFontChar();
                fontch.Character = (ushort)'”';
                DRFontInfo.CopyCharInfo(quot, fontch);
                f.ImportExternalCharacter(fontch);

                fontch           = new DRFontChar();
                fontch.Character = (ushort)'‟';
                DRFontInfo.CopyCharInfo(quot, fontch);
                f.ImportExternalCharacter(fontch);

                fontch           = new DRFontChar();
                fontch.Character = (ushort)'〝';
                DRFontInfo.CopyCharInfo(quot, fontch);
                f.ImportExternalCharacter(fontch);

                fontch           = new DRFontChar();
                fontch.Character = (ushort)'〞';
                DRFontInfo.CopyCharInfo(quot, fontch);
                f.ImportExternalCharacter(fontch);

                fontch           = new DRFontChar();
                fontch.Character = (ushort)'"';
                DRFontInfo.CopyCharInfo(quot, fontch);
                f.ImportExternalCharacter(fontch);

                fontch           = new DRFontChar();
                fontch.Character = (ushort)''';
                DRFontInfo.CopyCharInfo(apos, fontch);
                f.ImportExternalCharacter(fontch);

                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);
                form          = new FontViewer(f, new System.Drawing.Bitmap(ImagePath));
                form.Filepath = Filepath;
            } catch (Exception ex) {
                Console.WriteLine(ex.ToString());
                PrintUsage();
                return(-1);
            }

            Application.Run(form);

            return(0);
        }
Beispiel #2
0
        public static int Execute( List<string> args )
        {
            string Filepath = args[1];
            string ImagePath = args[0];
            //string Filepath2 = @"d:\_svn\GraceNote\GraceNote\DanganRonpaBestOfRebuild\assets\i";

            FontViewer form;
            try {
                byte[] File = System.IO.File.ReadAllBytes( Filepath );

                DRFontInfo f = new DRFontInfo( File );
                //DRFontInfo f2 = new DRFontInfo( System.IO.File.ReadAllBytes( Filepath2 ) );
                //f.CopyInfoFrom( f2 );

                DRFontChar apos = f.GetCharViaCharacter( (ushort)'\'' );
                DRFontChar quot = f.GetCharViaCharacter( (ushort)'"' );

                DRFontChar fontch = new DRFontChar();
                fontch.Character = (ushort)'’';
                DRFontInfo.CopyCharInfo( apos, fontch );
                f.ImportExternalCharacter( fontch );

                fontch = new DRFontChar();
                fontch.Character = (ushort)'‘';
                DRFontInfo.CopyCharInfo( apos, fontch );
                f.ImportExternalCharacter( fontch );

                fontch = new DRFontChar();
                fontch.Character = (ushort)'‛';
                DRFontInfo.CopyCharInfo( apos, fontch );
                f.ImportExternalCharacter( fontch );

                fontch = new DRFontChar();
                fontch.Character = (ushort)'“';
                DRFontInfo.CopyCharInfo( quot, fontch );
                f.ImportExternalCharacter( fontch );

                fontch = new DRFontChar();
                fontch.Character = (ushort)'”';
                DRFontInfo.CopyCharInfo( quot, fontch );
                f.ImportExternalCharacter( fontch );

                fontch = new DRFontChar();
                fontch.Character = (ushort)'‟';
                DRFontInfo.CopyCharInfo( quot, fontch );
                f.ImportExternalCharacter( fontch );

                fontch = new DRFontChar();
                fontch.Character = (ushort)'〝';
                DRFontInfo.CopyCharInfo( quot, fontch );
                f.ImportExternalCharacter( fontch );

                fontch = new DRFontChar();
                fontch.Character = (ushort)'〞';
                DRFontInfo.CopyCharInfo( quot, fontch );
                f.ImportExternalCharacter( fontch );

                fontch = new DRFontChar();
                fontch.Character = (ushort)'"';
                DRFontInfo.CopyCharInfo( quot, fontch );
                f.ImportExternalCharacter( fontch );

                fontch = new DRFontChar();
                fontch.Character = (ushort)''';
                DRFontInfo.CopyCharInfo( apos, fontch );
                f.ImportExternalCharacter( fontch );

                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault( false );
                form = new FontViewer( f, new System.Drawing.Bitmap( ImagePath ) );
                form.Filepath = Filepath;
            } catch ( Exception ex ) {
                Console.WriteLine( ex.ToString() );
                PrintUsage();
                return -1;
            }

            Application.Run( form );

            return 0;
        }