26 Commits

Author SHA1 Message Date
Anton Mukhin
ca42d3819f TODO feature: Delete symbols before/after selected 2025-05-20 14:05:42 +03:00
Anton Mukhin
bbfccc2308 Example files: saved in new format. Moved old format ones to a sub-folder 2025-05-20 14:05:18 +03:00
Anton Mukhin
ea3de134d2 Migrated to .NET 9 (with some functionality broken) 2025-05-20 09:12:34 +03:00
faf14caec2 Update README.md 2025-05-20 05:27:28 +03:00
6a8ff0eb50 Merge branch 'dev' v1.7
Application:
V Implement "Save" menu
V Implement new saved font file format

Functionality:
V "Only numbers" range in the New dialog
V "Specify range" in the New dialog
V "Single frame", "only numbers" and "specify range" as radio buttons
V Button to Clear/Fill a block
V Copy-paste to a symbol with different size
V Change height of variable width fonts with ability to choose which side to add pixels to
V Make it possible to have zero width chars in VarWidth fonts
V Tooltips on main form

Bugs:
V Every char changes its width to default on VarWidth font height change!
V App allows to create fonts with a gap in symbol cequence!
V File -> New does not check for unsaveed changes!
V Export for symbols with 0 width in "1 per line" format has extra comma!
2025-05-20 05:11:07 +03:00
011c24b94b Fixed Export for symbols with 0 width in "1 per line" format 2025-05-20 05:08:40 +03:00
6fbe668284 Merge branch 'dev' 2025-05-20 04:47:03 +03:00
5fc69e9992 v 1.7 dev release
Application:
V Implement "Save" menu
V Implement new saved font file format

Functionality:
V "Only numbers" range in the New dialog
V "Specify range" in the New dialog
V "Single frame", "only numbers" and "specify range" as radio buttons
V Button to Clear/Fill a block
V Copy-paste to a symbol with different size
V Change height of variable width fonts with ability to choose which side to add pixels to
V Make it possible to have zero width chars in VarWidth fonts
V Tooltips on main form

Bugs:
V Every char changes its width to default on VarWidth font height change!
V App allows to create fonts with a gap in symbol cequence!
V File -> New does not check for unsaveed changes!
2025-05-20 04:45:45 +03:00
f2b01d4a27 TODO feature: Change height of variable width fonts with ability to choose which side to add pixels to 2025-05-18 03:15:10 +03:00
5164060ffc Menu for Clear canvas Tool 2025-05-18 01:36:47 +03:00
68bce8e14e TODO feature: Button to Clear/Fill a block 2025-05-18 01:30:32 +03:00
6fb5a1f773 TODO feature: Tooltips on main form 2025-05-18 01:13:40 +03:00
2a940c8933 TODO feature: Copy-paste to a symbol with different size 2025-05-18 00:50:05 +03:00
0aeec8bd19 It is now possible to have zero width chars in VarWidth fonts 2025-05-17 03:58:00 +03:00
d24143d1a6 Bugs fixed and new functionality:
Functionality:
V "Only numbers" range in the New dialog
V "Specify range" in the New dialog
V "Single frame", "only numbers" and "specify range" as radio buttons
Bugs:
V App allows to create fonts with a gap in symbol cequence!
V File -> New does not check for unsaveed changes!
2025-05-17 03:52:29 +03:00
03ef799381 Bug fixed: VarWidth fonts height change resets all frames' width 2025-05-17 02:20:01 +03:00
647e5f5601 Save implemented; Swapped Ctrl and Shift fow Zoom/horizontal scroll for frame matrix 2025-05-17 02:03:58 +03:00
Anton Mukhin
c5e440ee44 Update TODO; More examples 2025-05-16 18:04:09 +03:00
Anton Mukhin
34bec25b3d Fix TODO.txt 2023-07-07 12:08:44 +03:00
Anton Mukhin
b1acbdd98f Ability to open a project by double-clicking on a file in Explorer 2023-07-07 12:07:14 +03:00
Anton Mukhin
6d5f90aaac TODO added 2023-07-07 10:27:25 +03:00
72ad6e5be0 Changed Release version info 2023-07-05 02:36:24 +03:00
9d1ca65f34 Added modified check before project save 2023-07-05 02:22:58 +03:00
Anton Mukhin
dd3f4f4b4b Merge branch 'fix-broken-resize' 2023-05-17 16:48:11 +03:00
Anton Mukhin
8889b846dc Fixed font resize; Restored 8x16 example; 2023-05-17 16:47:55 +03:00
Anton Mukhin
fe0e1dabfd More examples 2023-05-17 15:26:45 +03:00
33 changed files with 965 additions and 942 deletions

View File

@@ -1,6 +1,14 @@
<?xml version="1.0" encoding="utf-8" ?>
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
</startup>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>

View File

