22 Commits

Author SHA1 Message Date
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
Anton Mukhin
e0786bdb07 Codepage persists through saved projects now; Fixed Baseline draw 2023-05-17 09:42:57 +03:00
4fa818f35e More examples 2023-05-17 04:33:04 +03:00
11b268a350 Baseline support 2023-05-17 04:32:44 +03:00
703e8d91ef More keyboard shortcuts 2023-05-16 21:52:36 +03:00
de8aa295da Fixed open file procedure - minilist code leading zeroes 2023-05-16 21:38:30 +03:00
Anton Mukhin
232b543a35 Files re-arrange in the repo; Screenshots; Update readme.md 2023-05-16 09:58:17 +03:00
cc63ce349a More icons; About window; More Keyboard shortcuts 2023-05-15 21:27:17 +03:00
Anton Mukhin
793337cc5b Merge branch 'font-based-templates' 2023-05-15 16:27:20 +03:00
Anton Mukhin
c5f832b44a Copy and paste functionality.
V1.1
2023-05-15 16:26:56 +03:00
Anton Mukhin
024c7b76bd New fonts could be based on a selected font 2023-05-15 15:24:10 +03:00
Anton Mukhin
cc161169f1 Add icons 9x9 example 2023-05-12 16:28:12 +03:00
Anton Mukhin
0ba03444d1 Add/Remove symbols 2023-05-12 14:08:21 +03:00
Anton Mukhin
302977c3f4 Export is done (I think) 2023-05-12 10:59:35 +03:00
a89bbc59ed Merge branch 'rich-text-experiment' 2023-05-12 04:37:24 +03:00
691b87b842 WIP: working on text formats 2023-05-12 04:35:26 +03:00
Anton Mukhin
ceddd5f66f WIP: export text formats 2023-05-11 17:21:07 +03:00
Anton Mukhin
84561f1ac1 rich text box test 1 2023-05-11 14:00:37 +03:00
62 changed files with 1534 additions and 224 deletions

136
McBitFont/About.Designer.cs generated Normal file
View File

@@ -0,0 +1,136 @@
namespace McBitFont {
partial class About {
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing) {
if (disposing && (components != null)) {
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent() {
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(About));
this.lblVersion = new System.Windows.Forms.Label();
this.label1 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.pictureBox1 = new System.Windows.Forms.PictureBox();
this.linkLabel1 = new System.Windows.Forms.LinkLabel();
this.button1 = new System.Windows.Forms.Button();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
this.SuspendLayout();
//
// lblVersion
//
this.lblVersion.AutoSize = true;
this.lblVersion.Location = new System.Drawing.Point(12, 189);
this.lblVersion.Name = "lblVersion";
this.lblVersion.Size = new System.Drawing.Size(63, 13);
this.lblVersion.TabIndex = 0;
this.lblVersion.Text = "Version: 1.1";
//
// label1
//
this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 18F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
this.label1.Location = new System.Drawing.Point(0, 80);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(384, 35);
this.label1.TabIndex = 1;
this.label1.Text = "McBitFont";
this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// label2
//
this.label2.Font = new System.Drawing.Font("Microsoft Sans Serif", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
this.label2.Location = new System.Drawing.Point(0, 115);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(384, 25);
this.label2.TabIndex = 2;
this.label2.Text = "McFLY\'s Bit Font and Image Editor";
this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// pictureBox1
//
this.pictureBox1.Dock = System.Windows.Forms.DockStyle.Top;
this.pictureBox1.Image = global::McBitFont.Properties.Resources.icon_64;
this.pictureBox1.Location = new System.Drawing.Point(0, 0);
this.pictureBox1.Margin = new System.Windows.Forms.Padding(3, 10, 3, 3);
this.pictureBox1.Name = "pictureBox1";
this.pictureBox1.Size = new System.Drawing.Size(384, 75);
this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage;
this.pictureBox1.TabIndex = 3;
this.pictureBox1.TabStop = false;
//
// linkLabel1
//
this.linkLabel1.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
this.linkLabel1.LinkBehavior = System.Windows.Forms.LinkBehavior.HoverUnderline;
this.linkLabel1.Location = new System.Drawing.Point(0, 140);
this.linkLabel1.Name = "linkLabel1";
this.linkLabel1.Size = new System.Drawing.Size(384, 23);
this.linkLabel1.TabIndex = 4;
this.linkLabel1.Text = "mcfly@mcflyer.ru";
this.linkLabel1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
this.linkLabel1.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabel1_LinkClicked);
//
// button1
//
this.button1.DialogResult = System.Windows.Forms.DialogResult.OK;
this.button1.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
this.button1.Location = new System.Drawing.Point(146, 175);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(89, 27);
this.button1.TabIndex = 5;
this.button1.Text = "OK";
this.button1.UseVisualStyleBackColor = true;
//
// About
//
this.AcceptButton = this.button1;
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(384, 211);
this.Controls.Add(this.button1);
this.Controls.Add(this.linkLabel1);
this.Controls.Add(this.pictureBox1);
this.Controls.Add(this.label2);
this.Controls.Add(this.label1);
this.Controls.Add(this.lblVersion);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "About";
this.ShowInTaskbar = false;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "About";
this.Load += new System.EventHandler(this.About_Load);
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Label lblVersion;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.PictureBox pictureBox1;
private System.Windows.Forms.LinkLabel linkLabel1;
private System.Windows.Forms.Button button1;
}
}

25
McBitFont/About.cs Normal file
View File

@@ -0,0 +1,25 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace McBitFont {
public partial class About : Form {
public About() {
InitializeComponent();
}
private void About_Load(object sender, EventArgs e) {
lblVersion.Text = "Version: v" + MainForm.version;
}
private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) {
System.Diagnostics.Process.Start("mailto:mcfly@mcflyer.ru");
}
}
}

140
McBitFont/About.resx Normal file
View File

@@ -0,0 +1,140 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: 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">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<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">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<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" 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">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<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=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
AAABAAEAEBAAAAEAGABoAwAAFgAAACgAAAAQAAAAIAAAAAEAGAAAAAAAQAMAAAAAAAAAAAAAAAAAAAAA
AAA1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTXW1tbW1tbW
1tbW1tbW1tbW1tbW1tbW1tbW1tbW1tbW1tbW1tbW1tbW1tY1NTU1NTXW1tbW1tYAAAAAAADW1tbW1tbW
1tbW1tbW1tbW1tYAAAAAAADW1tbW1tY1NTU1NTXW1tbW1tYAAAAAAADW1tbW1tbW1tbW1tbW1tbW1tYA
AAAAAADW1tbW1tY1NTU1NTXW1tbW1tYAAAAAAADW1tbW1tbW1tbW1tbW1tbW1tYAAAAAAADW1tbW1tY1
NTU1NTXW1tbW1tYAAAAAAADW1tbW1tbW1tbW1tbW1tbW1tYAAAAAAADW1tbW1tY1NTU1NTXW1tbW1tYA
AAAAAADW1tbW1tbW1tbW1tbW1tbW1tYAAAAAAADW1tbW1tY1NTU1NTXW1tbW1tYAAAAAAADW1tbW1tYA
AAAAAADW1tbW1tYAAAAAAADW1tbW1tY1NTU1NTXW1tbW1tYAAAAAAADW1tbW1tYAAAAAAADW1tbW1tYA
AAAAAADW1tbW1tY1NTU1NTXW1tbW1tYAAAAAAADW1tYAAAAAAAAAAAAAAADW1tYAAAAAAADW1tbW1tY1
NTU1NTXW1tbW1tYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADW1tbW1tY1NTU1NTXW1tbW1tYA
AAAAAAAAAAAAAADW1tbW1tYAAAAAAAAAAAAAAADW1tbW1tY1NTU1NTXW1tbW1tYAAAAAAAAAAADW1tbW
1tbW1tbW1tYAAAAAAAAAAADW1tbW1tY1NTU1NTXW1tbW1tYAAAAAAADW1tbW1tbW1tbW1tbW1tbW1tYA
AAAAAADW1tbW1tY1NTU1NTXW1tbW1tbW1tbW1tbW1tbW1tbW1tbW1tbW1tbW1tbW1tbW1tbW1tbW1tY1
NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTU1NTUAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
</value>
</data>
</root>

View File

