Example #1
0
        private void buttonSource_Click(object sender, EventArgs e)
        {
            var dialog = new OpenFileDialog
            {
                Multiselect     = false,
                CheckFileExists = true,
                CheckPathExists = true,
                Filter          = @"BMFont files (*.fnt) | *.fnt"
            };

            if (dialog.ShowDialog() == DialogResult.OK)
            {
                var fnt = new SourceFontInfo(dialog.FileName);
                if (fnt.IsValid)
                {
                    _bmfont            = fnt;
                    buttonDest.Enabled = true;
                }
                else
                {
                    _bmfont            = null;
                    buttonDest.Enabled = false;
                }
            }
            else
            {
                _bmfont            = null;
                buttonDest.Enabled = false;
            }
        }
Example #2
0
        public DestFontInfo(SourceFontInfo info)
        {
            FontSize   = Math.Abs(info.FontSize);
            Base       = info.Base;
            LineHeight = (short)info.LineHeight;
            Charset    = info.Charset;
            CharsCount = info.CharsCount;
            Padding    = info.Padding.Left;

            Chars = new DestCharInfo[CharsCount];
            for (var i = 0; i < CharsCount; i++)
            {
                Chars[i] = new DestCharInfo(info.Chars[i]);
            }
        }