@@ -23,6 +23,7 @@
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent() {
this.components = new System.ComponentModel.Container();
this.txtOutput = new System.Windows.Forms.RichTextBox();
this.gbScan = new System.Windows.Forms.GroupBox();
this.cbVDir = new System.Windows.Forms.ComboBox();
@@ -43,6 +44,7 @@
this.cbFormat = new System.Windows.Forms.ComboBox();
this.btnGenerate = new System.Windows.Forms.Button();
this.btnClose = new System.Windows.Forms.Button();
this.toolTip1 = new System.Windows.Forms.ToolTip(this.components);
this.gbScan.SuspendLayout();
this.gbOptions.SuspendLayout();
this.gbNumbers.SuspendLayout();
@@ -138,6 +140,7 @@
this.cbZeroes.Size = new System.Drawing.Size(98, 17);
this.cbZeroes.TabIndex = 2;
this.cbZeroes.Text = "Leading zeroes";
this.toolTip1.SetToolTip(this.cbZeroes, "Add leading zeroes: 0x01 / 0x1");
this.cbZeroes.UseVisualStyleBackColor = true;
//
// cbHeader
@@ -150,6 +153,7 @@
this.cbHeader.Size = new System.Drawing.Size(86, 17);
this.cbHeader.TabIndex = 1;
this.cbHeader.Text = "Meta header";
this.toolTip1.SetToolTip(this.cbHeader, "Add meta header with meta data");
this.cbHeader.UseVisualStyleBackColor = true;
this.cbHeader.CheckedChanged += new System.EventHandler(this.cbFormat_SelectedIndexChanged);
//
@@ -163,6 +167,7 @@
this.cbComments.Size = new System.Drawing.Size(75, 17);
this.cbComments.TabIndex = 0;
this.cbComments.Text = "Comments";
this.toolTip1.SetToolTip(this.cbComments, "Add descriptive comments");
this.cbComments.UseVisualStyleBackColor = true;
//
// gbNumbers
@@ -309,6 +314,12 @@
this.btnClose.Text = "Close";
this.btnClose.UseVisualStyleBackColor = true;
//
// toolTip1
//
this.toolTip1.AutoPopDelay = 10000;
this.toolTip1.InitialDelay = 500;
this.toolTip1.ReshowDelay = 100;
//
// Export
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
@@ -362,5 +373,6 @@
private System.Windows.Forms.Button btnGenerate;
private System.Windows.Forms.Button btnClose;
private System.Windows.Forms.CheckBox cbZeroes;
private System.Windows.Forms.ToolTip toolTip1;
}
}

View File

