4 Commits
v2.0 ... v2.1

Author SHA1 Message Date
Anton Mukhin
c10a8e49ff Merge branch 'dev' - v2.1
Bugs fixed:
- EncodingProvider hotfix
- Check if frame changed before exit application
2025-05-27 10:43:14 +03:00
Anton Mukhin
5d17ba5538 Bug fixes:
- EncodingProvider hotfix
- Check if frame changed before exit application
2025-05-27 10:41:44 +03:00
4f80a5df1b Check if frame changed before exit application 2025-05-27 04:27:39 +03:00
37f2bb5eac HotFix: Open file from OS 2025-05-27 03:40:34 +03:00
6 changed files with 22 additions and 39 deletions

View File

@@ -233,7 +233,7 @@ namespace McBitFont {
if (com && lines != 1 && fcount > 1) {
// Comments enabled and other than "1 symbol per line" selected
// Print a symbol comment before its data
output += " // " + f.code.ToString() + " --> " + mainForm.decodeSymbol(f.code) + "\n";
output += " // " + f.code.ToString() + " --> " + mainForm.DecodeSymbol(f.code) + "\n";
}
if (lines == 1) {
// "1 symbol per line" - new line offset
@@ -369,7 +369,7 @@ namespace McBitFont {
if (!f.Equals(flast) && f.width > 0) output += ",";
if (com && fcount > 1) {
//...with a comment
output += " // " + f.code.ToString() + " --> " + mainForm.decodeSymbol(f.code);
output += " // " + f.code.ToString() + " --> " + mainForm.DecodeSymbol(f.code);
}
output += "\n";
}

View File

@@ -57,7 +57,7 @@ namespace McBitFont {
public bool monospaced = false;
private bool modified = false;
private bool prjModified = false;
public const string version = "2.0";
public const string version = "2.1";
public string prjName = "Untitled";
public string prjFileName = "";
private int codepage = 1251;
@@ -70,6 +70,7 @@ namespace McBitFont {
public MainForm() {
InitializeComponent();
Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);
this.dotPanel.MouseWheel += new MouseEventHandler(this.DotPanel_MouseWheel);
}
@@ -118,7 +119,7 @@ namespace McBitFont {
tsmiCodeShift.Visible = frames.Count > 1;
CodeShiftToolStripMenuItem.Visible = frames.Count > 1;
Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);
}
[DllImport("user32.dll")]
@@ -681,14 +682,14 @@ namespace McBitFont {
Application.Exit();
}
public string decodeSymbol(int code) {
public string DecodeSymbol(int code) {
var enc = Encoding.GetEncoding(codepage);
if (code < 32) return "";
return enc.GetString(new byte[] { (byte)code });
}
private FrameMiniature DrawFrameChar(FrameMiniature ff, Font font, int sx, int sy) {
string s = decodeSymbol(ff.code);
string s = DecodeSymbol(ff.code);
Bitmap bmp = new Bitmap(ff.width, ff.height);
Graphics g = Graphics.FromImage(bmp);
g.Clear(Color.White);
@@ -766,7 +767,7 @@ namespace McBitFont {
foreach (FrameMiniature ff in frames) {
var s = ff.code.ToString().PadLeft(3, '0');
ilMiniatures.Images.Add(s, (Image)GetMiniPictue(ff));
var sss = decodeSymbol(ff.code);
var sss = DecodeSymbol(ff.code);
miniList.Items.Add(s, s + ' ' + append + sss, s);
}
f = CopyFrame(frames.First());
@@ -874,7 +875,7 @@ namespace McBitFont {
foreach (FrameMiniature ff in frames) {
var s = ff.code.ToString().PadLeft(3, '0');
var sHex = 'x' + Convert.ToString(ff.code, 16).PadLeft(2, '0').ToUpper();
var sss = decodeSymbol(ff.code);
var sss = DecodeSymbol(ff.code);
ilMiniatures.Images.Add(s, (Image)GetMiniPictue(ff));
miniList.Items.Add(s, (chkHexCodes.Checked ? sHex : s) + ' ' + sss, s);
}
@@ -968,7 +969,7 @@ namespace McBitFont {
var s = ff.code.ToString().PadLeft(3, '0');
ilMiniatures.Images.Add(s, (Image)GetMiniPictue(ff));
var sss = decodeSymbol(ff.code);
var sss = DecodeSymbol(ff.code);
miniList.Items.Add(s, s + ' ' + sss, s);
CheckForAdd();
}
@@ -1089,6 +1090,7 @@ namespace McBitFont {
}
private void MainForm_FormClosing(object sender, FormClosingEventArgs e) {
CheckModifiedFrame();
if (prjModified) {
if (MessageBox.Show("The project is modified.\nAre you sure you want to quit?", "Are you sure?", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No) {
e.Cancel = true;
@@ -1189,7 +1191,7 @@ namespace McBitFont {
frames[i] = ff;
var key = ff.code.ToString().PadLeft(3, '0');
var text = decodeSymbol(ff.code);
var text = DecodeSymbol(ff.code);
ilMiniatures.Images.Add(key, (Image)GetMiniPictue(ff));
miniList.Items.Add(key, key + ' ' + text, key);
}
@@ -1228,7 +1230,7 @@ namespace McBitFont {
if (frames.Count == 1) return;
foreach (ListViewItem item in miniList.Items) {
var code = Convert.ToInt32(item.ImageKey);
var symbol = decodeSymbol(code);
var symbol = DecodeSymbol(code);
if (chkHexCodes.Checked) {
var sHex = 'x' + Convert.ToString(code, 16).PadLeft(2, '0').ToUpper();
item.Text = sHex + ' ' + symbol;
@@ -1340,7 +1342,7 @@ namespace McBitFont {
var s = (last - first > 0) ? newf.code.ToString().PadLeft(3, '0') : "000";
var sHex = (last - first > 0) ? 'x' + Convert.ToString(newf.code, 16).PadLeft(2, '0').ToUpper() : "0x0";
var sss = (last - first > 0) ? decodeSymbol(newf.code) : "Single";
var sss = (last - first > 0) ? DecodeSymbol(newf.code) : "Single";
ilMiniatures.Images.Add(s, (Image)GetMiniPictue(newf));
miniList.Items.Add(s, (chkHexCodes.Checked ? sHex : s) + ' ' + sss, s);
}

View File

@@ -20,8 +20,10 @@
<UseWindowsForms>true</UseWindowsForms>
<ImportWindowsDesktopTargets>true</ImportWindowsDesktopTargets>
<ApplicationIcon>icon_64.ico</ApplicationIcon>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<FileVersion>2.0.0.0</FileVersion>
<AssemblyVersion>2.1.0.0</AssemblyVersion>
<FileVersion>2.1.0.0</FileVersion>
<Version>$(VersionPrefix)2.1.0</Version>
<Copyright>Anton Mukhin</Copyright>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<DebugType>portable</DebugType>

View File

@@ -108,8 +108,8 @@ namespace McBitFont {
Bitmap bmp, result;
Graphics g;
chars[0] = mainForm.decodeSymbol((int)nudChar1.Value);
chars[1] = mainForm.decodeSymbol((int)nudChar2.Value);
chars[0] = mainForm.DecodeSymbol((int)nudChar1.Value);
chars[1] = mainForm.DecodeSymbol((int)nudChar2.Value);
for (int i = 0; i < 2; i++) {
bmp = new Bitmap((int)nudNewX.Value, (int)nudNewY.Value);
g = Graphics.FromImage(bmp);

View File

@@ -1,28 +1,7 @@
Application:
V Migrate from .Net Framework 4.7 to .NET 9
V New Save file format! Use McBitFont v1.7 to convert old save files to the new format.
V Better quality pictures in symbol list
V Spinning cursor when application is busy
V Change Menu icons
V Re-arranged menu items
V Option to display codes in Hex numbers
V Make symbol list wider to display 8 characters instead of 7
Functionality:
V Fill canvas button
V Context menu in symbol navigator
V Delete symbols before/after selected
V Shift all symbols on code line (change symbol codes)
V Specify starting code (extends the shift)
V Ability to make monospaced font a variable width one
V Undo/Redo for canvas changes
V Image import from a file
V Import from a text array
V Rectangle selection to mass-paint, shift and mirror pixels etc...
V "Packed" fonts export
V "Bytes total comment in export
Bugs:
V Improper bytes count for 16 or 32 bit numbers export
V Exception on Code Shift when nothing is selected in Symbols List
V Wrongly mark Project as modified on symbol selection
V EncodingProvider hotfix
V Check if frame changed before exit application

Binary file not shown.