@@ -37,8 +37,8 @@
this.cbNumSize = new System.Windows.Forms.ComboBox();
this.cbNumBase = new System.Windows.Forms.ComboBox();
this.gbText = new System.Windows.Forms.GroupBox();
this.label1 = new System.Windows.Forms.Label();
this.numericUpDown1 = new System.Windows.Forms.NumericUpDown();
this.lblXLines = new System.Windows.Forms.Label();
this.nudXLines = new System.Windows.Forms.NumericUpDown();
this.cbLines = new System.Windows.Forms.ComboBox();
this.cbFormat = new System.Windows.Forms.ComboBox();
this.btnGenerate = new System.Windows.Forms.Button();
@@ -47,7 +47,7 @@
this.gbOptions.SuspendLayout();
this.gbNumbers.SuspendLayout();
this.gbText.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.numericUpDown1)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.nudXLines)).BeginInit();
this.SuspendLayout();
//
// txtOutput
@@ -65,6 +65,7 @@
this.txtOutput.Size = new System.Drawing.Size(529, 507);
this.txtOutput.TabIndex = 0;
this.txtOutput.Text = "";
this.txtOutput.WordWrap = false;
//
// gbScan
//
@@ -216,8 +217,8 @@
//
// gbText
//
this.gbText.Controls.Add(this.label1);
this.gbText.Controls.Add(this.numericUpDown1);
this.gbText.Controls.Add(this.lblXLines);
this.gbText.Controls.Add(this.nudXLines);
this.gbText.Controls.Add(this.cbLines);
this.gbText.Controls.Add(this.cbFormat);
this.gbText.Location = new System.Drawing.Point(5, 234);
@@ -227,34 +228,34 @@
this.gbText.TabStop = false;
this.gbText.Text = "Text format";
//
// label1
// lblXLines
//
this.label1.AutoSize = true;
this.label1.Enabled = false;
this.label1.Location = new System.Drawing.Point(10, 76);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(60, 13);
this.label1.TabIndex = 9;
this.label1.Text = "X numbers:";
this.lblXLines.AutoSize = true;
this.lblXLines.Enabled = false;
this.lblXLines.Location = new System.Drawing.Point(10, 76);
this.lblXLines.Name = "lblXLines";
this.lblXLines.Size = new System.Drawing.Size(60, 13);
this.lblXLines.TabIndex = 9;
this.lblXLines.Text = "X numbers:";
//
// numericUpDown1
// nudXLines
//
this.numericUpDown1.Enabled = false;
this.numericUpDown1.Location = new System.Drawing.Point(76, 73);
this.numericUpDown1.Maximum = new decimal(new int[] {
this.nudXLines.Enabled = false;
this.nudXLines.Location = new System.Drawing.Point(76, 73);
this.nudXLines.Maximum = new decimal(new int[] {
64,
0,
0,
0});
this.numericUpDown1.Minimum = new decimal(new int[] {
this.nudXLines.Minimum = new decimal(new int[] {
1,
0,
0,
0});
this.numericUpDown1.Name = "numericUpDown1";
this.numericUpDown1.Size = new System.Drawing.Size(55, 20);
this.numericUpDown1.TabIndex = 8;
this.numericUpDown1.Value = new decimal(new int[] {
this.nudXLines.Name = "nudXLines";
this.nudXLines.Size = new System.Drawing.Size(55, 20);
this.nudXLines.TabIndex = 8;
this.nudXLines.Value = new decimal(new int[] {
8,
0,
0,
@@ -272,6 +273,7 @@
this.cbLines.Name = "cbLines";
this.cbLines.Size = new System.Drawing.Size(121, 21);
this.cbLines.TabIndex = 7;
this.cbLines.SelectedIndexChanged += new System.EventHandler(this.cbLines_SelectedIndexChanged);
//
// cbFormat
//
@@ -333,7 +335,7 @@
this.gbNumbers.ResumeLayout(false);
this.gbText.ResumeLayout(false);
this.gbText.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.numericUpDown1)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.nudXLines)).EndInit();
this.ResumeLayout(false);
}
@@ -353,8 +355,8 @@
private System.Windows.Forms.ComboBox cbNumSize;
private System.Windows.Forms.ComboBox cbNumBase;
private System.Windows.Forms.GroupBox gbText;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.NumericUpDown numericUpDown1;
private System.Windows.Forms.Label lblXLines;
private System.Windows.Forms.NumericUpDown nudXLines;
private System.Windows.Forms.ComboBox cbLines;
private System.Windows.Forms.ComboBox cbFormat;
private System.Windows.Forms.Button btnGenerate;

View File

@@ -8,6 +8,7 @@ using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Xml.Linq;
namespace McBitFont {
public partial class Export : Form {
@@ -73,84 +74,40 @@ namespace McBitFont {
}
}
void ParseLine(string line) {
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("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.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.
for (int i = 0; i < keywords.Length; i++) {
if (keywords[i] == token) {
// Apply alternative color and font to highlight keyword.
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;
}
}
txtOutput.SelectedText = token;
}
txtOutput.SelectedText = "\n";
}
void ParseText() {
foreach (string l in txtOutput.Lines) {
ParseLine(l);
}
}
private void btnGenerate_Click(object sender, EventArgs e) {
//string output = "";
string output = "";
txtOutput.Clear();
bool com = cbComments.Checked;
bool hdr = cbHeader.Checked;
int lines = cbLines.SelectedIndex;
int format = cbFormat.SelectedIndex;
bool mono = mainForm.monospaced;
int lineslim = (int)nudXLines.Value;
int fcount = mainForm.frames.Count;
int imin, jmin, imax, jmax, idir, jdir;
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");
output += comments["header"];
output += comments["scan_order"] + cbOrder.Text + "\n";
output += comments["scan_hdir"] + cbHDir.Text + "\n";
output += 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");
output += comments["num_bit_order"] + cbBitOrder.Text + "\n";
output += comments["num_base"] + cbNumBase.Text + "\n";
output += comments["num_size"] + cbNumSize.Text + "\n\n";
txtOutput.AppendText(comments["text_format"] + cbFormat.Text + "\n");
txtOutput.AppendText(comments["text_lines"] + cbLines.Text + "\n\n");
output += comments["text_format"] + cbFormat.Text + "\n";
output += comments["text_lines"] + cbLines.Text + "\n\n";
if (hdr) {
// comment about meta header map
txtOutput.AppendText(comments["font_header_map"] + "\n\n");
output += comments["font_header_map"] + "\n\n";
}
}
int imin, jmin, imax, jmax, idir, jdir;
//Figure out mins and maxes
if (cbOrder.SelectedIndex == 0) {
if (cbHDir.SelectedIndex == 0) {
// Columns; Left to right
@@ -175,28 +132,28 @@ namespace McBitFont {
jdir = -1;
}
} else {
if (cbHDir.SelectedIndex == 0) {
// Rows; Left to right
jmin = 0;
jmax = mainForm.dotHeight;
jdir = 1;
} else {
// Rows; Right to left
jmin = mainForm.dotHeight - 1;
jmax = -1;
jdir = -1;
}
if (cbVDir.SelectedIndex == 0) {
// Rows; Top to bottom
// Rows; Left to right
imin = 0;
imax = mainForm.dotWidth;
imax = mainForm.dotHeight;
idir = 1;
} else {
// Rows; Bottom to top
imin = mainForm.dotWidth - 1;
// Rows; Right to left
imin = mainForm.dotHeight - 1;
imax = -1;
idir = -1;
}
if (cbHDir.SelectedIndex == 0) {
// Rows; Top to bottom
jmin = 0;
jmax = mainForm.dotWidth;
jdir = 1;
} else {
// Rows; Bottom to top
jmin = mainForm.dotWidth - 1;
jmax = -1;
jdir = -1;
}
}
@@ -239,23 +196,105 @@ namespace McBitFont {
break;
}
//Array definition
txtOutput.AppendText("const " + dataType + " " + mainForm.prjName + "[] = {\n");
// Array definition
if ( format == 0 || format == 1 ) output += "const " + dataType + " " + mainForm.prjName + "[]" + (format==1?"[]":"") + " = {\n";
if (com) txtOutput.AppendText(" // Data:\n");
// Should we add the meta header?
if (hdr) {
output +=
" // Meta header\n" +
" " + (mono ? mainForm.frames.First().width.ToString() : "0") + ", // Font width in pixels; 0 - variable width\n" +
" " + mainForm.frames.First().height.ToString() + ", // Font height in pixels\n" +
" 0, // Font space (between symbols) in pixels\n" +
" " + mainForm.frames.First().code.ToString() + ", // First character code\n" +
" " + mainForm.frames.Last().code.ToString() + ", // Last character code\n"
;
}
// Brackets for 2D array definition
string obracket = format == 1 ? "{ " : "";
string cbracket = format == 1 ? " }" : "";
// Number output counter
int numcount = 0;
if (com) output += " // Data:\n";
MainForm.FrameMiniature flast = mainForm.frames.Last();
foreach ( MainForm.FrameMiniature f in mainForm.frames) {
// For each frame
string str;
uint b = 0;
uint b = 0; // current number bits
int t, x, y; // t - calculated bit number; x - actual x; y - actual y
if (com && lines != 1) {
if (com && lines != 1 && fcount > 1) {
// Comments enabled and other than "1 symbol per line" selected
// Print a symbol comment before its data
txtOutput.AppendText(" // " + f.code.ToString() + " --> \n");
output += " // " + f.code.ToString() + " --> " + mainForm.decodeSymbol(f.code) + "\n";
}
if (lines == 1) {
// "1 symbol per line" - new line offset
output += " ";
numcount = 0;
}
if (!mono && fcount > 1) {
// Not a single image; Variable width font - lets post the width as a 1st number
// Should we post a prefix to the number?
pref = (!cbZeroes.Checked && ((f.width < 10 && nbase == 16) || (f.width < 2 && nbase == 2))) ? "" : prefix;
output += (lines != 1 ? " " : "") + pref + Convert.ToString(f.width, nbase).PadLeft(pad, '0') + (lines != 0 ? (lines == 1 ? ", " : "") : ",\n");
// Count posted numbers
numcount++;
if (lines != 2) numcount = 0;
if (lines == 2 && numcount >= lineslim) {
numcount = 0;
output += "\n ";
}
}
if (lines == 2 && numcount == 0) {
// "X numbers per line" - first line of a symbol offset
output += " ";
}
//Figure out mins and maxes for variable width fonts
if (!mono && fcount > 1) {
if (cbOrder.SelectedIndex == 0) {
if (cbHDir.SelectedIndex == 0) {
// Columns; Left to right
imax = f.width;
} else {
// Columns; Right to left
imin = f.width - 1;
}
if (cbVDir.SelectedIndex == 0) {
// Columns; Top to bottom
jmax = f.height;
} else {
// Columns; Bottom to top
jmin = f.height - 1;
}
} else {
if (cbVDir.SelectedIndex == 0) {
// Rows; Left to right
imax = f.height;
} else {
// Rows; Right to left
imin = f.height - 1;
}
if (cbHDir.SelectedIndex == 0) {
// Rows; Top to bottom
jmax = f.width;
} else {
// Rows; Bottom to top
jmin = f.width - 1;
}
}
}
for (int i = imin; i != imax; i += idir) {
str = " ";
if (lines == 0) {
// "Column/Row per line" - new line offset
output += " " + obracket;
numcount = 0;
}
for (int j = jmin; j != jmax; j += jdir) {
if (jdir < 0) t = jmin - j;
else t = j;
@@ -278,21 +317,49 @@ namespace McBitFont {
}
if (((t + 1) % bits == 0) || j + jdir == jmax) {
if (str.Length > 2) str += " ";
// we have filled a number with bits - let's post it
// should we post a comma before the number?
output += numcount == 0 ? "" : ", ";
// should we post a prefix to the number?
pref = (!cbZeroes.Checked && ((b < 10 && nbase == 16) || (b < 2 && nbase == 2))) ? "" : prefix;
str += pref + Convert.ToString(b, nbase).PadLeft(pad, '0') + ',';
output += pref + Convert.ToString(b, nbase).PadLeft(pad, '0');
// count posted numbers
numcount++;
if (lines == 2 && numcount >= lineslim && !(j + jdir == jmax && i + idir == imax)) {
// "X numbers per line" - line break
numcount = 0;
output += ",\n ";
}
}
}
txtOutput.AppendText(str);
txtOutput.AppendText(Environment.NewLine);
if (lines == 0) {
// "Column/Row per line" - closing line
output += cbracket + ((i+idir==imax) && f.Equals(flast) ? "" : ",") + "\n";
}
}
if (lines == 1) {
// "1 symbol per line" - closing line
if (!f.Equals(flast)) output += ",";
if (com && fcount > 1) {
//...with a comment
output += " // " + f.code.ToString() + " --> " + mainForm.decodeSymbol(f.code);
}
output += "\n";
}
if (lines == 2) {
// "X numbers per line" - closing line
if (!f.Equals(flast)) output += ",";
output += "\n";
numcount = 0;
}
txtOutput.AppendText(Environment.NewLine);
}
// Close array definition
txtOutput.AppendText("};\n");
output += "};\n";
txtOutput.SelectAll();
ParseText();
txtOutput.Text = output;
txtOutput.SelectionStart = 0;
txtOutput.ScrollToCaret();
}
@@ -302,6 +369,26 @@ namespace McBitFont {
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;
}
if (!mainForm.monospaced && cbFormat.SelectedIndex == 1 && mainForm.frames.Count > 1) {
MessageBox.Show("Cannot pack the variable width font into 2D array!\n(Setting array format to 1D array)", "2D arrays are for monospaced fonts only!", MessageBoxButtons.OK, MessageBoxIcon.Information);
cbFormat.SelectedIndex = 0;
}
if (cbFormat.SelectedIndex == 1) {
cbLines.SelectedIndex = 0;
cbLines.Enabled = false;
} else {
cbLines.Enabled = true;
}
}
private void cbLines_SelectedIndexChanged(object sender, EventArgs e) {
if (cbLines.SelectedIndex == 2) {
nudXLines.Enabled = true;
lblXLines.Enabled = true;
} else {
nudXLines.Enabled = false;
lblXLines.Enabled = false;
}
}
}
}

View File

@@ -55,8 +55,12 @@
this.saveToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.exitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.editToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.addSymbolToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.copyToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.pasteToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.prependSymbolToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.appendSymbolToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.removeSymbolToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.applyToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.shiftUpToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.shiftDownToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
@@ -65,11 +69,11 @@
this.invertToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.mirrorXToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.mirrorYToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.exportToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
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();
this.btnBaseline = new System.Windows.Forms.Button();
((System.ComponentModel.ISupportInitialize)(this.nudX)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.nudY)).BeginInit();
this.panel1.SuspendLayout();
@@ -119,7 +123,7 @@
// nudY
//
this.nudY.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.nudY.Location = new System.Drawing.Point(717, 53);
this.nudY.Location = new System.Drawing.Point(717, 49);
this.nudY.Maximum = new decimal(new int[] {
255,
0,
@@ -154,7 +158,7 @@
//
this.label2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(670, 55);
this.label2.Location = new System.Drawing.Point(670, 51);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(41, 13);
this.label2.TabIndex = 4;
@@ -199,7 +203,7 @@
//
this.label4.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.label4.AutoSize = true;
this.label4.Location = new System.Drawing.Point(602, 29);
this.label4.Location = new System.Drawing.Point(604, 29);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(62, 13);
this.label4.TabIndex = 7;
@@ -301,7 +305,7 @@
// btnExport
//
this.btnExport.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.btnExport.Location = new System.Drawing.Point(696, 99);
this.btnExport.Location = new System.Drawing.Point(696, 109);
this.btnExport.Name = "btnExport";
this.btnExport.Size = new System.Drawing.Size(75, 23);
this.btnExport.TabIndex = 10;
@@ -324,6 +328,7 @@
this.miniList.ShowGroups = false;
this.miniList.Size = new System.Drawing.Size(343, 395);
this.miniList.SmallImageList = this.ilMiniatures;
this.miniList.Sorting = System.Windows.Forms.SortOrder.Ascending;
this.miniList.TabIndex = 12;
this.miniList.TabStop = false;
this.miniList.TileSize = new System.Drawing.Size(50, 50);
@@ -339,7 +344,7 @@
// btnApply
//
this.btnApply.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.btnApply.Location = new System.Drawing.Point(589, 99);
this.btnApply.Location = new System.Drawing.Point(615, 109);
this.btnApply.Name = "btnApply";
this.btnApply.Size = new System.Drawing.Size(75, 23);
this.btnApply.TabIndex = 13;
@@ -372,7 +377,7 @@
//
this.label5.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.label5.AutoSize = true;
this.label5.Location = new System.Drawing.Point(640, 71);
this.label5.Location = new System.Drawing.Point(554, 114);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(24, 13);
this.label5.TabIndex = 16;
@@ -407,7 +412,9 @@
//
this.newToolStripMenuItem.Image = global::McBitFont.Properties.Resources.file;
this.newToolStripMenuItem.Name = "newToolStripMenuItem";
this.newToolStripMenuItem.Size = new System.Drawing.Size(112, 22);
this.newToolStripMenuItem.ShortcutKeyDisplayString = "Ctrl+N";
this.newToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.N)));
this.newToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
this.newToolStripMenuItem.Text = "New";
this.newToolStripMenuItem.Click += new System.EventHandler(this.newToolStripMenuItem_Click);
//
@@ -415,50 +422,109 @@
//
this.openToolStripMenuItem.Image = global::McBitFont.Properties.Resources.folder_open;
this.openToolStripMenuItem.Name = "openToolStripMenuItem";
this.openToolStripMenuItem.Size = new System.Drawing.Size(112, 22);
this.openToolStripMenuItem.ShortcutKeyDisplayString = "Ctrl+O";
this.openToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.O)));
this.openToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
this.openToolStripMenuItem.Text = "Open";
this.openToolStripMenuItem.Click += new System.EventHandler(this.openToolStripMenuItem_Click);
//
// saveToolStripMenuItem
//
this.saveToolStripMenuItem.Image = global::McBitFont.Properties.Resources.save;
this.saveToolStripMenuItem.Image = global::McBitFont.Properties.Resources.Famfamfam_Silk_Disk_16;
this.saveToolStripMenuItem.Name = "saveToolStripMenuItem";
this.saveToolStripMenuItem.Size = new System.Drawing.Size(112, 22);
this.saveToolStripMenuItem.ShortcutKeyDisplayString = "Ctrl+S";
this.saveToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.S)));
this.saveToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
this.saveToolStripMenuItem.Text = "Save as";
this.saveToolStripMenuItem.Click += new System.EventHandler(this.saveToolStripMenuItem_Click);
//
// exitToolStripMenuItem
//
this.exitToolStripMenuItem.Image = global::McBitFont.Properties.Resources.Famfamfam_Silk_Door_out_16;
this.exitToolStripMenuItem.Name = "exitToolStripMenuItem";
this.exitToolStripMenuItem.Size = new System.Drawing.Size(112, 22);
this.exitToolStripMenuItem.ShortcutKeyDisplayString = "Alt+X";
this.exitToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Alt | System.Windows.Forms.Keys.X)));
this.exitToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
this.exitToolStripMenuItem.Text = "Exit";
this.exitToolStripMenuItem.Click += new System.EventHandler(this.exitToolStripMenuItem_Click);
//
// editToolStripMenuItem
//
this.editToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.addSymbolToolStripMenuItem,
this.copyToolStripMenuItem,
this.pasteToolStripMenuItem,
this.prependSymbolToolStripMenuItem,
this.appendSymbolToolStripMenuItem,
this.removeSymbolToolStripMenuItem,
this.applyToolStripMenuItem});
this.editToolStripMenuItem.Name = "editToolStripMenuItem";
this.editToolStripMenuItem.Size = new System.Drawing.Size(39, 20);
this.editToolStripMenuItem.Text = "Edit";
//
// addSymbolToolStripMenuItem
// copyToolStripMenuItem
//
this.addSymbolToolStripMenuItem.Enabled = false;
this.addSymbolToolStripMenuItem.Image = global::McBitFont.Properties.Resources.action_add;
this.addSymbolToolStripMenuItem.Name = "addSymbolToolStripMenuItem";
this.addSymbolToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
this.addSymbolToolStripMenuItem.Text = "Add symbol";
this.copyToolStripMenuItem.Enabled = false;
this.copyToolStripMenuItem.Image = global::McBitFont.Properties.Resources.Famfamfam_Silk_Page_copy_16;
this.copyToolStripMenuItem.Name = "copyToolStripMenuItem";
this.copyToolStripMenuItem.ShortcutKeyDisplayString = "Ctrl+C";
this.copyToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.C)));
this.copyToolStripMenuItem.Size = new System.Drawing.Size(212, 22);
this.copyToolStripMenuItem.Text = "Copy";
this.copyToolStripMenuItem.Click += new System.EventHandler(this.copyToolStripMenuItem_Click);
//
// pasteToolStripMenuItem
//
this.pasteToolStripMenuItem.Enabled = false;
this.pasteToolStripMenuItem.Image = global::McBitFont.Properties.Resources.Famfamfam_Silk_Page_paste_16;
this.pasteToolStripMenuItem.Name = "pasteToolStripMenuItem";
this.pasteToolStripMenuItem.ShortcutKeyDisplayString = "Ctrl+V";
this.pasteToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.V)));
this.pasteToolStripMenuItem.Size = new System.Drawing.Size(212, 22);
this.pasteToolStripMenuItem.Text = "Paste";
this.pasteToolStripMenuItem.Click += new System.EventHandler(this.pasteToolStripMenuItem_Click);
//
// prependSymbolToolStripMenuItem
//
this.prependSymbolToolStripMenuItem.Enabled = false;
this.prependSymbolToolStripMenuItem.Image = global::McBitFont.Properties.Resources.action_add;
this.prependSymbolToolStripMenuItem.Name = "prependSymbolToolStripMenuItem";
this.prependSymbolToolStripMenuItem.ShortcutKeyDisplayString = "Ctrl+Ins";
this.prependSymbolToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Insert)));
this.prependSymbolToolStripMenuItem.Size = new System.Drawing.Size(212, 22);
this.prependSymbolToolStripMenuItem.Text = "Prepend symbol";
this.prependSymbolToolStripMenuItem.Click += new System.EventHandler(this.prependSymbolToolStripMenuItem_Click);
//
// appendSymbolToolStripMenuItem
//
this.appendSymbolToolStripMenuItem.Enabled = false;
this.appendSymbolToolStripMenuItem.Image = global::McBitFont.Properties.Resources.action_add;
this.appendSymbolToolStripMenuItem.Name = "appendSymbolToolStripMenuItem";
this.appendSymbolToolStripMenuItem.ShortcutKeyDisplayString = "Ctrl+End";
this.appendSymbolToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.End)));
this.appendSymbolToolStripMenuItem.Size = new System.Drawing.Size(212, 22);
this.appendSymbolToolStripMenuItem.Text = "Append symbol";
this.appendSymbolToolStripMenuItem.Click += new System.EventHandler(this.prependSymbolToolStripMenuItem_Click);
//
// 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(180, 22);
this.removeSymbolToolStripMenuItem.ShortcutKeyDisplayString = "Ctrl+Del";
this.removeSymbolToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Delete)));
this.removeSymbolToolStripMenuItem.Size = new System.Drawing.Size(212, 22);
this.removeSymbolToolStripMenuItem.Text = "Remove symbol";
this.removeSymbolToolStripMenuItem.Click += new System.EventHandler(this.removeSymbolToolStripMenuItem_Click);
//
// applyToolStripMenuItem
//
this.applyToolStripMenuItem.Image = global::McBitFont.Properties.Resources.action_check;
this.applyToolStripMenuItem.Name = "applyToolStripMenuItem";
this.applyToolStripMenuItem.ShortcutKeyDisplayString = "Ctrl+Space";
this.applyToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Space)));
this.applyToolStripMenuItem.Size = new System.Drawing.Size(212, 22);
this.applyToolStripMenuItem.Text = "Apply";
this.applyToolStripMenuItem.Click += new System.EventHandler(this.button2_Click);
//
// toolsToolStripMenuItem
//
@@ -479,7 +545,9 @@
//
this.shiftUpToolStripMenuItem.Image = global::McBitFont.Properties.Resources.arrow_top;
this.shiftUpToolStripMenuItem.Name = "shiftUpToolStripMenuItem";
this.shiftUpToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
this.shiftUpToolStripMenuItem.ShortcutKeyDisplayString = "Ctrl+Up";
this.shiftUpToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Up)));
this.shiftUpToolStripMenuItem.Size = new System.Drawing.Size(197, 22);
this.shiftUpToolStripMenuItem.Text = "Shift Up";
this.shiftUpToolStripMenuItem.Click += new System.EventHandler(this.btnShiftUp_Click);
//
@@ -487,7 +555,9 @@
//
this.shiftDownToolStripMenuItem.Image = global::McBitFont.Properties.Resources.arrow_down;
this.shiftDownToolStripMenuItem.Name = "shiftDownToolStripMenuItem";
this.shiftDownToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
this.shiftDownToolStripMenuItem.ShortcutKeyDisplayString = "Ctrl+Down";
this.shiftDownToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Down)));
this.shiftDownToolStripMenuItem.Size = new System.Drawing.Size(197, 22);
this.shiftDownToolStripMenuItem.Text = "Shift Down";
this.shiftDownToolStripMenuItem.Click += new System.EventHandler(this.btnShiftDown_Click);
//
@@ -495,7 +565,9 @@
//
this.shiftLeftToolStripMenuItem.Image = global::McBitFont.Properties.Resources.arrow_back;
this.shiftLeftToolStripMenuItem.Name = "shiftLeftToolStripMenuItem";
this.shiftLeftToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
this.shiftLeftToolStripMenuItem.ShortcutKeyDisplayString = "Ctrl+Left";
this.shiftLeftToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Left)));
this.shiftLeftToolStripMenuItem.Size = new System.Drawing.Size(197, 22);
this.shiftLeftToolStripMenuItem.Text = "Shift left";
this.shiftLeftToolStripMenuItem.Click += new System.EventHandler(this.btnShiftLeft_Click);
//
@@ -503,37 +575,57 @@
//
this.shiftRightToolStripMenuItem.Image = global::McBitFont.Properties.Resources.arrow_next;
this.shiftRightToolStripMenuItem.Name = "shiftRightToolStripMenuItem";
this.shiftRightToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
this.shiftRightToolStripMenuItem.ShortcutKeyDisplayString = "Ctrl+Right";
this.shiftRightToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Right)));
this.shiftRightToolStripMenuItem.Size = new System.Drawing.Size(197, 22);
this.shiftRightToolStripMenuItem.Text = "Shift Right";
this.shiftRightToolStripMenuItem.Click += new System.EventHandler(this.btnShiftRight_Click);
//
// invertToolStripMenuItem
//
this.invertToolStripMenuItem.Image = global::McBitFont.Properties.Resources.Ionic_Ionicons_Invert_mode_outline_16;
this.invertToolStripMenuItem.Name = "invertToolStripMenuItem";
this.invertToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
this.invertToolStripMenuItem.ShortcutKeyDisplayString = "Ctrl+I";
this.invertToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.I)));
this.invertToolStripMenuItem.Size = new System.Drawing.Size(197, 22);
this.invertToolStripMenuItem.Text = "Invert";
this.invertToolStripMenuItem.Click += new System.EventHandler(this.btnInvert_Click);
//
// mirrorXToolStripMenuItem
//
this.mirrorXToolStripMenuItem.Image = global::McBitFont.Properties.Resources.Famfamfam_Silk_Shape_flip_horizontal_16;
this.mirrorXToolStripMenuItem.Name = "mirrorXToolStripMenuItem";
this.mirrorXToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
this.mirrorXToolStripMenuItem.ShortcutKeyDisplayString = "Ctrl+X";
this.mirrorXToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.X)));
this.mirrorXToolStripMenuItem.Size = new System.Drawing.Size(197, 22);
this.mirrorXToolStripMenuItem.Text = "Mirror X";
this.mirrorXToolStripMenuItem.Click += new System.EventHandler(this.btnMirrorX_Click);
//
// mirrorYToolStripMenuItem
//
this.mirrorYToolStripMenuItem.Image = global::McBitFont.Properties.Resources.Famfamfam_Silk_Shape_flip_vertical_16;
this.mirrorYToolStripMenuItem.Name = "mirrorYToolStripMenuItem";
this.mirrorYToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
this.mirrorYToolStripMenuItem.ShortcutKeyDisplayString = "Ctrl+Y";
this.mirrorYToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Y)));
this.mirrorYToolStripMenuItem.Size = new System.Drawing.Size(197, 22);
this.mirrorYToolStripMenuItem.Text = "Mirror Y";
this.mirrorYToolStripMenuItem.Click += new System.EventHandler(this.btnMirrorY_Click);
//
// exportToolStripMenuItem
//
this.exportToolStripMenuItem.Name = "exportToolStripMenuItem";
this.exportToolStripMenuItem.ShortcutKeyDisplayString = "Ctrl+E";
this.exportToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.E)));
this.exportToolStripMenuItem.Size = new System.Drawing.Size(197, 22);
this.exportToolStripMenuItem.Text = "Export";
this.exportToolStripMenuItem.Click += new System.EventHandler(this.button1_Click);
//
// aboutToolStripMenuItem
//
this.aboutToolStripMenuItem.Enabled = false;
this.aboutToolStripMenuItem.Name = "aboutToolStripMenuItem";
this.aboutToolStripMenuItem.Size = new System.Drawing.Size(52, 20);
this.aboutToolStripMenuItem.Text = "About";
this.aboutToolStripMenuItem.Click += new System.EventHandler(this.aboutToolStripMenuItem_Click);
//
// dlgSave
//
@@ -545,25 +637,23 @@
this.dlgOpen.DefaultExt = "mbf";
this.dlgOpen.Filter = "McBitFont files|*.mbf|All files|*.*";
//
// applyToolStripMenuItem
// btnBaseline
//
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);
this.btnBaseline.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.btnBaseline.Location = new System.Drawing.Point(615, 80);
this.btnBaseline.Name = "btnBaseline";
this.btnBaseline.Size = new System.Drawing.Size(75, 23);
this.btnBaseline.TabIndex = 18;
this.btnBaseline.Text = "Baseline";
this.btnBaseline.UseVisualStyleBackColor = true;
this.btnBaseline.Click += new System.EventHandler(this.btnBaseline_Click);
//
// MainForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(784, 561);
this.Controls.Add(this.btnBaseline);
this.Controls.Add(this.btnApply);
this.Controls.Add(this.btnExport);
this.Controls.Add(this.label5);
@@ -630,7 +720,6 @@
private System.Windows.Forms.ToolStripMenuItem openToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem exitToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem editToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem addSymbolToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem removeSymbolToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem toolsToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem shiftUpToolStripMenuItem;
@@ -645,6 +734,11 @@
private System.Windows.Forms.OpenFileDialog dlgOpen;
private System.Windows.Forms.ToolStripMenuItem applyToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem exportToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem prependSymbolToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem appendSymbolToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem copyToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem pasteToolStripMenuItem;
private System.Windows.Forms.Button btnBaseline;
}
}

