Working on export
34
McBitFont/Export.Designer.cs
generated
@@ -29,6 +29,7 @@
|
||||
this.cbHDir = new System.Windows.Forms.ComboBox();
|
||||
this.cbOrder = new System.Windows.Forms.ComboBox();
|
||||
this.gbOptions = new System.Windows.Forms.GroupBox();
|
||||
this.cbZeroes = new System.Windows.Forms.CheckBox();
|
||||
this.cbHeader = new System.Windows.Forms.CheckBox();
|
||||
this.cbComments = new System.Windows.Forms.CheckBox();
|
||||
this.gbNumbers = new System.Windows.Forms.GroupBox();
|
||||
@@ -42,7 +43,6 @@
|
||||
this.cbFormat = new System.Windows.Forms.ComboBox();
|
||||
this.btnGenerate = new System.Windows.Forms.Button();
|
||||
this.btnClose = new System.Windows.Forms.Button();
|
||||
this.cbZeroes = new System.Windows.Forms.CheckBox();
|
||||
this.gbScan.SuspendLayout();
|
||||
this.gbOptions.SuspendLayout();
|
||||
this.gbNumbers.SuspendLayout();
|
||||
@@ -58,15 +58,13 @@
|
||||
| System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.txtOutput.AutoWordSelection = true;
|
||||
this.txtOutput.DetectUrls = false;
|
||||
this.txtOutput.Font = new System.Drawing.Font("Lucida Console", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
|
||||
this.txtOutput.Font = new System.Drawing.Font("Courier New", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
|
||||
this.txtOutput.HideSelection = false;
|
||||
this.txtOutput.Location = new System.Drawing.Point(151, 12);
|
||||
this.txtOutput.Name = "txtOutput";
|
||||
this.txtOutput.ScrollBars = System.Windows.Forms.RichTextBoxScrollBars.Vertical;
|
||||
this.txtOutput.Size = new System.Drawing.Size(529, 507);
|
||||
this.txtOutput.TabIndex = 0;
|
||||
this.txtOutput.Text = "// Comment.\nusing System;\n\npublic class Stuff : Form { \n public static void Main(" +
|
||||
"String args) {\n }\n}\n\n\nTest\n123123\nCode code code\n\nAAAsdasdasd\n!";
|
||||
this.txtOutput.Text = "";
|
||||
//
|
||||
// gbScan
|
||||
//
|
||||
@@ -129,6 +127,18 @@
|
||||
this.gbOptions.TabStop = false;
|
||||
this.gbOptions.Text = "Options";
|
||||
//
|
||||
// cbZeroes
|
||||
//
|
||||
this.cbZeroes.AutoSize = true;
|
||||
this.cbZeroes.Checked = true;
|
||||
this.cbZeroes.CheckState = System.Windows.Forms.CheckState.Checked;
|
||||
this.cbZeroes.Location = new System.Drawing.Point(6, 65);
|
||||
this.cbZeroes.Name = "cbZeroes";
|
||||
this.cbZeroes.Size = new System.Drawing.Size(98, 17);
|
||||
this.cbZeroes.TabIndex = 2;
|
||||
this.cbZeroes.Text = "Leading zeroes";
|
||||
this.cbZeroes.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// cbHeader
|
||||
//
|
||||
this.cbHeader.AutoSize = true;
|
||||
@@ -140,6 +150,7 @@
|
||||
this.cbHeader.TabIndex = 1;
|
||||
this.cbHeader.Text = "Meta header";
|
||||
this.cbHeader.UseVisualStyleBackColor = true;
|
||||
this.cbHeader.CheckedChanged += new System.EventHandler(this.cbFormat_SelectedIndexChanged);
|
||||
//
|
||||
// cbComments
|
||||
//
|
||||
@@ -274,6 +285,7 @@
|
||||
this.cbFormat.Name = "cbFormat";
|
||||
this.cbFormat.Size = new System.Drawing.Size(121, 21);
|
||||
this.cbFormat.TabIndex = 6;
|
||||
this.cbFormat.SelectedIndexChanged += new System.EventHandler(this.cbFormat_SelectedIndexChanged);
|
||||
//
|
||||
// btnGenerate
|
||||
//
|
||||
@@ -295,18 +307,6 @@
|
||||
this.btnClose.Text = "Close";
|
||||
this.btnClose.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// cbZeroes
|
||||
//
|
||||
this.cbZeroes.AutoSize = true;
|
||||
this.cbZeroes.Checked = true;
|
||||
this.cbZeroes.CheckState = System.Windows.Forms.CheckState.Checked;
|
||||
this.cbZeroes.Location = new System.Drawing.Point(6, 65);
|
||||
this.cbZeroes.Name = "cbZeroes";
|
||||
this.cbZeroes.Size = new System.Drawing.Size(98, 17);
|
||||
this.cbZeroes.TabIndex = 2;
|
||||
this.cbZeroes.Text = "Leading zeroes";
|
||||
this.cbZeroes.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// Export
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
|
@@ -14,6 +14,9 @@ namespace McBitFont {
|
||||
|
||||
private MainForm mainForm;
|
||||
|
||||
//private List<string> comments = new List<string>();
|
||||
private Dictionary<string, string> comments = new Dictionary<string, string>();
|
||||
|
||||
public Export(object sender) {
|
||||
InitializeComponent();
|
||||
|
||||
@@ -28,6 +31,31 @@ namespace McBitFont {
|
||||
cb.SelectedIndex = 0;
|
||||
}
|
||||
}
|
||||
comments.Add("header",
|
||||
"// File generated by McBitFont " + MainForm.version + "\n" +
|
||||
"// made by Anton Mukhin (mcfly@mcflyer.ru)\n" +
|
||||
"//\n" +
|
||||
"//\n"
|
||||
);
|
||||
comments.Add("scan_order", "// Scan order: ");
|
||||
comments.Add("scan_hdir", "// Horizontal direction: ");
|
||||
comments.Add("scan_vdir", "// Vertical direction: ");
|
||||
|
||||
comments.Add("num_bit_order", "// Bit order: ");
|
||||
comments.Add("num_base", "// Numbers base: ");
|
||||
comments.Add("num_size", "// Numbers size: ");
|
||||
|
||||
comments.Add("text_format", "// Text format: ");
|
||||
comments.Add("text_lines", "// Numbers per line: ");
|
||||
|
||||
comments.Add("font_header_map",
|
||||
"// Font header map:\n" +
|
||||
"// width; // Font width in pixels\n" +
|
||||
"// height; // Font height in pixels\n" +
|
||||
"// space; // Font space in pixels\n" +
|
||||
"// first; // First character code\n" +
|
||||
"// last; // Last character code\n"
|
||||
);
|
||||
}
|
||||
|
||||
private void cbOrder_SelectedIndexChanged(object sender, EventArgs e) {
|
||||
@@ -49,29 +77,38 @@ namespace McBitFont {
|
||||
Regex r = new Regex("([ \\t{}():;])");
|
||||
string[] tokens = r.Split(line);
|
||||
|
||||
string[] keywords = { "const", "array", "char", "byte" };
|
||||
string[] datatypes = { "uint8_t", "uint16_t", "uint32_t" };
|
||||
foreach (string token in tokens) {
|
||||
// Set the tokens default color and font.
|
||||
txtOutput.SelectionColor = Color.Black;
|
||||
txtOutput.SelectionFont = new Font("Lucida Console", (float)9.75, FontStyle.Regular);
|
||||
txtOutput.SelectionFont = new Font("Courier New", (float)9.75, FontStyle.Regular);
|
||||
|
||||
// Check for a comment.
|
||||
if (token == "//" || token.StartsWith("//")) {
|
||||
// Find the start of the comment and then extract the whole comment.
|
||||
int index = line.IndexOf("//");
|
||||
string comment = line.Substring(index, line.Length - index);
|
||||
txtOutput.SelectionColor = Color.Green;
|
||||
txtOutput.SelectionFont = new Font("Lucida Console", (float)9.75, FontStyle.Italic);
|
||||
txtOutput.SelectionColor = Color.FromArgb(0xFF, 0x3F, 0x7F, 0x5F);
|
||||
txtOutput.SelectionFont = new Font("Courier New", (float)9.75, FontStyle.Regular);
|
||||
txtOutput.SelectedText = comment;
|
||||
break;
|
||||
}
|
||||
|
||||
// Check whether the token is a keyword.
|
||||
string[] keywords = { "public", "void", "using", "static", "class", "array", "char", "uint8_t", "uint16_t", "uint32_t", "byte" };
|
||||
for (int i = 0; i < keywords.Length; i++) {
|
||||
if (keywords[i] == token) {
|
||||
// Apply alternative color and font to highlight keyword.
|
||||
txtOutput.SelectionColor = Color.Blue;
|
||||
txtOutput.SelectionFont = new Font("Lucida Console", (float)9.75, FontStyle.Bold);
|
||||
txtOutput.SelectionColor = Color.FromArgb(0xFF, 0x7F, 0x00, 0x55);
|
||||
txtOutput.SelectionFont = new Font("Courier New", (float)9.75, FontStyle.Bold);
|
||||
break;
|
||||
}
|
||||
}
|
||||
for (int i = 0; i < datatypes.Length; i++) {
|
||||
if (datatypes[i] == token) {
|
||||
// Apply alternative color and font to highlight data type.
|
||||
txtOutput.SelectionColor = Color.FromArgb(0xFF, 0x00, 0x50, 0x32); ;
|
||||
txtOutput.SelectionFont = new Font("Courier New", (float)9.75, FontStyle.Regular);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -87,8 +124,32 @@ namespace McBitFont {
|
||||
}
|
||||
|
||||
private void btnGenerate_Click(object sender, EventArgs e) {
|
||||
//string output = "";
|
||||
txtOutput.Clear();
|
||||
|
||||
bool com = cbComments.Checked;
|
||||
bool hdr = cbHeader.Checked;
|
||||
int lines = cbLines.SelectedIndex;
|
||||
|
||||
if (com) {
|
||||
//Header comments
|
||||
txtOutput.AppendText(comments["header"]);
|
||||
txtOutput.AppendText(comments["scan_order"] + cbOrder.Text + "\n");
|
||||
txtOutput.AppendText(comments["scan_hdir"] + cbHDir.Text + "\n");
|
||||
txtOutput.AppendText(comments["scan_vdir"] + cbVDir.Text + "\n\n");
|
||||
|
||||
txtOutput.AppendText(comments["num_bit_order"] + cbBitOrder.Text + "\n");
|
||||
txtOutput.AppendText(comments["num_base"] + cbNumBase.Text + "\n");
|
||||
txtOutput.AppendText(comments["num_size"] + cbNumSize.Text + "\n\n");
|
||||
|
||||
txtOutput.AppendText(comments["text_format"] + cbFormat.Text + "\n");
|
||||
txtOutput.AppendText(comments["text_lines"] + cbLines.Text + "\n\n");
|
||||
|
||||
if (hdr) {
|
||||
// comment about meta header map
|
||||
txtOutput.AppendText(comments["font_header_map"] + "\n\n");
|
||||
}
|
||||
}
|
||||
|
||||
int imin, jmin, imax, jmax, idir, jdir;
|
||||
if (cbOrder.SelectedIndex == 0) {
|
||||
if (cbHDir.SelectedIndex == 0) {
|
||||
@@ -140,15 +201,19 @@ namespace McBitFont {
|
||||
|
||||
|
||||
ushort bits = 8;
|
||||
string dataType = "uint8_t";
|
||||
switch (cbNumSize.SelectedIndex) {
|
||||
case 0:
|
||||
bits = 8;
|
||||
dataType = "uint8_t";
|
||||
break;
|
||||
case 1:
|
||||
bits = 16;
|
||||
dataType = "uint16_t";
|
||||
break;
|
||||
case 2:
|
||||
bits = 32;
|
||||
dataType = "uint32_t";
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -174,13 +239,23 @@ namespace McBitFont {
|
||||
break;
|
||||
}
|
||||
|
||||
//Array definition
|
||||
txtOutput.AppendText("const " + dataType + " " + mainForm.prjName + "[] = {\n");
|
||||
|
||||
if (com) txtOutput.AppendText(" // Data:\n");
|
||||
foreach ( MainForm.FrameMiniature f in mainForm.frames) {
|
||||
// For each frame
|
||||
string str;
|
||||
uint b = 0;
|
||||
int t, x, y;
|
||||
int t, x, y; // t - calculated bit number; x - actual x; y - actual y
|
||||
|
||||
if (com && lines != 1) {
|
||||
// Comments enabled and other than "1 symbol per line" selected
|
||||
// Print a symbol comment before its data
|
||||
txtOutput.AppendText(" // " + f.code.ToString() + " --> \n");
|
||||
}
|
||||
for (int i = imin; i != imax; i += idir) {
|
||||
str = "";
|
||||
str = " ";
|
||||
for (int j = jmin; j != jmax; j += jdir) {
|
||||
if (jdir < 0) t = jmin - j;
|
||||
else t = j;
|
||||
@@ -203,7 +278,7 @@ namespace McBitFont {
|
||||
|
||||
}
|
||||
if (((t + 1) % bits == 0) || j + jdir == jmax) {
|
||||
if (str.Length > 0) str += " ";
|
||||
if (str.Length > 2) str += " ";
|
||||
pref = (!cbZeroes.Checked && ((b < 10 && nbase == 16) || (b < 2 && nbase == 2))) ? "" : prefix;
|
||||
str += pref + Convert.ToString(b, nbase).PadLeft(pad, '0') + ',';
|
||||
}
|
||||
@@ -213,9 +288,20 @@ namespace McBitFont {
|
||||
}
|
||||
txtOutput.AppendText(Environment.NewLine);
|
||||
}
|
||||
// Close array definition
|
||||
txtOutput.AppendText("};\n");
|
||||
|
||||
txtOutput.SelectAll();
|
||||
ParseText();
|
||||
txtOutput.SelectionStart = 0;
|
||||
txtOutput.ScrollToCaret();
|
||||
}
|
||||
|
||||
private void cbFormat_SelectedIndexChanged(object sender, EventArgs e) {
|
||||
if (cbFormat.SelectedIndex == 1 && cbHeader.Checked) {
|
||||
MessageBox.Show("Cannot pack the font meta header into 2D array!\nChoose 1D array or disable the meta header.\n(Setting array format to 1D array)", "No header in 2D array!", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||
cbFormat.SelectedIndex = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
51
McBitFont/Form1.Designer.cs
generated
@@ -68,6 +68,8 @@
|
||||
this.aboutToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.dlgSave = new System.Windows.Forms.SaveFileDialog();
|
||||
this.dlgOpen = new System.Windows.Forms.OpenFileDialog();
|
||||
this.applyToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
this.exportToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
((System.ComponentModel.ISupportInitialize)(this.nudX)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.nudY)).BeginInit();
|
||||
this.panel1.SuspendLayout();
|
||||
@@ -403,6 +405,7 @@
|
||||
//
|
||||
// newToolStripMenuItem
|
||||
//
|
||||
this.newToolStripMenuItem.Image = global::McBitFont.Properties.Resources.file;
|
||||
this.newToolStripMenuItem.Name = "newToolStripMenuItem";
|
||||
this.newToolStripMenuItem.Size = new System.Drawing.Size(112, 22);
|
||||
this.newToolStripMenuItem.Text = "New";
|
||||
@@ -410,6 +413,7 @@
|
||||
//
|
||||
// openToolStripMenuItem
|
||||
//
|
||||
this.openToolStripMenuItem.Image = global::McBitFont.Properties.Resources.folder_open;
|
||||
this.openToolStripMenuItem.Name = "openToolStripMenuItem";
|
||||
this.openToolStripMenuItem.Size = new System.Drawing.Size(112, 22);
|
||||
this.openToolStripMenuItem.Text = "Open";
|
||||
@@ -417,6 +421,7 @@
|
||||
//
|
||||
// saveToolStripMenuItem
|
||||
//
|
||||
this.saveToolStripMenuItem.Image = global::McBitFont.Properties.Resources.save;
|
||||
this.saveToolStripMenuItem.Name = "saveToolStripMenuItem";
|
||||
this.saveToolStripMenuItem.Size = new System.Drawing.Size(112, 22);
|
||||
this.saveToolStripMenuItem.Text = "Save as";
|
||||
@@ -433,7 +438,8 @@
|
||||
//
|
||||
this.editToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||
this.addSymbolToolStripMenuItem,
|
||||
this.removeSymbolToolStripMenuItem});
|
||||
this.removeSymbolToolStripMenuItem,
|
||||
this.applyToolStripMenuItem});
|
||||
this.editToolStripMenuItem.Name = "editToolStripMenuItem";
|
||||
this.editToolStripMenuItem.Size = new System.Drawing.Size(39, 20);
|
||||
this.editToolStripMenuItem.Text = "Edit";
|
||||
@@ -441,15 +447,17 @@
|
||||
// addSymbolToolStripMenuItem
|
||||
//
|
||||
this.addSymbolToolStripMenuItem.Enabled = false;
|
||||
this.addSymbolToolStripMenuItem.Image = global::McBitFont.Properties.Resources.action_add;
|
||||
this.addSymbolToolStripMenuItem.Name = "addSymbolToolStripMenuItem";
|
||||
this.addSymbolToolStripMenuItem.Size = new System.Drawing.Size(159, 22);
|
||||
this.addSymbolToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
|
||||
this.addSymbolToolStripMenuItem.Text = "Add symbol";
|
||||
//
|
||||
// removeSymbolToolStripMenuItem
|
||||
//
|
||||
this.removeSymbolToolStripMenuItem.Enabled = false;
|
||||
this.removeSymbolToolStripMenuItem.Image = global::McBitFont.Properties.Resources.action_remove;
|
||||
this.removeSymbolToolStripMenuItem.Name = "removeSymbolToolStripMenuItem";
|
||||
this.removeSymbolToolStripMenuItem.Size = new System.Drawing.Size(159, 22);
|
||||
this.removeSymbolToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
|
||||
this.removeSymbolToolStripMenuItem.Text = "Remove symbol";
|
||||
//
|
||||
// toolsToolStripMenuItem
|
||||
@@ -461,57 +469,62 @@
|
||||
this.shiftRightToolStripMenuItem,
|
||||
this.invertToolStripMenuItem,
|
||||
this.mirrorXToolStripMenuItem,
|
||||
this.mirrorYToolStripMenuItem});
|
||||
this.mirrorYToolStripMenuItem,
|
||||
this.exportToolStripMenuItem});
|
||||
this.toolsToolStripMenuItem.Name = "toolsToolStripMenuItem";
|
||||
this.toolsToolStripMenuItem.Size = new System.Drawing.Size(46, 20);
|
||||
this.toolsToolStripMenuItem.Text = "Tools";
|
||||
//
|
||||
// shiftUpToolStripMenuItem
|
||||
//
|
||||
this.shiftUpToolStripMenuItem.Image = global::McBitFont.Properties.Resources.arrow_top;
|
||||
this.shiftUpToolStripMenuItem.Name = "shiftUpToolStripMenuItem";
|
||||
this.shiftUpToolStripMenuItem.Size = new System.Drawing.Size(132, 22);
|
||||
this.shiftUpToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
|
||||
this.shiftUpToolStripMenuItem.Text = "Shift Up";
|
||||
this.shiftUpToolStripMenuItem.Click += new System.EventHandler(this.btnShiftUp_Click);
|
||||
//
|
||||
// shiftDownToolStripMenuItem
|
||||
//
|
||||
this.shiftDownToolStripMenuItem.Image = global::McBitFont.Properties.Resources.arrow_down;
|
||||
this.shiftDownToolStripMenuItem.Name = "shiftDownToolStripMenuItem";
|
||||
this.shiftDownToolStripMenuItem.Size = new System.Drawing.Size(132, 22);
|
||||
this.shiftDownToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
|
||||
this.shiftDownToolStripMenuItem.Text = "Shift Down";
|
||||
this.shiftDownToolStripMenuItem.Click += new System.EventHandler(this.btnShiftDown_Click);
|
||||
//
|
||||
// shiftLeftToolStripMenuItem
|
||||
//
|
||||
this.shiftLeftToolStripMenuItem.Image = global::McBitFont.Properties.Resources.arrow_back;
|
||||
this.shiftLeftToolStripMenuItem.Name = "shiftLeftToolStripMenuItem";
|
||||
this.shiftLeftToolStripMenuItem.Size = new System.Drawing.Size(132, 22);
|
||||
this.shiftLeftToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
|
||||
this.shiftLeftToolStripMenuItem.Text = "Shift left";
|
||||
this.shiftLeftToolStripMenuItem.Click += new System.EventHandler(this.btnShiftLeft_Click);
|
||||
//
|
||||
// shiftRightToolStripMenuItem
|
||||
//
|
||||
this.shiftRightToolStripMenuItem.Image = global::McBitFont.Properties.Resources.arrow_next;
|
||||
this.shiftRightToolStripMenuItem.Name = "shiftRightToolStripMenuItem";
|
||||
this.shiftRightToolStripMenuItem.Size = new System.Drawing.Size(132, 22);
|
||||
this.shiftRightToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
|
||||
this.shiftRightToolStripMenuItem.Text = "Shift Right";
|
||||
this.shiftRightToolStripMenuItem.Click += new System.EventHandler(this.btnShiftRight_Click);
|
||||
//
|
||||
// invertToolStripMenuItem
|
||||
//
|
||||
this.invertToolStripMenuItem.Name = "invertToolStripMenuItem";
|
||||
this.invertToolStripMenuItem.Size = new System.Drawing.Size(132, 22);
|
||||
this.invertToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
|
||||
this.invertToolStripMenuItem.Text = "Invert";
|
||||
this.invertToolStripMenuItem.Click += new System.EventHandler(this.btnInvert_Click);
|
||||
//
|
||||
// mirrorXToolStripMenuItem
|
||||
//
|
||||
this.mirrorXToolStripMenuItem.Name = "mirrorXToolStripMenuItem";
|
||||
this.mirrorXToolStripMenuItem.Size = new System.Drawing.Size(132, 22);
|
||||
this.mirrorXToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
|
||||
this.mirrorXToolStripMenuItem.Text = "Mirror X";
|
||||
this.mirrorXToolStripMenuItem.Click += new System.EventHandler(this.btnMirrorX_Click);
|
||||
//
|
||||
// mirrorYToolStripMenuItem
|
||||
//
|
||||
this.mirrorYToolStripMenuItem.Name = "mirrorYToolStripMenuItem";
|
||||
this.mirrorYToolStripMenuItem.Size = new System.Drawing.Size(132, 22);
|
||||
this.mirrorYToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
|
||||
this.mirrorYToolStripMenuItem.Text = "Mirror Y";
|
||||
this.mirrorYToolStripMenuItem.Click += new System.EventHandler(this.btnMirrorY_Click);
|
||||
//
|
||||
@@ -532,6 +545,20 @@
|
||||
this.dlgOpen.DefaultExt = "mbf";
|
||||
this.dlgOpen.Filter = "McBitFont files|*.mbf|All files|*.*";
|
||||
//
|
||||
// applyToolStripMenuItem
|
||||
//
|
||||
this.applyToolStripMenuItem.Name = "applyToolStripMenuItem";
|
||||
this.applyToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
|
||||
this.applyToolStripMenuItem.Text = "Apply";
|
||||
this.applyToolStripMenuItem.Click += new System.EventHandler(this.button2_Click);
|
||||
//
|
||||
// exportToolStripMenuItem
|
||||
//
|
||||
this.exportToolStripMenuItem.Name = "exportToolStripMenuItem";
|
||||
this.exportToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
|
||||
this.exportToolStripMenuItem.Text = "Export";
|
||||
this.exportToolStripMenuItem.Click += new System.EventHandler(this.button1_Click);
|
||||
//
|
||||
// MainForm
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
@@ -616,6 +643,8 @@
|
||||
private System.Windows.Forms.ToolStripMenuItem aboutToolStripMenuItem;
|
||||
private System.Windows.Forms.SaveFileDialog dlgSave;
|
||||
private System.Windows.Forms.OpenFileDialog dlgOpen;
|
||||
private System.Windows.Forms.ToolStripMenuItem applyToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem exportToolStripMenuItem;
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -48,6 +48,8 @@ namespace McBitFont {
|
||||
bool monospaced = false;
|
||||
bool modified = false;
|
||||
bool prjModified = false;
|
||||
public const string version = "1.0";
|
||||
public string prjName = "Untitled";
|
||||
|
||||
public MainForm() {
|
||||
InitializeComponent();
|
||||
@@ -75,6 +77,8 @@ namespace McBitFont {
|
||||
f = copyFrame(frames.Find(x => x.code == 0));
|
||||
|
||||
ListViewItem_SetSpacing(miniList, 50 + 2, 50 + 22);
|
||||
|
||||
this.Text = "McBitFont " + version + " - " + prjName;
|
||||
}
|
||||
|
||||
[DllImport("user32.dll")]
|
||||
@@ -488,6 +492,9 @@ namespace McBitFont {
|
||||
dotPanel.Refresh();
|
||||
miniList.Refresh();
|
||||
form.Dispose();
|
||||
|
||||
prjName = "Untitled";
|
||||
this.Text = "McBitFont " + version + " - " + prjName;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -522,6 +529,8 @@ namespace McBitFont {
|
||||
ms.Close();
|
||||
}
|
||||
prjModified = false;
|
||||
prjName = Path.GetFileNameWithoutExtension(dlgSave.FileName);
|
||||
this.Text = "McBitFont " + version + " - " + prjName;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -542,6 +551,7 @@ namespace McBitFont {
|
||||
fs.Close();
|
||||
}
|
||||
monospaced = sav.monospaced;
|
||||
lblType.Text = monospaced ? "Monospaced" : "Variable width / Single";
|
||||
frames = sav.frames;
|
||||
miniList.Items.Clear();
|
||||
ilMiniatures.Images.Clear();
|
||||
@@ -562,6 +572,9 @@ namespace McBitFont {
|
||||
miniList.Refresh();
|
||||
modified = false;
|
||||
prjModified = false;
|
||||
|
||||
prjName = Path.GetFileNameWithoutExtension(dlgOpen.FileName);
|
||||
this.Text = "McBitFont " + version + " - " + prjName;
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -83,6 +83,7 @@
|
||||
<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>
|
||||
@@ -97,5 +98,32 @@
|
||||
<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>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
</Project>
|
4
McBitFont/New.Designer.cs
generated
@@ -114,10 +114,10 @@
|
||||
this.rbMono.Checked = true;
|
||||
this.rbMono.Location = new System.Drawing.Point(30, 71);
|
||||
this.rbMono.Name = "rbMono";
|
||||
this.rbMono.Size = new System.Drawing.Size(81, 17);
|
||||
this.rbMono.Size = new System.Drawing.Size(87, 17);
|
||||
this.rbMono.TabIndex = 4;
|
||||
this.rbMono.TabStop = true;
|
||||
this.rbMono.Text = "Monospace";
|
||||
this.rbMono.Text = "Monospaced";
|
||||
this.rbMono.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// rbVar
|
||||
|
133
McBitFont/Properties/Resources.Designer.cs
generated
@@ -1,53 +1,54 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// Этот код создан программным средством.
|
||||
// Версия среды выполнения: 4.0.30319.42000
|
||||
// Этот код создан программой.
|
||||
// Исполняемая версия:4.0.30319.42000
|
||||
//
|
||||
// Изменения в этом файле могут привести к неправильному поведению и будут утрачены, если
|
||||
// код создан повторно.
|
||||
// Изменения в этом файле могут привести к неправильной работе и будут потеряны в случае
|
||||
// повторной генерации кода.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace McBitFont.Properties {
|
||||
|
||||
|
||||
using System;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Класс ресурсов со строгим типом для поиска локализованных строк и пр.
|
||||
/// Класс ресурса со строгой типизацией для поиска локализованных строк и т.д.
|
||||
/// </summary>
|
||||
// Этот класс был автоматически создан при помощи StronglyTypedResourceBuilder
|
||||
// класс с помощью таких средств, как ResGen или Visual Studio.
|
||||
// Для добавления или удаления члена измените файл .ResX, а затем перезапустите ResGen
|
||||
// с параметром /str или заново постройте свой VS-проект.
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
|
||||
// Этот класс создан автоматически классом StronglyTypedResourceBuilder
|
||||
// с помощью такого средства, как ResGen или Visual Studio.
|
||||
// Чтобы добавить или удалить член, измените файл .ResX и снова запустите ResGen
|
||||
// с параметром /str или перестройте свой проект VS.
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
internal class Resources {
|
||||
|
||||
|
||||
private static global::System.Resources.ResourceManager resourceMan;
|
||||
|
||||
|
||||
private static global::System.Globalization.CultureInfo resourceCulture;
|
||||
|
||||
|
||||
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||
internal Resources() {
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Возврат кэшированного экземпляра ResourceManager, используемого этим классом.
|
||||
/// Возвращает кэшированный экземпляр ResourceManager, использованный этим классом.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Resources.ResourceManager ResourceManager {
|
||||
get {
|
||||
if ((resourceMan == null)) {
|
||||
if (object.ReferenceEquals(resourceMan, null)) {
|
||||
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("McBitFont.Properties.Resources", typeof(Resources).Assembly);
|
||||
resourceMan = temp;
|
||||
}
|
||||
return resourceMan;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Переопределяет свойство CurrentUICulture текущего потока для всех
|
||||
/// подстановки ресурсов с помощью этого класса ресурсов со строгим типом.
|
||||
/// Перезаписывает свойство CurrentUICulture текущего потока для всех
|
||||
/// обращений к ресурсу с помощью этого класса ресурса со строгой типизацией.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Globalization.CultureInfo Culture {
|
||||
@@ -58,5 +59,95 @@ namespace McBitFont.Properties {
|
||||
resourceCulture = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Поиск локализованного ресурса типа System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
internal static System.Drawing.Bitmap action_add {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("action_add", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Поиск локализованного ресурса типа System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
internal static System.Drawing.Bitmap action_remove {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("action_remove", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Поиск локализованного ресурса типа System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
internal static System.Drawing.Bitmap arrow_back {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("arrow_back", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Поиск локализованного ресурса типа System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
internal static System.Drawing.Bitmap arrow_down {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("arrow_down", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Поиск локализованного ресурса типа System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
internal static System.Drawing.Bitmap arrow_next {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("arrow_next", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Поиск локализованного ресурса типа System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
internal static System.Drawing.Bitmap arrow_top {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("arrow_top", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Поиск локализованного ресурса типа System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
internal static System.Drawing.Bitmap file {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("file", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Поиск локализованного ресурса типа System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
internal static System.Drawing.Bitmap folder_open {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("folder_open", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Поиск локализованного ресурса типа System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
internal static System.Drawing.Bitmap save {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("save", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -46,7 +46,7 @@
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
@@ -60,6 +60,7 @@
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
@@ -68,9 +69,10 @@
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
@@ -85,9 +87,10 @@
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
@@ -109,9 +112,37 @@
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||
<data name="action_add" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\action_add.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="action_remove" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\action_remove.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="arrow_back" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\arrow_back.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="arrow_down" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\arrow_down.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="arrow_next" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\arrow_next.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="arrow_top" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\arrow_top.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="file" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\file.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="folder_open" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\folder_open.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="save" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\save.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
</root>
|
BIN
McBitFont/Resources/action_add.png
Normal file
After Width: | Height: | Size: 318 B |
BIN
McBitFont/Resources/action_remove.png
Normal file
After Width: | Height: | Size: 201 B |
BIN
McBitFont/Resources/arrow_back.png
Normal file
After Width: | Height: | Size: 422 B |
BIN
McBitFont/Resources/arrow_down.png
Normal file
After Width: | Height: | Size: 412 B |
BIN
McBitFont/Resources/arrow_next.png
Normal file
After Width: | Height: | Size: 420 B |
BIN
McBitFont/Resources/arrow_top.png
Normal file
After Width: | Height: | Size: 386 B |
BIN
McBitFont/Resources/file.png
Normal file
After Width: | Height: | Size: 263 B |
BIN
McBitFont/Resources/folder_open.png
Normal file
After Width: | Height: | Size: 389 B |
BIN
McBitFont/Resources/save.png
Normal file
After Width: | Height: | Size: 353 B |
BIN
icons/action_add.png
Normal file
After Width: | Height: | Size: 318 B |
BIN
icons/action_check.png
Normal file
After Width: | Height: | Size: 371 B |
BIN
icons/action_delete.png
Normal file
After Width: | Height: | Size: 388 B |
BIN
icons/action_remove.png
Normal file
After Width: | Height: | Size: 201 B |
BIN
icons/application.png
Normal file
After Width: | Height: | Size: 233 B |
BIN
icons/arrow_back.png
Normal file
After Width: | Height: | Size: 422 B |
BIN
icons/arrow_down.png
Normal file
After Width: | Height: | Size: 412 B |
BIN
icons/arrow_next.png
Normal file
After Width: | Height: | Size: 420 B |
BIN
icons/arrow_top.png
Normal file
After Width: | Height: | Size: 386 B |
BIN
icons/comments.png
Normal file
After Width: | Height: | Size: 279 B |
BIN
icons/download.png
Normal file
After Width: | Height: | Size: 3.1 KiB |
BIN
icons/file.png
Normal file
After Width: | Height: | Size: 263 B |
BIN
icons/folder.png
Normal file
After Width: | Height: | Size: 360 B |
BIN
icons/folder_files.png
Normal file
After Width: | Height: | Size: 407 B |
BIN
icons/folder_open.png
Normal file
After Width: | Height: | Size: 389 B |
BIN
icons/letter.png
Normal file
After Width: | Height: | Size: 330 B |
BIN
icons/letter_open.png
Normal file
After Width: | Height: | Size: 405 B |
BIN
icons/login.png
Normal file
After Width: | Height: | Size: 379 B |
BIN
icons/maximize.png
Normal file
After Width: | Height: | Size: 413 B |
BIN
icons/minimize.png
Normal file
After Width: | Height: | Size: 381 B |
BIN
icons/reply.png
Normal file
After Width: | Height: | Size: 382 B |
BIN
icons/rss.png
Normal file
After Width: | Height: | Size: 539 B |
BIN
icons/save.png
Normal file
After Width: | Height: | Size: 353 B |
BIN
icons/search.png
Normal file
After Width: | Height: | Size: 539 B |
BIN
icons/time.png
Normal file
After Width: | Height: | Size: 427 B |
BIN
icons/user.png
Normal file
After Width: | Height: | Size: 552 B |