Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
c10a8e49ff | ||
|
5d17ba5538 | ||
4f80a5df1b | |||
37f2bb5eac |
@@ -233,7 +233,7 @@ namespace McBitFont {
|
|||||||
if (com && lines != 1 && fcount > 1) {
|
if (com && lines != 1 && fcount > 1) {
|
||||||
// Comments enabled and other than "1 symbol per line" selected
|
// Comments enabled and other than "1 symbol per line" selected
|
||||||
// Print a symbol comment before its data
|
// 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) {
|
if (lines == 1) {
|
||||||
// "1 symbol per line" - new line offset
|
// "1 symbol per line" - new line offset
|
||||||
@@ -369,7 +369,7 @@ namespace McBitFont {
|
|||||||
if (!f.Equals(flast) && f.width > 0) output += ",";
|
if (!f.Equals(flast) && f.width > 0) output += ",";
|
||||||
if (com && fcount > 1) {
|
if (com && fcount > 1) {
|
||||||
//...with a comment
|
//...with a comment
|
||||||
output += " // " + f.code.ToString() + " --> " + mainForm.decodeSymbol(f.code);
|
output += " // " + f.code.ToString() + " --> " + mainForm.DecodeSymbol(f.code);
|
||||||
}
|
}
|
||||||
output += "\n";
|
output += "\n";
|
||||||
}
|
}
|
||||||
|
@@ -57,7 +57,7 @@ namespace McBitFont {
|
|||||||
public bool monospaced = false;
|
public bool monospaced = false;
|
||||||
private bool modified = false;
|
private bool modified = false;
|
||||||
private bool prjModified = false;
|
private bool prjModified = false;
|
||||||
public const string version = "2.0";
|
public const string version = "2.1";
|
||||||
public string prjName = "Untitled";
|
public string prjName = "Untitled";
|
||||||
public string prjFileName = "";
|
public string prjFileName = "";
|
||||||
private int codepage = 1251;
|
private int codepage = 1251;
|
||||||
@@ -70,6 +70,7 @@ namespace McBitFont {
|
|||||||
|
|
||||||
public MainForm() {
|
public MainForm() {
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);
|
||||||
this.dotPanel.MouseWheel += new MouseEventHandler(this.DotPanel_MouseWheel);
|
this.dotPanel.MouseWheel += new MouseEventHandler(this.DotPanel_MouseWheel);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -118,7 +119,7 @@ namespace McBitFont {
|
|||||||
tsmiCodeShift.Visible = frames.Count > 1;
|
tsmiCodeShift.Visible = frames.Count > 1;
|
||||||
CodeShiftToolStripMenuItem.Visible = frames.Count > 1;
|
CodeShiftToolStripMenuItem.Visible = frames.Count > 1;
|
||||||
|
|
||||||
Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[DllImport("user32.dll")]
|
[DllImport("user32.dll")]
|
||||||
@@ -681,14 +682,14 @@ namespace McBitFont {
|
|||||||
Application.Exit();
|
Application.Exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
public string decodeSymbol(int code) {
|
public string DecodeSymbol(int code) {
|
||||||
var enc = Encoding.GetEncoding(codepage);
|
var enc = Encoding.GetEncoding(codepage);
|
||||||
if (code < 32) return "";
|
if (code < 32) return "";
|
||||||
return enc.GetString(new byte[] { (byte)code });
|
return enc.GetString(new byte[] { (byte)code });
|
||||||
}
|
}
|
||||||
|
|
||||||
private FrameMiniature DrawFrameChar(FrameMiniature ff, Font font, int sx, int sy) {
|
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);
|
Bitmap bmp = new Bitmap(ff.width, ff.height);
|
||||||
Graphics g = Graphics.FromImage(bmp);
|
Graphics g = Graphics.FromImage(bmp);
|
||||||
g.Clear(Color.White);
|
g.Clear(Color.White);
|
||||||
@@ -766,7 +767,7 @@ namespace McBitFont {
|
|||||||
foreach (FrameMiniature ff in frames) {
|
foreach (FrameMiniature ff in frames) {
|
||||||
var s = ff.code.ToString().PadLeft(3, '0');
|
var s = ff.code.ToString().PadLeft(3, '0');
|
||||||
ilMiniatures.Images.Add(s, (Image)GetMiniPictue(ff));
|
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);
|
miniList.Items.Add(s, s + ' ' + append + sss, s);
|
||||||
}
|
}
|
||||||
f = CopyFrame(frames.First());
|
f = CopyFrame(frames.First());
|
||||||
@@ -874,7 +875,7 @@ namespace McBitFont {
|
|||||||
foreach (FrameMiniature ff in frames) {
|
foreach (FrameMiniature ff in frames) {
|
||||||
var s = ff.code.ToString().PadLeft(3, '0');
|
var s = ff.code.ToString().PadLeft(3, '0');
|
||||||
var sHex = 'x' + Convert.ToString(ff.code, 16).PadLeft(2, '0').ToUpper();
|
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));
|
ilMiniatures.Images.Add(s, (Image)GetMiniPictue(ff));
|
||||||
miniList.Items.Add(s, (chkHexCodes.Checked ? sHex : s) + ' ' + sss, s);
|
miniList.Items.Add(s, (chkHexCodes.Checked ? sHex : s) + ' ' + sss, s);
|
||||||
}
|
}
|
||||||
@@ -968,7 +969,7 @@ namespace McBitFont {
|
|||||||
|
|
||||||
var s = ff.code.ToString().PadLeft(3, '0');
|
var s = ff.code.ToString().PadLeft(3, '0');
|
||||||
ilMiniatures.Images.Add(s, (Image)GetMiniPictue(ff));
|
ilMiniatures.Images.Add(s, (Image)GetMiniPictue(ff));
|
||||||
var sss = decodeSymbol(ff.code);
|
var sss = DecodeSymbol(ff.code);
|
||||||
miniList.Items.Add(s, s + ' ' + sss, s);
|
miniList.Items.Add(s, s + ' ' + sss, s);
|
||||||
CheckForAdd();
|
CheckForAdd();
|
||||||
}
|
}
|
||||||
@@ -1089,6 +1090,7 @@ namespace McBitFont {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void MainForm_FormClosing(object sender, FormClosingEventArgs e) {
|
private void MainForm_FormClosing(object sender, FormClosingEventArgs e) {
|
||||||
|
CheckModifiedFrame();
|
||||||
if (prjModified) {
|
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) {
|
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;
|
e.Cancel = true;
|
||||||
@@ -1189,7 +1191,7 @@ namespace McBitFont {
|
|||||||
frames[i] = ff;
|
frames[i] = ff;
|
||||||
|
|
||||||
var key = ff.code.ToString().PadLeft(3, '0');
|
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));
|
ilMiniatures.Images.Add(key, (Image)GetMiniPictue(ff));
|
||||||
miniList.Items.Add(key, key + ' ' + text, key);
|
miniList.Items.Add(key, key + ' ' + text, key);
|
||||||
}
|
}
|
||||||
@@ -1228,7 +1230,7 @@ namespace McBitFont {
|
|||||||
if (frames.Count == 1) return;
|
if (frames.Count == 1) return;
|
||||||
foreach (ListViewItem item in miniList.Items) {
|
foreach (ListViewItem item in miniList.Items) {
|
||||||
var code = Convert.ToInt32(item.ImageKey);
|
var code = Convert.ToInt32(item.ImageKey);
|
||||||
var symbol = decodeSymbol(code);
|
var symbol = DecodeSymbol(code);
|
||||||
if (chkHexCodes.Checked) {
|
if (chkHexCodes.Checked) {
|
||||||
var sHex = 'x' + Convert.ToString(code, 16).PadLeft(2, '0').ToUpper();
|
var sHex = 'x' + Convert.ToString(code, 16).PadLeft(2, '0').ToUpper();
|
||||||
item.Text = sHex + ' ' + symbol;
|
item.Text = sHex + ' ' + symbol;
|
||||||
@@ -1340,7 +1342,7 @@ namespace McBitFont {
|
|||||||
|
|
||||||
var s = (last - first > 0) ? newf.code.ToString().PadLeft(3, '0') : "000";
|
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 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));
|
ilMiniatures.Images.Add(s, (Image)GetMiniPictue(newf));
|
||||||
miniList.Items.Add(s, (chkHexCodes.Checked ? sHex : s) + ' ' + sss, s);
|
miniList.Items.Add(s, (chkHexCodes.Checked ? sHex : s) + ' ' + sss, s);
|
||||||
}
|
}
|
||||||
|
@@ -20,8 +20,10 @@
|
|||||||
<UseWindowsForms>true</UseWindowsForms>
|
<UseWindowsForms>true</UseWindowsForms>
|
||||||
<ImportWindowsDesktopTargets>true</ImportWindowsDesktopTargets>
|
<ImportWindowsDesktopTargets>true</ImportWindowsDesktopTargets>
|
||||||
<ApplicationIcon>icon_64.ico</ApplicationIcon>
|
<ApplicationIcon>icon_64.ico</ApplicationIcon>
|
||||||
<AssemblyVersion>2.0.0.0</AssemblyVersion>
|
<AssemblyVersion>2.1.0.0</AssemblyVersion>
|
||||||
<FileVersion>2.0.0.0</FileVersion>
|
<FileVersion>2.1.0.0</FileVersion>
|
||||||
|
<Version>$(VersionPrefix)2.1.0</Version>
|
||||||
|
<Copyright>Anton Mukhin</Copyright>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
|
||||||
<DebugType>portable</DebugType>
|
<DebugType>portable</DebugType>
|
||||||
|
@@ -108,8 +108,8 @@ namespace McBitFont {
|
|||||||
|
|
||||||
Bitmap bmp, result;
|
Bitmap bmp, result;
|
||||||
Graphics g;
|
Graphics g;
|
||||||
chars[0] = mainForm.decodeSymbol((int)nudChar1.Value);
|
chars[0] = mainForm.DecodeSymbol((int)nudChar1.Value);
|
||||||
chars[1] = mainForm.decodeSymbol((int)nudChar2.Value);
|
chars[1] = mainForm.DecodeSymbol((int)nudChar2.Value);
|
||||||
for (int i = 0; i < 2; i++) {
|
for (int i = 0; i < 2; i++) {
|
||||||
bmp = new Bitmap((int)nudNewX.Value, (int)nudNewY.Value);
|
bmp = new Bitmap((int)nudNewX.Value, (int)nudNewY.Value);
|
||||||
g = Graphics.FromImage(bmp);
|
g = Graphics.FromImage(bmp);
|
||||||
|
25
TODO.txt
25
TODO.txt
@@ -1,28 +1,7 @@
|
|||||||
Application:
|
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:
|
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:
|
Bugs:
|
||||||
V Improper bytes count for 16 or 32 bit numbers export
|
V EncodingProvider hotfix
|
||||||
V Exception on Code Shift when nothing is selected in Symbols List
|
V Check if frame changed before exit application
|
||||||
V Wrongly mark Project as modified on symbol selection
|
|
||||||
|
Binary file not shown.
Reference in New Issue
Block a user