View File

@@ -14,6 +14,7 @@ using System.IO;
using System.Runtime.Serialization.Formatters.Binary;
using System.Runtime.InteropServices.ComTypes;
using System.Diagnostics;
using System.Drawing.Drawing2D;
namespace McBitFont {
public partial class MainForm : Form {
@@ -35,6 +36,8 @@ namespace McBitFont {
[Serializable]
public struct SaveBlock {
public bool monospaced;
public int codepage;
public int baseline;
public List<FrameMiniature> frames;
}
@@ -45,11 +48,16 @@ namespace McBitFont {
private int pixelOffset = 5;
private int gap;
private int w, h;
bool monospaced = false;
public bool monospaced = false;
bool modified = false;
bool prjModified = false;
public const string version = "1.0";
public const string version = "1.6";
public string prjName = "Untitled";
public int codepage = 1251;
private FrameMiniature fbuf;
private bool fbuffer = false;
public int baseline = 0;
public bool set_base = false;
public MainForm() {
InitializeComponent();
@@ -70,7 +78,7 @@ namespace McBitFont {
cbZoom.SelectedIndexChanged += cbZoom_SelectedIndexChanged;
frames.Add(new FrameMiniature(0, dotWidth, dotHeight));
miniList.Items.Add("0", "0 Single", "0");
miniList.Items.Add("000", "000 Single", "000");
miniList.Refresh();
miniList.Items[0].Selected = true;
miniList.Select();
@@ -79,6 +87,8 @@ namespace McBitFont {
ListViewItem_SetSpacing(miniList, 50 + 2, 50 + 22);
this.Text = "McBitFont " + version + " - " + prjName;
fbuf = new FrameMiniature(0, dotWidth, dotHeight);
}
[DllImport("user32.dll")]
@@ -131,11 +141,13 @@ 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;
}
} else {
if (nudX.Focused) modified = true;
}
prjModified = true;
dotResize((int)nudX.Value, dotHeight);
@@ -146,11 +158,12 @@ namespace McBitFont {
for (int i = 0; i < frames.Count; i++) {
frames[i] = frameResize(frames[i], dotWidth, (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);
}
@@ -202,6 +215,8 @@ namespace McBitFont {
w = pixelOffset + dotWidth * (cellSize + gap);
h = pixelOffset + dotHeight * (cellSize + gap);
cbZoom_SelectedIndexChanged(cbZoom, null);
fbuffer = false;
}
private void cbZoom_SelectedIndexChanged(object sender, EventArgs e) {
@@ -243,6 +258,7 @@ namespace McBitFont {
}
}
}
modified = true;
dotPanel.Refresh();
}
@@ -258,10 +274,32 @@ namespace McBitFont {
}
}
}
modified = true;
dotPanel.Refresh();
}
private void dotPanel_MouseMove(object sender, MouseEventArgs e) {
Rectangle rect1, rect2;
if (set_base) {
int yy = pixelOffset + baseline * (cellSize + gap) - vScroll.Value - 1;
rect1 = new Rectangle(pixelOffset, yy, w, 2);
baseline = (e.Y - pixelOffset + vScroll.Value) / (cellSize + gap);
if (baseline >= dotHeight) baseline = dotHeight - 1;
if (baseline < 0) baseline = 0;
yy = pixelOffset + baseline * (cellSize + gap) - vScroll.Value - 1;
rect2 = new Rectangle(pixelOffset, yy, w, 2);
dotPanel.Invalidate(rect1);
dotPanel.Invalidate(rect2);
if (e.Button == MouseButtons.Left) {
set_base = false;
return;
}
}
if (e.X >= w || e.X <= pixelOffset || e.Y >= h || e.Y <= pixelOffset) return;
int i = (e.X - pixelOffset + hScroll.Value) / (cellSize + gap);
int j = (e.Y - pixelOffset + vScroll.Value) / (cellSize + gap);
@@ -273,8 +311,9 @@ namespace McBitFont {
f.data[i, j] = true;
int x = pixelOffset + i * (cellSize + gap) - hScroll.Value;
int y = pixelOffset + j * (cellSize + gap) - vScroll.Value;
g.FillRectangle(sbb, x, y, cellSize, cellSize);
modified = true;
rect1 = new Rectangle(x, y, cellSize, cellSize);
dotPanel.Invalidate(rect1);
}
if (e.Button == MouseButtons.Right && f.data[i, j]) {
Graphics g = dotPanel.CreateGraphics();
@@ -282,8 +321,9 @@ namespace McBitFont {
f.data[i, j] = false;
int x = pixelOffset + i * (cellSize + gap) - hScroll.Value;
int y = pixelOffset + j * (cellSize + gap) - vScroll.Value;
g.FillRectangle(sbw, x, y, cellSize, cellSize);
modified = true;
rect1 = new Rectangle(x, y, cellSize, cellSize);
dotPanel.Invalidate(rect1);
}
}
@@ -300,6 +340,7 @@ namespace McBitFont {
}
}
}
modified = true;
dotPanel.Refresh();
}
@@ -315,6 +356,7 @@ namespace McBitFont {
}
}
}
modified = true;
dotPanel.Refresh();
}
@@ -324,6 +366,7 @@ namespace McBitFont {
f.data[i, j] = !f.data[i, j];
}
}
modified = true;
dotPanel.Refresh();
}
@@ -342,6 +385,7 @@ namespace McBitFont {
b--;
}
}
modified = true;
dotPanel.Refresh();
}
@@ -360,6 +404,7 @@ namespace McBitFont {
b--;
}
}
modified = true;
dotPanel.Refresh();
}
@@ -387,7 +432,7 @@ namespace McBitFont {
frames[index] = f;
var sizedBMP = getMiniPictue(f);
string s = f.code.ToString();
string s = f.code.ToString().PadLeft(3, '0');
ilMiniatures.Images.RemoveByKey(s);
ilMiniatures.Images.Add(s, (Image)sizedBMP);
sizedBMP.Dispose();
@@ -432,15 +477,54 @@ namespace McBitFont {
}
if (f.data[i, j]) sb = sbb;
else sb = sbw;
g.FillRectangle(sb, x, y, cellSize, cellSize);
g.FillRectangle(sb, x, (baseline == j ? y+1 : y), cellSize, (baseline == j ? cellSize-1 : cellSize));
}
}
if (baseline > 0 && gap > 0) {
x = pixelOffset - hScroll.Value;
y = pixelOffset + baseline * (cellSize + gap) - vScroll.Value;
g.DrawLine(
new Pen(Color.Blue, 2),
x, y,
w, y
);
}
}
private void exitToolStripMenuItem_Click(object sender, EventArgs e) {
Application.Exit();
}
public string decodeSymbol(int code) {
var enc = Encoding.GetEncoding(codepage);
if (code < 32) return "";
return enc.GetString(new byte[] { (byte)code });
}
private FrameMiniature fillFrame(FrameMiniature ff, Font font, int sx, int sy) {
string s = decodeSymbol(ff.code);
Bitmap bmp = new Bitmap(ff.width, ff.height);
Graphics g = Graphics.FromImage(bmp);
g.Clear(Color.White);
g.SmoothingMode = SmoothingMode.None;
g.InterpolationMode = InterpolationMode.NearestNeighbor;
g.PixelOffsetMode = PixelOffsetMode.Half;
g.TextRenderingHint = System.Drawing.Text.TextRenderingHint.SingleBitPerPixelGridFit;
g.DrawString(s, font, Brushes.Black, sx, sy);
g.Flush();
for (int i = 0; i < ff.width; i++)
for (int j = 0; j < ff.height; j++) {
if (bmp.GetPixel(i, j).Name != "ffffffff")
ff.data[i, j] = true;
}
bmp.Dispose();
g.Dispose();
return ff;
}
private void newToolStripMenuItem_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, MessageBoxIcon.Question) == DialogResult.Yes) {
@@ -448,7 +532,7 @@ namespace McBitFont {
return;
}
}
New form = new New();
New form = new New(this);
if (form.ShowDialog() == DialogResult.OK) {
frames.Clear();
miniList.Clear();
@@ -457,6 +541,9 @@ namespace McBitFont {
string append = "";
int neww = (int)form.nudNewX.Value;
int newh = (int)form.nudNewY.Value;
nudX.Value = neww;
nudY.Value = newh;
FrameMiniature newf;
if (form.cbSingle.Checked) {
frames.Add( new FrameMiniature(0, neww, newh));
//f = frames.Find(x => x.code == 0);
@@ -465,36 +552,49 @@ namespace McBitFont {
} else {
int i;
if (form.cbNotPrintable.Checked) {
for (i=0; i < 32; i++)
frames.Add(new FrameMiniature(i, neww, newh));
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);
}
}
if (form.cbLatin.Checked) {
for (i = 32; i < 128; i++)
frames.Add(new FrameMiniature(i, neww, newh));
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++)
frames.Add(new FrameMiniature(i, neww, newh));
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);
}
}
monospaced = form.rbMono.Checked;
}
lblType.Text = monospaced ? "Monospaced" : "Variable width / Single";
codepage = (form.cbEncoding.SelectedItem as New.EncodingItem).Code;
foreach (FrameMiniature ff in frames) {
var s = ff.code.ToString();
var s = ff.code.ToString().PadLeft(3, '0');
ilMiniatures.Images.Add(s, (Image)getMiniPictue(ff));
var enc = Encoding.GetEncoding((form.cbEncoding.SelectedItem as New.EncodingItem).Code);
var sss = enc.GetString(new byte[] { (byte)ff.code });
var sss = decodeSymbol(ff.code);
miniList.Items.Add(s, s+' '+append+sss, s);
}
nudX.Value =neww;
nudY.Value = newh;
f = copyFrame(frames.First());
dotPanel.Refresh();
miniList.Refresh();
form.Dispose();
baseline = 0;
prjName = "Untitled";
this.Text = "McBitFont " + version + " - " + prjName;
modified = false;
checkForAdd();
fbuffer = false;
dotPanel.Refresh();
}
}
@@ -507,7 +607,11 @@ namespace McBitFont {
modified = false;
}
if (miniList.SelectedItems.Count == 0) {
miniList.Items[0].Selected = true;
removeSymbolToolStripMenuItem.Enabled = false;
copyToolStripMenuItem.Enabled = false;
pasteToolStripMenuItem.Enabled = false;
return;
//miniList.Items[0].Selected = true;
}
var sel = miniList.SelectedItems[0];
int code = Convert.ToInt32(sel.ImageKey);
@@ -516,13 +620,29 @@ namespace McBitFont {
nudY.Value = ff.height;
f = ff;
dotPanel.Refresh();
ff = frames.Find(x => x.code == code);
if (frames.Count > 1 && (ff.Equals(frames.First()) || ff.Equals(frames.Last()))) {
removeSymbolToolStripMenuItem.Enabled = true;
} else {
removeSymbolToolStripMenuItem.Enabled = false;
}
copyToolStripMenuItem.Enabled = true;
if (fbuffer) pasteToolStripMenuItem.Enabled = true;
else pasteToolStripMenuItem.Enabled = false;
}
private void saveToolStripMenuItem_Click(object sender, EventArgs e) {
if (modified) {
if (MessageBox.Show("Current frame is modified.\nDo you want to apply the changes first?", "The frame was modified!", MessageBoxButtons.YesNo) == DialogResult.Yes) {
saveFrame();
}
}
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);
@@ -542,7 +662,6 @@ namespace McBitFont {
}
}
if (dlgOpen.ShowDialog() == DialogResult.OK) {
//MessageBox.Show(dlgOpen.FileName);
SaveBlock sav;
BinaryFormatter formatter = new BinaryFormatter();
@@ -551,14 +670,17 @@ namespace McBitFont {
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();
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 + ' ' + (char)ff.code, s);
miniList.Items.Add(s, s + ' ' + sss, s);
}
nudX.ValueChanged -= nudX_ValueChanged;
nudY.ValueChanged -= nudY_ValueChanged;
@@ -575,9 +697,74 @@ namespace McBitFont {
prjName = Path.GetFileNameWithoutExtension(dlgOpen.FileName);
this.Text = "McBitFont " + version + " - " + prjName;
checkForAdd();
fbuffer = false;
}
}
private void removeSymbolToolStripMenuItem_Click(object sender, EventArgs e) {
if (miniList.SelectedItems.Count == 0) {
removeSymbolToolStripMenuItem.Enabled = false;
return;
}
var sel = miniList.SelectedItems[0].ImageKey;
int code = Convert.ToInt32(miniList.SelectedItems[0].ImageKey);
FrameMiniature ff = frames.Find(x => x.code == code);
frames.Remove(ff);
miniList.SelectedItems[0].Remove();
//miniList.Items[0].Selected = true;
}
private void prependSymbolToolStripMenuItem_Click(object sender, EventArgs e) {
FrameMiniature ff;
if (sender == prependSymbolToolStripMenuItem) {
ff = new FrameMiniature(frames.First().code - 1, dotWidth, dotHeight);
frames.Insert(0, ff);
} else {
ff = new FrameMiniature(frames.Last().code + 1, dotWidth, dotHeight);
frames.Add(ff);
}
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 + ' ' + sss, s);
checkForAdd();
}
private void checkForAdd() {
if (frames.Count > 1) {
if (frames.First().code > 0) prependSymbolToolStripMenuItem.Enabled = true;
else prependSymbolToolStripMenuItem.Enabled = false;
if (frames.Last().code < 255) appendSymbolToolStripMenuItem.Enabled = true;
else appendSymbolToolStripMenuItem.Enabled = false;
} else {
prependSymbolToolStripMenuItem.Enabled = false;
appendSymbolToolStripMenuItem.Enabled = false;
}
}
private void copyToolStripMenuItem_Click(object sender, EventArgs e) {
fbuffer = true;
fbuf = copyFrame(f);
pasteToolStripMenuItem.Enabled = true;
}
private void pasteToolStripMenuItem_Click(object sender, EventArgs e) {
Array.Copy(fbuf.data, f.data, fbuf.data.Length);
dotPanel.Refresh();
modified = true;
}
private void aboutToolStripMenuItem_Click(object sender, EventArgs e) {
About form = new About();
form.ShowDialog();
}
private void btnBaseline_Click(object sender, EventArgs e) {
set_base = !set_base;
}
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) {

View File

@@ -12,6 +12,21 @@
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Deterministic>true</Deterministic>
<PublishUrl>publish\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
<UpdateEnabled>false</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateInterval>7</UpdateInterval>
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<IsWebBootstrapper>false</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
@@ -32,6 +47,9 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup>
<ApplicationIcon>icon_64.ico</ApplicationIcon>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
@@ -46,6 +64,12 @@
<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>
@@ -66,6 +90,9 @@
</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>
@@ -125,5 +152,57 @@
<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" />
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include=".NETFramework,Version=v4.7.2">
<Visible>False</Visible>
<ProductName>Microsoft .NET Framework 4.7.2 %28x86 и x64%29</ProductName>
<Install>true</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1</ProductName>
<Install>false</Install>
</BootstrapperPackage>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

View File

@@ -38,13 +38,37 @@
this.cbSingle = new System.Windows.Forms.CheckBox();
this.toolTip1 = new System.Windows.Forms.ToolTip(this.components);
this.cbEncoding = new System.Windows.Forms.ComboBox();
this.panel1 = new System.Windows.Forms.Panel();
this.pbChar2 = new System.Windows.Forms.PictureBox();
this.pbChar1 = new System.Windows.Forms.PictureBox();
this.btnFont = new System.Windows.Forms.Button();
this.dlgFont = new System.Windows.Forms.FontDialog();
this.cbFontBased = new System.Windows.Forms.CheckBox();
this.lblFont = new System.Windows.Forms.Label();
this.nudShiftX = new System.Windows.Forms.NumericUpDown();
this.nudShiftY = new System.Windows.Forms.NumericUpDown();
this.lblShiftX = new System.Windows.Forms.Label();
this.lblShiftY = new System.Windows.Forms.Label();
this.pnlFont = new System.Windows.Forms.Panel();
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();
((System.ComponentModel.ISupportInitialize)(this.nudNewX)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.nudNewY)).BeginInit();
this.panel1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.pbChar2)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.pbChar1)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.nudShiftX)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.nudShiftY)).BeginInit();
this.pnlFont.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.nudChar2)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.nudChar1)).BeginInit();
this.SuspendLayout();
//
// nudNewX
//
this.nudNewX.Location = new System.Drawing.Point(74, 19);
this.nudNewX.Location = new System.Drawing.Point(68, 32);
this.nudNewX.Maximum = new decimal(new int[] {
255,
0,
@@ -63,11 +87,12 @@
0,
0,
0});
this.nudNewX.ValueChanged += new System.EventHandler(this.nudNewX_ValueChanged);
this.nudNewX.Enter += new System.EventHandler(this.nudFocus);
//
// nudNewY
//
this.nudNewY.Location = new System.Drawing.Point(74, 45);
this.nudNewY.Location = new System.Drawing.Point(68, 58);
this.nudNewY.Maximum = new decimal(new int[] {
255,
0,
@@ -86,12 +111,13 @@
0,
0,
0});
this.nudNewY.ValueChanged += new System.EventHandler(this.nudNewX_ValueChanged);
this.nudNewY.Enter += new System.EventHandler(this.nudFocus);
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(30, 21);
this.label1.Location = new System.Drawing.Point(24, 34);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(38, 13);
this.label1.TabIndex = 2;
@@ -101,7 +127,7 @@
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(27, 47);
this.label2.Location = new System.Drawing.Point(21, 60);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(41, 13);
this.label2.TabIndex = 3;
@@ -112,7 +138,7 @@
//
this.rbMono.AutoSize = true;
this.rbMono.Checked = true;
this.rbMono.Location = new System.Drawing.Point(30, 71);
this.rbMono.Location = new System.Drawing.Point(24, 84);
this.rbMono.Name = "rbMono";
this.rbMono.Size = new System.Drawing.Size(87, 17);
this.rbMono.TabIndex = 4;
@@ -123,7 +149,7 @@
// rbVar
//
this.rbVar.AutoSize = true;
this.rbVar.Location = new System.Drawing.Point(30, 94);
this.rbVar.Location = new System.Drawing.Point(24, 107);
this.rbVar.Name = "rbVar";
this.rbVar.Size = new System.Drawing.Size(91, 17);
this.rbVar.TabIndex = 5;
@@ -133,7 +159,7 @@
// cbNotPrintable
//
this.cbNotPrintable.AutoSize = true;
this.cbNotPrintable.Location = new System.Drawing.Point(146, 35);
this.cbNotPrintable.Location = new System.Drawing.Point(140, 54);
this.cbNotPrintable.Name = "cbNotPrintable";
this.cbNotPrintable.Size = new System.Drawing.Size(116, 17);
this.cbNotPrintable.TabIndex = 7;
@@ -145,7 +171,7 @@
this.cbLatin.AutoSize = true;
this.cbLatin.Checked = true;
this.cbLatin.CheckState = System.Windows.Forms.CheckState.Checked;
this.cbLatin.Location = new System.Drawing.Point(146, 58);
this.cbLatin.Location = new System.Drawing.Point(140, 77);
this.cbLatin.Name = "cbLatin";
this.cbLatin.Size = new System.Drawing.Size(91, 17);
this.cbLatin.TabIndex = 8;
@@ -155,7 +181,7 @@
// cbExtended
//
this.cbExtended.AutoSize = true;
this.cbExtended.Location = new System.Drawing.Point(146, 81);
this.cbExtended.Location = new System.Drawing.Point(140, 100);
this.cbExtended.Name = "cbExtended";
this.cbExtended.Size = new System.Drawing.Size(119, 17);
this.cbExtended.TabIndex = 9;
@@ -165,7 +191,8 @@
//
// btnOK
//
this.btnOK.Location = new System.Drawing.Point(56, 143);
this.btnOK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.btnOK.Location = new System.Drawing.Point(47, 178);
this.btnOK.Name = "btnOK";
this.btnOK.Size = new System.Drawing.Size(75, 23);
this.btnOK.TabIndex = 10;
@@ -175,8 +202,9 @@
//
// btnCancel
//
this.btnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.btnCancel.Location = new System.Drawing.Point(165, 143);
this.btnCancel.Location = new System.Drawing.Point(140, 178);
this.btnCancel.Name = "btnCancel";
this.btnCancel.Size = new System.Drawing.Size(75, 23);
this.btnCancel.TabIndex = 11;
@@ -187,7 +215,7 @@
// cbSingle
//
this.cbSingle.AutoSize = true;
this.cbSingle.Location = new System.Drawing.Point(146, 12);
this.cbSingle.Location = new System.Drawing.Point(140, 31);
this.cbSingle.Name = "cbSingle";
this.cbSingle.Size = new System.Drawing.Size(84, 17);
this.cbSingle.TabIndex = 12;
@@ -207,17 +235,206 @@
this.cbEncoding.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cbEncoding.Enabled = false;
this.cbEncoding.FormattingEnabled = true;
this.cbEncoding.Location = new System.Drawing.Point(146, 104);
this.cbEncoding.Location = new System.Drawing.Point(140, 123);
this.cbEncoding.Name = "cbEncoding";
this.cbEncoding.Size = new System.Drawing.Size(121, 21);
this.cbEncoding.TabIndex = 13;
//
// panel1
//
this.panel1.Controls.Add(this.pbChar2);
this.panel1.Controls.Add(this.pbChar1);
this.panel1.Location = new System.Drawing.Point(6, 24);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(200, 124);
this.panel1.TabIndex = 14;
//
// pbChar2
//
this.pbChar2.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.pbChar2.Location = new System.Drawing.Point(100, 0);
this.pbChar2.Name = "pbChar2";
this.pbChar2.Size = new System.Drawing.Size(100, 124);
this.pbChar2.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
this.pbChar2.TabIndex = 1;
this.pbChar2.TabStop = false;
//
// pbChar1
//
this.pbChar1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.pbChar1.Location = new System.Drawing.Point(0, 0);
this.pbChar1.Name = "pbChar1";
this.pbChar1.Size = new System.Drawing.Size(100, 124);
this.pbChar1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
this.pbChar1.TabIndex = 0;
this.pbChar1.TabStop = false;
//
// btnFont
//
this.btnFont.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.btnFont.Location = new System.Drawing.Point(6, 178);
this.btnFont.Name = "btnFont";
this.btnFont.Size = new System.Drawing.Size(71, 23);
this.btnFont.TabIndex = 15;
this.btnFont.Text = "Font ...";
this.btnFont.UseVisualStyleBackColor = true;
this.btnFont.Click += new System.EventHandler(this.btnFont_Click);
//
// dlgFont
//
this.dlgFont.Font = new System.Drawing.Font("Courier New", 15.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
this.dlgFont.ShowEffects = false;
//
// cbFontBased
//
this.cbFontBased.AutoSize = true;
this.cbFontBased.Location = new System.Drawing.Point(24, 130);
this.cbFontBased.Name = "cbFontBased";
this.cbFontBased.Size = new System.Drawing.Size(101, 17);
this.cbFontBased.TabIndex = 16;
this.cbFontBased.Text = "Based on a font";
this.cbFontBased.UseVisualStyleBackColor = true;
this.cbFontBased.CheckedChanged += new System.EventHandler(this.cbFontBased_CheckedChanged);
//
// lblFont
//
this.lblFont.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.lblFont.Location = new System.Drawing.Point(83, 183);
this.lblFont.Name = "lblFont";
this.lblFont.Size = new System.Drawing.Size(123, 18);
this.lblFont.TabIndex = 17;
this.lblFont.Text = "font";
//
// nudShiftX
//
this.nudShiftX.Location = new System.Drawing.Point(61, 2);
this.nudShiftX.Minimum = new decimal(new int[] {
100,
0,
0,
-2147483648});
this.nudShiftX.Name = "nudShiftX";
this.nudShiftX.Size = new System.Drawing.Size(45, 20);
this.nudShiftX.TabIndex = 18;
this.nudShiftX.ValueChanged += new System.EventHandler(this.nudNewX_ValueChanged);
//
// nudShiftY
//
this.nudShiftY.Location = new System.Drawing.Point(161, 2);
this.nudShiftY.Minimum = new decimal(new int[] {
100,
0,
0,
-2147483648});
this.nudShiftY.Name = "nudShiftY";
this.nudShiftY.Size = new System.Drawing.Size(45, 20);
this.nudShiftY.TabIndex = 19;
this.nudShiftY.ValueChanged += new System.EventHandler(this.nudNewX_ValueChanged);
//
// lblShiftX
//
this.lblShiftX.AutoSize = true;
this.lblShiftX.Location = new System.Drawing.Point(14, 4);
this.lblShiftX.Name = "lblShiftX";
this.lblShiftX.Size = new System.Drawing.Size(41, 13);
this.lblShiftX.TabIndex = 20;
this.lblShiftX.Text = "Shift X:";
this.lblShiftX.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// lblShiftY
//
this.lblShiftY.AutoSize = true;
this.lblShiftY.Location = new System.Drawing.Point(114, 4);
this.lblShiftY.Name = "lblShiftY";
this.lblShiftY.Size = new System.Drawing.Size(41, 13);
this.lblShiftY.TabIndex = 21;
this.lblShiftY.Text = "Shift Y:";
this.lblShiftY.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// pnlFont
//
this.pnlFont.Controls.Add(this.label4);
this.pnlFont.Controls.Add(this.label3);
this.pnlFont.Controls.Add(this.nudChar2);
this.pnlFont.Controls.Add(this.nudChar1);
this.pnlFont.Controls.Add(this.lblShiftX);
this.pnlFont.Controls.Add(this.lblShiftY);
this.pnlFont.Controls.Add(this.panel1);
this.pnlFont.Controls.Add(this.btnFont);
this.pnlFont.Controls.Add(this.nudShiftY);
this.pnlFont.Controls.Add(this.lblFont);
this.pnlFont.Controls.Add(this.nudShiftX);
this.pnlFont.Dock = System.Windows.Forms.DockStyle.Right;
this.pnlFont.Location = new System.Drawing.Point(270, 0);
this.pnlFont.Name = "pnlFont";
this.pnlFont.Size = new System.Drawing.Size(214, 211);
this.pnlFont.TabIndex = 22;
this.pnlFont.Visible = false;
//
// nudChar2
//
this.nudChar2.Location = new System.Drawing.Point(161, 149);
this.nudChar2.Maximum = new decimal(new int[] {
255,
0,
0,
0});
this.nudChar2.Name = "nudChar2";
this.nudChar2.Size = new System.Drawing.Size(45, 20);
this.nudChar2.TabIndex = 23;
this.nudChar2.Value = new decimal(new int[] {
97,
0,
0,
0});
this.nudChar2.ValueChanged += new System.EventHandler(this.nudNewX_ValueChanged);
//
// nudChar1
//
this.nudChar1.Location = new System.Drawing.Point(61, 149);
this.nudChar1.Maximum = new decimal(new int[] {
255,
0,
0,
0});
this.nudChar1.Name = "nudChar1";
this.nudChar1.Size = new System.Drawing.Size(45, 20);
this.nudChar1.TabIndex = 22;
this.nudChar1.Value = new decimal(new int[] {
65,
0,
0,
0});
this.nudChar1.ValueChanged += new System.EventHandler(this.nudNewX_ValueChanged);
//
// 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;
//
// 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;
//
// New
//
this.AcceptButton = this.btnOK;
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.CancelButton = this.btnCancel;
this.ClientSize = new System.Drawing.Size(284, 181);
this.ClientSize = new System.Drawing.Size(484, 211);
this.Controls.Add(this.pnlFont);
this.Controls.Add(this.cbFontBased);
this.Controls.Add(this.cbEncoding);
this.Controls.Add(this.cbSingle);
this.Controls.Add(this.btnCancel);
@@ -233,7 +450,6 @@
this.Controls.Add(this.nudNewX);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.MaximizeBox = false;
this.MaximumSize = new System.Drawing.Size(300, 220);
this.MinimizeBox = false;
this.MinimumSize = new System.Drawing.Size(300, 220);
this.Name = "New";
@@ -244,6 +460,15 @@
this.Load += new System.EventHandler(this.New_Load);
((System.ComponentModel.ISupportInitialize)(this.nudNewX)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.nudNewY)).EndInit();
this.panel1.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.pbChar2)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.pbChar1)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.nudShiftX)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.nudShiftY)).EndInit();
this.pnlFont.ResumeLayout(false);
this.pnlFont.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.nudChar2)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.nudChar1)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
@@ -265,5 +490,21 @@
public System.Windows.Forms.CheckBox cbSingle;
private System.Windows.Forms.ToolTip toolTip1;
public System.Windows.Forms.ComboBox cbEncoding;
public System.Windows.Forms.Panel panel1;
private System.Windows.Forms.PictureBox pbChar2;
private System.Windows.Forms.PictureBox pbChar1;
private System.Windows.Forms.Button btnFont;
public System.Windows.Forms.FontDialog dlgFont;
public System.Windows.Forms.CheckBox cbFontBased;
private System.Windows.Forms.Label lblFont;
public System.Windows.Forms.NumericUpDown nudShiftX;
public System.Windows.Forms.NumericUpDown nudShiftY;
private System.Windows.Forms.Label lblShiftX;
private System.Windows.Forms.Label lblShiftY;
private System.Windows.Forms.Panel pnlFont;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.Label label3;
public System.Windows.Forms.NumericUpDown nudChar2;
public System.Windows.Forms.NumericUpDown nudChar1;
}
}