@@ -88,7 +88,7 @@ namespace McBitFont {
int imin, jmin, imax, jmax, idir, jdir;
if (com) {
//Header comments
// Header comments
output += comments["header"];
output += comments["scan_order"] + cbOrder.Text + "\n";
output += comments["scan_hdir"] + cbHDir.Text + "\n";
@@ -107,7 +107,7 @@ namespace McBitFont {
}
}
//Figure out mins and maxes
// Figure out mins and maxes
if (cbOrder.SelectedIndex == 0) {
if (cbHDir.SelectedIndex == 0) {
// Columns; Left to right
@@ -342,7 +342,7 @@ namespace McBitFont {
}
if (lines == 1) {
// "1 symbol per line" - closing line
if (!f.Equals(flast)) output += ",";
if (!f.Equals(flast) && f.width > 0) output += ",";
if (com && fcount > 1) {
//...with a comment
output += " // " + f.code.ToString() + " --> " + mainForm.decodeSymbol(f.code);

View File

@@ -117,4 +117,10 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="toolTip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="toolTip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
</root>

File diff suppressed because it is too large Load Diff

View File

@@ -1,25 +1,21 @@
using System;
using MessagePack;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Windows.Forms.VisualStyles;
using System.Runtime.InteropServices;
using System.IO;
using System.Runtime.Serialization.Formatters.Binary;
using System.Runtime.InteropServices.ComTypes;
using System.Diagnostics;
using System.Drawing.Drawing2D;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Windows.Forms;
namespace McBitFont {
public partial class MainForm : Form {
[Serializable]
[MessagePackObject]
public struct FrameMiniature {
public FrameMiniature(int cc, int ww, int hh) {
code = cc;
@@ -27,17 +23,26 @@ namespace McBitFont {
height = hh;
data = new bool[ww, hh];
}
[Key(0)]
public int code;
[Key(1)]
public int width;
[Key(2)]
public int height;
[Key(3)]
public bool[,] data;
};
[Serializable]
[MessagePackObject]
public struct SaveBlock {
[Key(4)]
public bool monospaced;
[Key(5)]
public int codepage;
[Key(6)]
public int baseline;
[Key(7)]
public List<FrameMiniature> frames;
}
@@ -51,8 +56,9 @@ namespace McBitFont {
public bool monospaced = false;
bool modified = false;
bool prjModified = false;
public const string version = "1.4";
public const string version = "2.0";
public string prjName = "Untitled";
public string prjFileName = "";
public int codepage = 1251;
private FrameMiniature fbuf;
private bool fbuffer = false;
@@ -66,7 +72,7 @@ namespace McBitFont {
private void Form1_Load(object sender, EventArgs e) {
lblType.Text = monospaced ? "Monospaced" : "Variable width / Single";
dotWidth = (int)nudX.Value;
dotWidth = (int)nudX.Value;
dotHeight = (int)nudY.Value;
gap = (cellSize < 5) ? 0 : 1;
@@ -89,6 +95,13 @@ namespace McBitFont {
this.Text = "McBitFont " + version + " - " + prjName;
fbuf = new FrameMiniature(0, dotWidth, dotHeight);
// Chek for arguments
if (Environment.GetCommandLineArgs().Length > 1) {
loadProject(Environment.GetCommandLineArgs()[1]);
}
Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);
}
[DllImport("user32.dll")]
@@ -113,12 +126,12 @@ namespace McBitFont {
private void dotPanel_MouseWheel(object sender, MouseEventArgs e) {
int t = e.Delta / 120;
if (e.Delta == 0) return;
if (ModifierKeys.HasFlag(Keys.Shift)) {
if (ModifierKeys.HasFlag(Keys.Control)) {
t += cbZoom.SelectedIndex;
if (t > cbZoom.Items.Count - 1) return;
if (t < 0) return;
cbZoom.SelectedIndex = t;
} else if (ModifierKeys.HasFlag(Keys.Control)) {
} else if (ModifierKeys.HasFlag(Keys.Shift)) {
if (hScroll.Enabled) {
t = t * -1 * (cellSize + gap) + hScroll.Value;
if (t < hScroll.Minimum) t = hScroll.Minimum;
@@ -141,7 +154,7 @@ namespace McBitFont {
for (int i = 0; i < frames.Count; i++) {
frames[i] = frameResize(frames[i], (int)nudX.Value, dotHeight);
bmp = getMiniPictue(frames[i]);
string s = frames[i].code.ToString();
string s = frames[i].code.ToString().PadLeft(3, '0');
ilMiniatures.Images.RemoveByKey(s);
ilMiniatures.Images.Add(s, (Image)bmp);
miniList.Items[s].ImageKey = s;
@@ -156,13 +169,14 @@ namespace McBitFont {
private void nudY_ValueChanged(object sender, EventArgs e) {
Bitmap bmp;
for (int i = 0; i < frames.Count; i++) {
frames[i] = frameResize(frames[i], dotWidth, (int)nudY.Value);
frames[i] = frameResize(frames[i], frames[i].width, (int)nudY.Value);
bmp = getMiniPictue(frames[i]);
string s = frames[i].code.ToString();
string s = frames[i].code.ToString().PadLeft(3, '0');
ilMiniatures.Images.RemoveByKey(s);
ilMiniatures.Images.Add(s, (Image)bmp);
miniList.Items[s].ImageKey = s;
}
if (nudY.Focused) modified = true;
prjModified = true;
dotResize(dotWidth, (int)nudY.Value);
}
@@ -170,20 +184,24 @@ namespace McBitFont {
private FrameMiniature frameResize(FrameMiniature ff, int neww, int newh) {
int oldw = ff.width;
int oldh = ff.height;
int di = 0, dj = 0;
int imax, jmax;
bool[,] t;
if (neww < oldw) imax = neww;
else imax = oldw;
if (newh < oldh) jmax = newh;
else jmax = oldh;
if (chkLeftSide.Checked) di = oldw - neww;
if (chkTopSide.Checked) dj = oldh - newh;
imax = (neww < oldw) ? neww : oldw;
jmax = (newh < oldh) ? newh : oldh;
if (neww > oldw) imax -= di;
if (newh > oldh) jmax -= dj;
ff.width = neww;
ff.height = newh;
t = new bool[neww, newh];
for (int i=0; i<imax; i++) {
for (int j=0;j<jmax; j++) {
t[i, j] = ff.data[i, j];
for (int i = 0; i < imax; i++) {
for (int j = 0; j < jmax; j++) {
if (i + di >= 0 && j + dj >= 0) t[i, j] = ff.data[i + di, j + dj];
}
}
ff.data = t;
@@ -192,30 +210,12 @@ namespace McBitFont {
}
private void dotResize(int ww, int hh) {
int imax, jmax;
bool[,] t;
if (ww < dotWidth) imax = ww;
else imax = dotWidth;
if (hh < dotHeight) jmax = hh;
else jmax = dotHeight;
f.width = ww;
f.height = hh;
t = new bool[ww, hh];
for (int i=0; i<imax; i++) {
for (int j=0; j<jmax; j++) {
t[i, j] = f.data[i, j];
}
}
f.data = t;
f = frameResize(f, ww, hh);
dotWidth = ww;
dotHeight = hh;
w = pixelOffset + dotWidth * (cellSize + gap);
h = pixelOffset + dotHeight * (cellSize + gap);
cbZoom_SelectedIndexChanged(cbZoom, null);
fbuffer = false;
}
private void cbZoom_SelectedIndexChanged(object sender, EventArgs e) {
@@ -347,7 +347,7 @@ namespace McBitFont {
bool c;
for (int i = 0; i < dotWidth; i++) {
c = f.data[i, dotHeight - 1];
for (int j = dotHeight-1; j >= 0; j--) {
for (int j = dotHeight - 1; j >= 0; j--) {
if (j == 0) {
f.data[i, j] = c;
} else {
@@ -448,7 +448,7 @@ namespace McBitFont {
for (int i = 0; i < m.width; i++) {
for (int j = 0; j < m.height; j++) {
c = m.data[i, j] ? Color.Black : Color.White;
bmp.SetPixel(i+imin, j+jmin, c);
bmp.SetPixel(i + imin, j + jmin, c);
}
}
var sizedBMP = new Bitmap(bmp, new Size(50, 50));
@@ -464,19 +464,19 @@ namespace McBitFont {
Pen p = new Pen(Color.FromArgb(64, Color.Green));
int x, y;
for (int i=0; i<dotWidth; i++) {
for (int i = 0; i < dotWidth; i++) {
x = pixelOffset + i * (cellSize + gap) - hScroll.Value;
if (gap > 0 && i != 0 && (i % 8) == 0) {
g.DrawLine(p, x - 1, pixelOffset - vScroll.Value, x - 1, h);
}
for (int j=0; j<dotHeight; j++) {
for (int j = 0; j < dotHeight; j++) {
y = pixelOffset + j * (cellSize + gap) - vScroll.Value;
if (gap > 0 && i == 0 && j != 0 && (j % 8) == 0) {
g.DrawLine(p, pixelOffset - hScroll.Value, y-1, w, y-1);
g.DrawLine(p, pixelOffset - hScroll.Value, y - 1, w, y - 1);
}
if (f.data[i, j]) sb = sbb;
else sb = sbw;
g.FillRectangle(sb, x, (baseline == j ? y+1 : y), cellSize, (baseline == j ? cellSize-1 : cellSize));
g.FillRectangle(sb, x, (baseline == j ? y + 1 : y), cellSize, (baseline == j ? cellSize - 1 : cellSize));
}
}
@@ -525,6 +525,7 @@ namespace McBitFont {
}
private void newToolStripMenuItem_Click(object sender, EventArgs e) {
checkModifiedFrame();
if (prjModified) {
if (MessageBox.Show("The project is modified.\nDo you want to save it first?", "Project was modified!", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes) {
saveToolStripMenuItem.PerformClick();
@@ -544,33 +545,32 @@ namespace McBitFont {
nudY.Value = newh;
FrameMiniature newf;
if (form.cbSingle.Checked) {
frames.Add( new FrameMiniature(0, neww, newh));
frames.Add(new FrameMiniature(0, neww, newh));
//f = frames.Find(x => x.code == 0);
append = "Single";
monospaced = false;
} else {
int i;
if (form.cbNotPrintable.Checked) {
for (i = 0; i < 32; i++) {
newf = new FrameMiniature(i, neww, newh);
if (form.cbFontBased.Checked) newf = fillFrame(newf, form.dlgFont.Font, (int)form.nudShiftX.Value, (int)form.nudShiftY.Value);
frames.Add(newf);
}
int i, imin, imax;
if (form.cbDigits.Checked) {
imin = 48;
imax = 57;
} else {
if (form.cbNotPrintable.Checked) imin = 0;
else if (form.cbLatin.Checked) imin = 32;
else imin = 128;
if (form.cbExtended.Checked) imax = 255;
else if (form.cbLatin.Checked) imax = 127;
else imax = 31;
}
if (form.cbLatin.Checked) {
for (i = 32; i < 128; i++) {
newf = new FrameMiniature(i, neww, newh);
if (form.cbFontBased.Checked) newf = fillFrame(newf, form.dlgFont.Font, (int)form.nudShiftX.Value, (int)form.nudShiftY.Value);
frames.Add(newf);
}
}
if (form.cbExtended.Checked) {
for (i = 128; i < 256; i++) {
newf = new FrameMiniature(i, neww, newh);
if (form.cbFontBased.Checked) newf = fillFrame(newf, form.dlgFont.Font, (int)form.nudShiftX.Value, (int)form.nudShiftY.Value);
frames.Add(newf);
}
for (i = imin; i <= imax; i++) {
newf = new FrameMiniature(i, neww, newh);
if (form.cbFontBased.Checked) newf = fillFrame(newf, form.dlgFont.Font, (int)form.nudShiftX.Value, (int)form.nudShiftY.Value);
frames.Add(newf);
}
monospaced = form.rbMono.Checked;
}
lblType.Text = monospaced ? "Monospaced" : "Variable width / Single";
@@ -579,7 +579,7 @@ namespace McBitFont {
var s = ff.code.ToString().PadLeft(3, '0');
ilMiniatures.Images.Add(s, (Image)getMiniPictue(ff));
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());
dotPanel.Refresh();
@@ -589,6 +589,7 @@ namespace McBitFont {
baseline = 0;
prjName = "Untitled";
prjFileName = "";
this.Text = "McBitFont " + version + " - " + prjName;
modified = false;
checkForAdd();
@@ -599,14 +600,11 @@ namespace McBitFont {
private void miniList_SelectedIndexChanged(object sender, EventArgs e) {
if (miniList.FocusedItem == null) return;
if (modified) {
if (MessageBox.Show("Current symbol is modified.\nDo you want to save the changes?", "Symbol was modified!", MessageBoxButtons.YesNo) == DialogResult.Yes) {
saveFrame();
}
modified = false;
}
checkModifiedFrame();
if (miniList.SelectedItems.Count == 0) {
removeSymbolToolStripMenuItem.Enabled = false;
removeBeforeToolStripMenuItem.Enabled = false;
removeAfterToolStripMenuItem.Enabled = false;
copyToolStripMenuItem.Enabled = false;
pasteToolStripMenuItem.Enabled = false;
return;
@@ -626,73 +624,94 @@ namespace McBitFont {
removeSymbolToolStripMenuItem.Enabled = false;
}
copyToolStripMenuItem.Enabled = true;
if (ff.Equals(frames.First())) {
removeBeforeToolStripMenuItem.Enabled = false;
removeAfterToolStripMenuItem.Enabled = true;
} else if (ff.Equals(frames.Last())) {
removeBeforeToolStripMenuItem.Enabled = true;
removeAfterToolStripMenuItem.Enabled = false;
} else {
removeBeforeToolStripMenuItem.Enabled = true;
removeAfterToolStripMenuItem.Enabled = true;
}
if (fbuffer) pasteToolStripMenuItem.Enabled = true;
else pasteToolStripMenuItem.Enabled = false;
}
private void saveToolStripMenuItem_Click(object sender, EventArgs e) {
checkModifiedFrame();
if (dlgSave.ShowDialog() == DialogResult.OK) {
SaveBlock sav;
sav.monospaced = monospaced;
sav.frames = frames;
sav.codepage = codepage;
sav.baseline = baseline;
BinaryFormatter formatter = new BinaryFormatter();
using (Stream ms = File.OpenWrite(dlgSave.FileName)) {
formatter.Serialize(ms, sav);
ms.Close();
}
prjModified = false;
prjName = Path.GetFileNameWithoutExtension(dlgSave.FileName);
this.Text = "McBitFont " + version + " - " + prjName;
saveProject(dlgSave.FileName);
}
}
private void loadProject(string filename) {
SaveBlock sav;
using (FileStream fs = File.Open(filename, FileMode.Open)) {
sav = MessagePackSerializer.Deserialize<SaveBlock>(fs);
fs.Close();
}
monospaced = sav.monospaced;
codepage = sav.codepage;
baseline = sav.baseline;
lblType.Text = monospaced ? "Monospaced" : "Variable width / Single";
frames = sav.frames;
miniList.Items.Clear();
ilMiniatures.Images.Clear();
foreach (FrameMiniature ff in frames) {
var s = ff.code.ToString().PadLeft(3, '0');
var sss = decodeSymbol(ff.code);
ilMiniatures.Images.Add(s, (Image)getMiniPictue(ff));
miniList.Items.Add(s, s + ' ' + sss, s);
}
nudX.ValueChanged -= nudX_ValueChanged;
nudY.ValueChanged -= nudY_ValueChanged;
nudX.Value = frames.First().width;
nudY.Value = frames.First().height;
dotResize((int)nudX.Value, (int)nudY.Value);
nudX.ValueChanged += nudX_ValueChanged;
nudY.ValueChanged += nudY_ValueChanged;
f = copyFrame(frames.First());
dotPanel.Refresh();
miniList.Refresh();
modified = false;
prjModified = false;
prjFileName = filename;
prjName = Path.GetFileNameWithoutExtension(filename);
this.Text = "McBitFont " + version + " - " + prjName;
checkForAdd();
fbuffer = false;
}
private void saveProject(string filename) {
SaveBlock sav;
sav.monospaced = monospaced;
sav.frames = frames;
sav.codepage = codepage;
sav.baseline = baseline;
using (Stream ms = File.OpenWrite(filename)) {
MessagePackSerializer.Serialize(ms, sav);
ms.Close();
}
prjModified = false;
prjName = Path.GetFileNameWithoutExtension(filename);
prjFileName = filename;
this.Text = "McBitFont " + version + " - " + prjName;
}
private void openToolStripMenuItem_Click(object sender, EventArgs e) {
if (prjModified) {
if (MessageBox.Show("The project is modified.\nDo you want to save it first?", "Project was modified!", MessageBoxButtons.YesNo) == DialogResult.Yes) {
saveToolStripMenuItem.PerformClick();
saveAsToolStripMenuItem.PerformClick();
return;
}
}
if (dlgOpen.ShowDialog() == DialogResult.OK) {
SaveBlock sav;
BinaryFormatter formatter = new BinaryFormatter();
using (FileStream fs = File.Open(dlgOpen.FileName, FileMode.Open)) {
sav = (SaveBlock)formatter.Deserialize(fs);
fs.Close();
}
monospaced = sav.monospaced;
codepage = sav.codepage;
baseline = sav.baseline;
lblType.Text = monospaced ? "Monospaced" : "Variable width / Single";
frames = sav.frames;
miniList.Items.Clear();
ilMiniatures.Images.Clear();
foreach (FrameMiniature ff in frames) {
var s = ff.code.ToString().PadLeft(3, '0');
var sss = decodeSymbol(ff.code);
ilMiniatures.Images.Add(s, (Image)getMiniPictue(ff));
miniList.Items.Add(s, s + ' ' + sss, s);
}
nudX.ValueChanged -= nudX_ValueChanged;
nudY.ValueChanged -= nudY_ValueChanged;
nudX.Value = frames.First().width;
nudY.Value = frames.First().height;
dotResize((int)nudX.Value, (int)nudY.Value);
nudX.ValueChanged += nudX_ValueChanged;
nudY.ValueChanged += nudY_ValueChanged;
f = copyFrame(frames.First());
dotPanel.Refresh();
miniList.Refresh();
modified = false;
prjModified = false;
prjName = Path.GetFileNameWithoutExtension(dlgOpen.FileName);
this.Text = "McBitFont " + version + " - " + prjName;
checkForAdd();
fbuffer = false;
loadProject(dlgOpen.FileName);
}
}
@@ -745,7 +764,19 @@ namespace McBitFont {
}
private void pasteToolStripMenuItem_Click(object sender, EventArgs e) {
Array.Copy(fbuf.data, f.data, fbuf.data.Length);
if (fbuf.width == f.width && fbuf.height == f.height) {
Array.Copy(fbuf.data, f.data, fbuf.data.Length);
} else {
var wmax = (fbuf.width > f.width) ? f.width : fbuf.width;
var hmax = (fbuf.height > f.height) ? f.height : fbuf.height;
for (int i = 0; i < wmax; i++) {
for (int j = 0; j < hmax; j++) {
f.data[i, j] = fbuf.data[i, j];
}
}
}
dotPanel.Refresh();
modified = true;
}
@@ -759,6 +790,32 @@ namespace McBitFont {
set_base = !set_base;
}
// Check modified / Save frame
private void checkModifiedFrame() {
if (modified) {
if (MessageBox.Show("Current symbol is modified.\nDo you want to save the changes?", "Symbol was modified!", MessageBoxButtons.YesNo) == DialogResult.Yes) {
saveFrame();
}
modified = false;
}
}
private void saveToolStripMenuItem_Click_1(object sender, EventArgs e) {
if (prjFileName == "") {
saveAsToolStripMenuItem.PerformClick();
} else {
checkModifiedFrame();
saveProject(prjFileName);
}
}
private void btnClear_Click(object sender, EventArgs e) {
Array.Clear(f.data, 0, f.data.Length);
modified = true;
dotPanel.Refresh();
}
private void MainForm_FormClosing(object sender, FormClosingEventArgs e) {
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) {
@@ -773,5 +830,35 @@ namespace McBitFont {
dotPanel.Refresh();
}
// Remove all before or after specified symbol
private void removeBA(bool before) {
if (miniList.SelectedItems.Count == 0) {
removeBeforeToolStripMenuItem.Enabled = false;
removeAfterToolStripMenuItem.Enabled = false;
return;
}
int step = before ? -1 : 1;
var sel = miniList.SelectedItems[0].ImageKey;
int code = Convert.ToInt32(sel);
int findex;
while (miniList.Items.ContainsKey((code + step).ToString().PadLeft(3, '0'))) {
code += step;
findex = frames.FindIndex(x => x.code == code);
frames.RemoveAt(findex);
miniList.Items.RemoveByKey(code.ToString().PadLeft(3, '0'));
}
//dotPanel.Refresh();
miniList.Refresh();
prjModified = true;
}
private void removeBeforeToolStripMenuItem_Click(object sender, EventArgs e) {
removeBA(true);
}
private void removeAfterToolStripMenuItem_Click(object sender, EventArgs e) {
removeBA(false);
}
}
}

View File

@@ -117,6 +117,9 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="toolTip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>436, 17</value>
</metadata>
<metadata name="ilMiniatures.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>

View File

@@ -1,17 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{7C01529E-4414-405F-9B57-19FA4AF8ED60}</ProjectGuid>
<TargetFramework>net9.0-windows</TargetFramework>
<OutputType>WinExe</OutputType>
<RootNamespace>McBitFont</RootNamespace>
<AssemblyName>McBitFont</AssemblyName>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Deterministic>true</Deterministic>
<PublishUrl>publish\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
@@ -27,170 +17,24 @@
<IsWebBootstrapper>false</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup>
<UseWindowsForms>true</UseWindowsForms>
<ImportWindowsDesktopTargets>true</ImportWindowsDesktopTargets>
<ApplicationIcon>icon_64.ico</ApplicationIcon>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<FileVersion>2.0.0.0</FileVersion>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Deployment" />
<Reference Include="System.Drawing" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="About.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="About.Designer.cs">
<DependentUpon>About.cs</DependentUpon>
</Compile>
<Compile Include="Export.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Export.Designer.cs">
<DependentUpon>Export.cs</DependentUpon>
</Compile>
<Compile Include="Form1.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Form1.Designer.cs">
<DependentUpon>Form1.cs</DependentUpon>
</Compile>
<Compile Include="New.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="New.Designer.cs">
<DependentUpon>New.cs</DependentUpon>
</Compile>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<EmbeddedResource Include="About.resx">
<DependentUpon>About.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Export.resx">
<DependentUpon>Export.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Form1.resx">
<DependentUpon>Form1.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="New.resx">
<DependentUpon>New.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</EmbeddedResource>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
<DesignTime>True</DesignTime>
</Compile>
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\action_add.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\action_remove.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\arrow_back.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\arrow_down.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\arrow_next.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\arrow_top.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\file.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\folder_open.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\save.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\action_check.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\Famfamfam-Silk-Shape-flip-vertical.16.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\Famfamfam-Silk-Shape-flip-horizontal.16.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\Famfamfam-Silk-Page-paste.16.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\Famfamfam-Silk-Page-copy.16.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\Famfamfam-Silk-Door-out.16.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\Famfamfam-Silk-Disk.16.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\Famfamfam-Silk-Page-white.16.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\Famfamfam-Silk-Folder-page.16.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\Famfamfam-Silk-Folder.16.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\Ionic-Ionicons-Invert-mode-outline.16.png" />
</ItemGroup>
<ItemGroup>
<Content Include="icon.ico" />
<Content Include="icon_64.ico" />
<None Include="Resources\icon_64.png" />
<None Include="Resources\icon_32.png" />
<None Include="Resources\icon.png" />
<PackageReference Include="MessagePack" Version="3.1.3" />
<PackageReference Include="MessagePack.Annotations" Version="3.1.3" />
<PackageReference Include="MessagePackAnalyzer" Version="3.1.3" />
<PackageReference Include="Microsoft.Bcl.AsyncInterfaces" Version="9.0.5" />
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
<PackageReference Include="Microsoft.NET.StringTools" Version="17.11.4" />
<PackageReference Include="System.Collections.Immutable" Version="9.0.5" />
<PackageReference Include="System.Runtime.CompilerServices.Unsafe" Version="6.1.2" />
<PackageReference Include="System.Text.Encoding.CodePages" Version="9.0.5" />
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include=".NETFramework,Version=v4.7.2">
@@ -204,5 +48,4 @@
<Install>false</Install>
</BootstrapperPackage>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

View File

@@ -50,10 +50,11 @@
this.lblShiftX = new System.Windows.Forms.Label();
this.lblShiftY = new System.Windows.Forms.Label();
this.pnlFont = new System.Windows.Forms.Panel();
this.label4 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.nudChar2 = new System.Windows.Forms.NumericUpDown();
this.nudChar1 = new System.Windows.Forms.NumericUpDown();
this.label3 = new System.Windows.Forms.Label();
this.label4 = new System.Windows.Forms.Label();
this.cbDigits = new System.Windows.Forms.CheckBox();
((System.ComponentModel.ISupportInitialize)(this.nudNewX)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.nudNewY)).BeginInit();
this.panel1.SuspendLayout();
@@ -159,35 +160,37 @@
// cbNotPrintable
//
this.cbNotPrintable.AutoSize = true;
this.cbNotPrintable.Location = new System.Drawing.Point(140, 54);
this.cbNotPrintable.Location = new System.Drawing.Point(140, 77);
this.cbNotPrintable.Name = "cbNotPrintable";
this.cbNotPrintable.Size = new System.Drawing.Size(116, 17);
this.cbNotPrintable.TabIndex = 7;
this.cbNotPrintable.Text = "0-31 (Not printable)";
this.cbNotPrintable.UseVisualStyleBackColor = true;
this.cbNotPrintable.CheckedChanged += new System.EventHandler(this.checkboxChanged);
//
// cbLatin
//
this.cbLatin.AutoSize = true;
this.cbLatin.Checked = true;
this.cbLatin.CheckState = System.Windows.Forms.CheckState.Checked;
this.cbLatin.Location = new System.Drawing.Point(140, 77);
this.cbLatin.Location = new System.Drawing.Point(140, 100);
this.cbLatin.Name = "cbLatin";
this.cbLatin.Size = new System.Drawing.Size(91, 17);
this.cbLatin.TabIndex = 8;
this.cbLatin.Text = "32-127 (Latin)";
this.cbLatin.UseVisualStyleBackColor = true;
this.cbLatin.CheckedChanged += new System.EventHandler(this.checkboxChanged);
//
// cbExtended
//
this.cbExtended.AutoSize = true;
this.cbExtended.Location = new System.Drawing.Point(140, 100);
this.cbExtended.Location = new System.Drawing.Point(140, 123);
this.cbExtended.Name = "cbExtended";
this.cbExtended.Size = new System.Drawing.Size(119, 17);
this.cbExtended.TabIndex = 9;
this.cbExtended.Text = "128-255 (Extended)";
this.cbExtended.UseVisualStyleBackColor = true;
this.cbExtended.CheckedChanged += new System.EventHandler(this.cbExtended_CheckedChanged);
this.cbExtended.CheckedChanged += new System.EventHandler(this.checkboxChanged);
//
// btnOK
//
@@ -221,7 +224,7 @@
this.cbSingle.TabIndex = 12;
this.cbSingle.Text = "Single frame";
this.cbSingle.UseVisualStyleBackColor = true;
this.cbSingle.CheckedChanged += new System.EventHandler(this.cbSingle_CheckedChanged);
this.cbSingle.CheckedChanged += new System.EventHandler(this.checkboxChanged);
//
// toolTip1
//
@@ -235,7 +238,7 @@
this.cbEncoding.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cbEncoding.Enabled = false;
this.cbEncoding.FormattingEnabled = true;
this.cbEncoding.Location = new System.Drawing.Point(140, 123);
this.cbEncoding.Location = new System.Drawing.Point(140, 146);
this.cbEncoding.Name = "cbEncoding";
this.cbEncoding.Size = new System.Drawing.Size(121, 21);
this.cbEncoding.TabIndex = 13;
@@ -294,7 +297,7 @@
this.cbFontBased.TabIndex = 16;
this.cbFontBased.Text = "Based on a font";
this.cbFontBased.UseVisualStyleBackColor = true;
this.cbFontBased.CheckedChanged += new System.EventHandler(this.cbFontBased_CheckedChanged);
this.cbFontBased.CheckedChanged += new System.EventHandler(this.checkboxChanged);
//
// lblFont
//
@@ -371,6 +374,26 @@
this.pnlFont.TabIndex = 22;
this.pnlFont.Visible = false;
//
// label4
//
this.label4.AutoSize = true;
this.label4.Location = new System.Drawing.Point(112, 152);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(45, 13);
this.label4.TabIndex = 25;
this.label4.Text = "Sample:";
this.label4.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(14, 152);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(45, 13);
this.label3.TabIndex = 24;
this.label3.Text = "Sample:";
this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// nudChar2
//
this.nudChar2.Location = new System.Drawing.Point(161, 149);
@@ -407,25 +430,16 @@
0});
this.nudChar1.ValueChanged += new System.EventHandler(this.nudNewX_ValueChanged);
//
// label3
// cbDigits
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(14, 152);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(45, 13);
this.label3.TabIndex = 24;
this.label3.Text = "Sample:";
this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// label4
//
this.label4.AutoSize = true;
this.label4.Location = new System.Drawing.Point(112, 152);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(45, 13);
this.label4.TabIndex = 25;
this.label4.Text = "Sample:";
this.label4.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
this.cbDigits.AutoSize = true;
this.cbDigits.Location = new System.Drawing.Point(140, 54);
this.cbDigits.Name = "cbDigits";
this.cbDigits.Size = new System.Drawing.Size(74, 17);
this.cbDigits.TabIndex = 23;
this.cbDigits.Text = "Digits only";
this.cbDigits.UseVisualStyleBackColor = true;
this.cbDigits.CheckedChanged += new System.EventHandler(this.checkboxChanged);
//
// New
//
@@ -433,6 +447,7 @@
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.CancelButton = this.btnCancel;
this.ClientSize = new System.Drawing.Size(484, 211);
this.Controls.Add(this.cbDigits);
this.Controls.Add(this.pnlFont);
this.Controls.Add(this.cbFontBased);
this.Controls.Add(this.cbEncoding);
@@ -506,5 +521,6 @@
private System.Windows.Forms.Label label3;
public System.Windows.Forms.NumericUpDown nudChar2;
public System.Windows.Forms.NumericUpDown nudChar1;
public System.Windows.Forms.CheckBox cbDigits;
}
}

View File

@@ -36,25 +36,13 @@ namespace McBitFont {
this.Width = 300; this.Height = 250;
}
private void cbSingle_CheckedChanged(object sender, EventArgs e) {
bool c = !cbSingle.Checked;
bool f = cbFontBased.Checked;
cbNotPrintable.Enabled = c;
cbLatin.Enabled = c;
cbExtended.Enabled = c;
cbFontBased.Enabled = c;
rbMono.Enabled = c;
rbVar.Enabled = c;
pnlFont.Visible = c && f;
this.Width = c && f ? 500 : 300;
}
private void New_Load(object sender, EventArgs e) {
toolTip1.SetToolTip(nudNewX, "Frame Width;\nCharacter width;\nDefault character width for Variable width fonts");
toolTip1.SetToolTip(nudNewY, "Frame Height;\nCharacter height");
toolTip1.SetToolTip(rbMono, "Monospaced font");
toolTip1.SetToolTip(rbVar, "Variable width font");
toolTip1.SetToolTip(cbSingle, "Create one single frame");
toolTip1.SetToolTip(cbDigits, "Only digits characters with codes 48 - 57");
toolTip1.SetToolTip(cbNotPrintable, "Add not printable characters with codes 0 - 31");
toolTip1.SetToolTip(cbLatin, "Add Latin characters with codes 32 - 127");
toolTip1.SetToolTip(cbExtended, "Add Extended characters with codes 128 - 255");
@@ -157,17 +145,6 @@ namespace McBitFont {
nud.Select(0, nud.Text.Length);
}
private void cbExtended_CheckedChanged(object sender, EventArgs e) {
cbEncoding.Enabled = cbExtended.Checked;
}
private void cbFontBased_CheckedChanged(object sender, EventArgs e) {
bool c = !cbSingle.Checked;
bool f = cbFontBased.Checked;
pnlFont.Visible = c && f;
this.Width = c && f ? 500 : 300;
}
private void btnFont_Click(object sender, EventArgs e) {
if (dlgFont.ShowDialog() == DialogResult.OK) {
lblFont.Text = dlgFont.Font.Name + " " + dlgFont.Font.Size.ToString();
@@ -178,5 +155,28 @@ namespace McBitFont {
private void nudNewX_ValueChanged(object sender, EventArgs e) {
updateChars();
}
private void checkboxChanged(object sender, EventArgs e) {
if (!(sender as CheckBox).Focused) return;
bool c = !cbSingle.Checked;
bool d = !cbDigits.Checked;
bool p = cbNotPrintable.Checked;
bool x = cbExtended.Checked;
bool f = cbFontBased.Checked;
cbDigits.Enabled = c;
cbNotPrintable.Enabled = c && d;
cbLatin.Enabled = c && d;
cbExtended.Enabled = c && d;
cbFontBased.Enabled = c;
cbEncoding.Enabled = c && d && x;
rbMono.Enabled = c;
rbVar.Enabled = c;
pnlFont.Visible = c && f;
if (p && x) cbLatin.Checked = true;
this.Width = c && f ? 500 : 300;
btnOK.Enabled = !c || !d || x || p || cbLatin.Checked;
}
}
}

View File

@@ -1,36 +0,0 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// Общие сведения об этой сборке предоставляются следующим набором
// набора атрибутов. Измените значения этих атрибутов для изменения сведений,
// связанных со сборкой.
[assembly: AssemblyTitle("McBitFont")]
[assembly: AssemblyDescription("McFLY's Bit Font and Image Editor")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("McBitFont")]
[assembly: AssemblyCopyright("© Anton Mukhin, 2023")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Установка значения False для параметра ComVisible делает типы в этой сборке невидимыми
// для компонентов COM. Если необходимо обратиться к типу в этой сборке через
// COM, следует установить атрибут ComVisible в TRUE для этого типа.
[assembly: ComVisible(false)]
// Следующий GUID служит для идентификации библиотеки типов, если этот проект будет видимым для COM
[assembly: Guid("7c01529e-4414-405f-9b57-19fa4af8ed60")]
// Сведения о версии сборки состоят из указанных ниже четырех значений:
//
// Основной номер версии
// Дополнительный номер версии
// Номер сборки
// Редакция
//
// Можно задать все значения или принять номера сборки и редакции по умолчанию
// используя "*", как показано ниже:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.4.0.0")]
[assembly: AssemblyFileVersion("1.4.0.0")]

View File

@@ -15,9 +15,8 @@ Some basic hints on the interface:
- Mouse 2 to mark a puxel white
- Drag the mouse holding a button to draw pixels
- Mouse Scroll to scroll up and down
- Crtl + scroll to scroll left and right
- Shift + scroll to zoom
- Crtl + scroll to zoom
- Shift + scroll to scroll left and right
Download in the Releases section!

16
TODO.txt Normal file
View File

@@ -0,0 +1,16 @@
Application:
V Migrate from .Net Framework 4.7 to .NET 9
Functionality:
- Context menu in symbol navigator
V Delete symbols before/after selected
- Shift all symbols on code line (change symbol codes)
- Specify starting code (extends the shift)
- Ability to make monospaced font a variable width one
- Undo/Redo
- Image import from a file
- Import from a text array
- Rectangle selection to mass-paint, shift and mirror pixels
- "Packed" fonts export
Bugs:

Binary file not shown.

BIN
examples/Font_5x7.mbfont Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
examples/icons_9x9.mbfont Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.