Exemple #1
0
        private void buttonCopyFrom_Click(object sender, EventArgs e)
        {
            char       ch    = textBoxCopyFrom.Text[0];
            DRFontChar other = FontInfo.GetCharViaCharacter((ushort)ch);
            DRFontChar mine  = FontInfo.GetCharViaId((int)numericUpDownCharacterId.Value);

            DRFontInfo.CopyCharInfo(other, mine);

            UpdateAny();
        }
Exemple #2
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);
        }