View File

@@ -3,10 +3,12 @@ using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using static System.Net.Mime.MediaTypeNames;
namespace McBitFont {
public partial class New : Form {
@@ -25,18 +27,26 @@ namespace McBitFont {
}
}
private MainForm mainForm;
public New() {
public New(MainForm form) {
InitializeComponent();
mainForm = form;
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) {
@@ -59,6 +69,78 @@ namespace McBitFont {
cbEncoding.Items.Add(new EncodingItem(1256, "Arabic"));
cbEncoding.Items.Add(new EncodingItem(1257, "Baltic"));
cbEncoding.SelectedIndex = 1;
lblFont.Text = dlgFont.Font.Name + " " + dlgFont.Font.Size.ToString();
updateChars();
}
private void updateChars() {
int neww, newh;
const int pbw = 100;
const int pbh = 124;
int w = (int)nudNewX.Value;
int h = (int)nudNewY.Value;
int difw = pbw - w;
int difh = pbh - h;
string[] chars = { "A", "a" };
PictureBox[] pbs = { pbChar1, pbChar2 };
if (difw > 0) {
if (difh > 0) {
//not wider, not taller
if (difw < difh) {
neww = pbw;
newh = h * pbw / w;
} else {
newh = pbh;
neww = w * pbh / h;
}
} else {
// not wider, taller
newh = pbh;
neww = w * pbh / h;
}
} else {
if (difh > 0) {
//wider, not taller
neww = pbw;
newh = h * pbw / w;
} else {
// wider, taller
if (difw > difh) {
neww = pbw;
newh = h * pbw / w;
} else {
newh = pbh;
neww = w * pbh / h;
}
}
}
Bitmap bmp, result;
Graphics g;
chars[0] = mainForm.decodeSymbol((int)nudChar1.Value);
chars[1] = mainForm.decodeSymbol((int)nudChar2.Value);
for (int i = 0; i < 2; i++) {
bmp = new Bitmap((int)nudNewX.Value, (int)nudNewY.Value);
g = Graphics.FromImage(bmp);
g.Clear(Color.White);
g.SmoothingMode = SmoothingMode.None;
g.InterpolationMode = InterpolationMode.NearestNeighbor;
g.PixelOffsetMode = PixelOffsetMode.Half;
g.TextRenderingHint = System.Drawing.Text.TextRenderingHint.SingleBitPerPixelGridFit;
g.DrawString(chars[i], dlgFont.Font, Brushes.Black, (int)nudShiftX.Value, (int)nudShiftY.Value);
g.Flush();
result = new Bitmap(neww, newh);
using (Graphics gr = Graphics.FromImage(result)) {
gr.InterpolationMode = InterpolationMode.NearestNeighbor;
gr.PixelOffsetMode = PixelOffsetMode.Half;
gr.DrawImage(bmp, 0, 0, neww, newh);
}
pbs[i].Image = result;
}
}
private void btnCancel_Click(object sender, EventArgs e) {
@@ -78,5 +160,23 @@ namespace McBitFont {
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();
updateChars();
}
}
private void nudNewX_ValueChanged(object sender, EventArgs e) {
updateChars();
}
}
}

View File

@@ -120,4 +120,7 @@
<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="dlgFont.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>114, 17</value>
</metadata>
</root>

View File

@@ -6,11 +6,11 @@ using System.Runtime.InteropServices;
// набора атрибутов. Измените значения этих атрибутов для изменения сведений,
// связанных со сборкой.
[assembly: AssemblyTitle("McBitFont")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyDescription("McFLY's Bit Font and Image Editor")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("McBitFont")]
[assembly: AssemblyCopyright("Copyright © 2023")]
[assembly: AssemblyCopyright("© Anton Mukhin, 2023")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
// Можно задать все значения или принять номера сборки и редакции по умолчанию
// используя "*", как показано ниже:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyVersion("1.6.0.0")]
[assembly: AssemblyFileVersion("1.6.0.0")]

View File

@@ -70,6 +70,16 @@ namespace McBitFont.Properties {
}
}
/// <summary>
/// Поиск локализованного ресурса типа System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap action_check {
get {
object obj = ResourceManager.GetObject("action_check", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Поиск локализованного ресурса типа System.Drawing.Bitmap.
/// </summary>
@@ -120,6 +130,96 @@ namespace McBitFont.Properties {
}
}
/// <summary>
/// Поиск локализованного ресурса типа System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap Famfamfam_Silk_Disk_16 {
get {
object obj = ResourceManager.GetObject("Famfamfam-Silk-Disk.16", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Поиск локализованного ресурса типа System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap Famfamfam_Silk_Door_out_16 {
get {
object obj = ResourceManager.GetObject("Famfamfam-Silk-Door-out.16", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Поиск локализованного ресурса типа System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap Famfamfam_Silk_Folder_16 {
get {
object obj = ResourceManager.GetObject("Famfamfam-Silk-Folder.16", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Поиск локализованного ресурса типа System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap Famfamfam_Silk_Folder_page_16 {
get {
object obj = ResourceManager.GetObject("Famfamfam-Silk-Folder-page.16", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Поиск локализованного ресурса типа System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap Famfamfam_Silk_Page_copy_16 {
get {
object obj = ResourceManager.GetObject("Famfamfam-Silk-Page-copy.16", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Поиск локализованного ресурса типа System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap Famfamfam_Silk_Page_paste_16 {
get {
object obj = ResourceManager.GetObject("Famfamfam-Silk-Page-paste.16", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Поиск локализованного ресурса типа System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap Famfamfam_Silk_Page_white_16 {
get {
object obj = ResourceManager.GetObject("Famfamfam-Silk-Page-white.16", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Поиск локализованного ресурса типа System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap Famfamfam_Silk_Shape_flip_horizontal_16 {
get {
object obj = ResourceManager.GetObject("Famfamfam-Silk-Shape-flip-horizontal.16", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Поиск локализованного ресурса типа System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap Famfamfam_Silk_Shape_flip_vertical_16 {
get {
object obj = ResourceManager.GetObject("Famfamfam-Silk-Shape-flip-vertical.16", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Поиск локализованного ресурса типа System.Drawing.Bitmap.
/// </summary>
@@ -140,6 +240,46 @@ namespace McBitFont.Properties {
}
}
/// <summary>
/// Поиск локализованного ресурса типа System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap icon {
get {
object obj = ResourceManager.GetObject("icon", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Поиск локализованного ресурса типа System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap icon_32 {
get {
object obj = ResourceManager.GetObject("icon_32", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Поиск локализованного ресурса типа System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap icon_64 {
get {
object obj = ResourceManager.GetObject("icon_64", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Поиск локализованного ресурса типа System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap Ionic_Ionicons_Invert_mode_outline_16 {
get {
object obj = ResourceManager.GetObject("Ionic-Ionicons-Invert-mode-outline.16", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Поиск локализованного ресурса типа System.Drawing.Bitmap.
/// </summary>

View File

@@ -118,31 +118,73 @@
<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 name="Ionic-Ionicons-Invert-mode-outline.16" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Ionic-Ionicons-Invert-mode-outline.16.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 name="Famfamfam-Silk-Page-copy.16" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Famfamfam-Silk-Page-copy.16.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 name="Famfamfam-Silk-Disk.16" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Famfamfam-Silk-Disk.16.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 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="action_check" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\action_check.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Famfamfam-Silk-Page-white.16" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Famfamfam-Silk-Page-white.16.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="icon" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\icon.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>
<data name="Famfamfam-Silk-Door-out.16" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Famfamfam-Silk-Door-out.16.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Famfamfam-Silk-Folder-page.16" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Famfamfam-Silk-Folder-page.16.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Famfamfam-Silk-Folder.16" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Famfamfam-Silk-Folder.16.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<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="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="Famfamfam-Silk-Page-paste.16" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Famfamfam-Silk-Page-paste.16.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="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="Famfamfam-Silk-Shape-flip-vertical.16" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Famfamfam-Silk-Shape-flip-vertical.16.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Famfamfam-Silk-Shape-flip-horizontal.16" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Famfamfam-Silk-Shape-flip-horizontal.16.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="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="icon_32" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\icon_32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="icon_64" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\icon_64.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
</root>

Binary file not shown.

After

Width:  |  Height:  |  Size: 899 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 932 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 931 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 732 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 966 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 914 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 388 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 465 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 465 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 239 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 371 B

View File

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

View File

Before

Width:  |  Height:  |  Size: 894 B

After

Width:  |  Height:  |  Size: 894 B

BIN
McBitFont/icon_64.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

View File

@@ -1,3 +1,37 @@
# McBitFont
pixel based Font to C arrays converter
McFLY's Bit Font and Image Editor
Features:
- Generate a project based on a font installed in the system
- Basic pixel manipulations: shift, flip, invert, etc...
- Save / Load your project for later edits
- Export as a C array in different formats
Requires .Net Framework 4.7+
Some basic hints on the interface:
- Mouse 1 to mark a puxel black
- 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
Download in the Releases section!
### Screenshots:
Main window
![Main window](/images/Screenshot_01.png)
New project dialog
![New project](/images/Screenshot_02.png)
Export dialog
![Export](/images/Screenshot_03.png)

BIN
examples/CP437_Cyr_8x16.mbf Normal file

Binary file not shown.

BIN
examples/Font_5x7.mbf Normal file

Binary file not shown.

BIN
examples/Numbers_11x16.mbf Normal file

Binary file not shown.

BIN
examples/Numbers_13x20.mbf Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
examples/icons_9x9.mbf Normal file

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 661 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 585 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 584 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 632 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 899 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 932 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 931 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 732 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 966 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 914 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 387 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 388 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 465 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 465 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 646 B

BIN
icons/app/icon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 894 B

BIN
icons/app/icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

BIN
icons/app/icon_32.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

BIN
icons/app/icon_32.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

BIN
icons/app/icon_64.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

BIN
icons/app/icon_64.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

BIN
images/Screenshot_01.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

BIN
images/Screenshot_02.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

BIN
images/Screenshot_03.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB