Compare commits
45 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
32a8ffd749 | ||
|
c092aebeca | ||
|
346088b532 | ||
|
ac7981d40a | ||
|
dd3ecfcf3e | ||
|
6ba4a56197 | ||
|
87b46ec714 | ||
|
12593ef7ad | ||
|
b01bff86b9 | ||
3e734432f4 | |||
aa5b8354d6 | |||
|
7952263595 | ||
07906b8abc | |||
25e54c35e7 | |||
fc3ef33f3e | |||
|
780f92ccf5 | ||
|
cebbdc63c8 | ||
|
8ca83b7edc | ||
|
9cfe8ef5c3 | ||
76ca7ccf35 | |||
|
3c656b36a7 | ||
|
9f6f5ba5d7 | ||
|
4fa3d9bc49 | ||
|
1a26a2d16b | ||
|
e0a4a6194c | ||
|
6971686f88 | ||
|
ac2e345397 | ||
|
d1d653bc34 | ||
1c034fded1 | |||
|
a05352acf7 | ||
2f86598a2a | |||
|
313f35bb3e | ||
|
679b4fc61d | ||
|
eda7af8f67 | ||
|
4381d6d911 | ||
|
8d34e34326 | ||
|
92027a0ee3 | ||
6c32edac6e | |||
f9c9d440ec | |||
|
f8b53f2dab | ||
|
2a4b36d368 | ||
083ede5985 | |||
5208d40a92 | |||
519720f2ef | |||
88ee72567e |
1
.gitignore
vendored
@@ -5,6 +5,7 @@
|
||||
## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore
|
||||
|
||||
examples/tests/32x32/
|
||||
examples/tests/PNGout/
|
||||
|
||||
# User-specific files
|
||||
*.rsuser
|
||||
|
2
McBitFont/About.Designer.cs
generated
@@ -124,7 +124,7 @@
|
||||
MinimizeBox = false;
|
||||
Name = "About";
|
||||
ShowInTaskbar = false;
|
||||
StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
|
||||
StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
|
||||
Text = "About McBitFont";
|
||||
Load += About_Load;
|
||||
((System.ComponentModel.ISupportInitialize)pictureBox1).EndInit();
|
||||
|
@@ -15,7 +15,7 @@ namespace McBitFont {
|
||||
}
|
||||
|
||||
private void About_Load(object sender, EventArgs e) {
|
||||
lblVersion.Text = "Version: v" + MainForm.version;
|
||||
lblVersion.Text = "Version: " + MainForm.version;
|
||||
}
|
||||
|
||||
private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) {
|
||||
|
@@ -1,85 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
|
||||
namespace McBitFont {
|
||||
internal class CanvasHistory {
|
||||
private List<bool[,]> stack;
|
||||
public int Depth { get; set; }
|
||||
public int Index { get; set; }
|
||||
public int Count {
|
||||
get { return stack.Count - 1; }
|
||||
}
|
||||
public int Redos {
|
||||
get {
|
||||
var r = Count - Index - 1;
|
||||
|
||||
return r < 0 ? 0 : r;
|
||||
}
|
||||
}
|
||||
public int Undos {
|
||||
get {
|
||||
return Index + 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public CanvasHistory(int depth = 50) {
|
||||
Depth = depth;
|
||||
Index = -1;
|
||||
stack = [];
|
||||
}
|
||||
|
||||
public void Clear() {
|
||||
stack.Clear();
|
||||
Index = -1;
|
||||
}
|
||||
|
||||
public void AddPre(MainForm.FrameMiniature f, bool useIndex = true) {
|
||||
if (Count < 0) stack.Add(new bool[f.width, f.height]);
|
||||
if (Index < Count - 1) {
|
||||
stack.RemoveRange(Index + 1, Count - Index - 1);
|
||||
}
|
||||
bool[,] d = new bool[f.width, f.height];
|
||||
Array.Copy(f.data, d, f.data.Length);
|
||||
stack.Insert(Count, d);
|
||||
if (useIndex) {
|
||||
if (Count > Depth) stack.RemoveAt(0);
|
||||
else Index++;
|
||||
}
|
||||
}
|
||||
|
||||
public void AddPost(MainForm.FrameMiniature f) {
|
||||
var d = stack.ElementAt(Count);
|
||||
Array.Copy(f.data, d, f.data.Length);
|
||||
}
|
||||
|
||||
public void ApplyAdded() {
|
||||
while (Count > Depth) stack.RemoveAt(0);
|
||||
Index = Count - 1;
|
||||
}
|
||||
|
||||
public void Remove(bool useIndex = true) {
|
||||
stack.RemoveAt(Count - 1);
|
||||
if (useIndex) Index--;
|
||||
}
|
||||
|
||||
public void Undo(MainForm.FrameMiniature f) {
|
||||
if (Index < 0) return;
|
||||
var d = stack.ElementAt(Index);
|
||||
Array.Copy(d, f.data, d.Length);
|
||||
Index--;
|
||||
}
|
||||
|
||||
public void Redo(MainForm.FrameMiniature f) {
|
||||
if (Index >= Count - 1) return;
|
||||
Index++;
|
||||
var d = stack.ElementAt(Index + 1);
|
||||
Array.Copy(d, f.data, d.Length);
|
||||
}
|
||||
}
|
||||
}
|
304
McBitFont/ChangeHistory.cs
Normal file
@@ -0,0 +1,304 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Windows.Forms;
|
||||
using static McBitFont.MainForm;
|
||||
|
||||
namespace McBitFont {
|
||||
internal class ChangeHistory {
|
||||
private MainForm mainForm;
|
||||
private List<ChangeEvent> timeline = [];
|
||||
private List<FrameMiniature> canvasChanges = [];
|
||||
private List<List<FrameMiniature>> fontChanges = [];
|
||||
private List<int> selectionChanges = [];
|
||||
private int canvasIndex = 0;
|
||||
private int fontIndex = 0;
|
||||
private int selectionIndex = 0;
|
||||
public int Depth { get; set; }
|
||||
public int Index { get; set; } = -1;
|
||||
public int Count {
|
||||
get { return timeline.Count; }
|
||||
}
|
||||
public int Undos {
|
||||
get { return Index < 0 ? 0 : Index + 1; }
|
||||
}
|
||||
public int Redos {
|
||||
get { return Index < 0 ? Count : Count - Index - 1; }
|
||||
}
|
||||
public bool Doing { get; set; } = false;
|
||||
|
||||
// Constructor
|
||||
public ChangeHistory(MainForm form, int depth = 100) {
|
||||
timeline = [];
|
||||
canvasChanges = [];
|
||||
fontChanges = [];
|
||||
selectionChanges = [];
|
||||
mainForm = form;
|
||||
Depth = depth;
|
||||
ResetIndices();
|
||||
Add();
|
||||
Doing = false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void ResetIndices() {
|
||||
Index = -1;
|
||||
canvasIndex = 0;
|
||||
fontIndex = 0;
|
||||
selectionIndex = 0;
|
||||
}
|
||||
|
||||
public enum ChangeType {
|
||||
None = 0,
|
||||
Canvas = 1, // Changes made to canvas
|
||||
Font = 2, // Symbol width has been changed
|
||||
Selection = 3 // Selected another frame
|
||||
}
|
||||
|
||||
public class ChangeEvent(ChangeType type, FrameMiniature? canvas = null) {
|
||||
public ChangeType Type { get; set; } = type;
|
||||
public FrameMiniature? Canvas { get; set; } = canvas;
|
||||
}
|
||||
|
||||
public static FrameMiniature CopyFrameSimple(FrameMiniature f) {
|
||||
FrameMiniature newf = new(f.code, f.width, f.height);
|
||||
Array.Copy(f.data, newf.data, f.data.Length);
|
||||
return newf;
|
||||
}
|
||||
|
||||
public void Clear() {
|
||||
timeline.Clear();
|
||||
canvasChanges.Clear();
|
||||
fontChanges.Clear();
|
||||
selectionChanges.Clear();
|
||||
ResetIndices();
|
||||
Add();
|
||||
}
|
||||
|
||||
// Remove from a proper list by change type
|
||||
private bool RemoveByType(ChangeEvent ce, bool first = true) {
|
||||
switch (ce.Type) {
|
||||
case ChangeType.Canvas:
|
||||
if (canvasChanges.Count <= 1) return false;
|
||||
if ((first && canvasIndex > 0) || (!first && canvasIndex == canvasChanges.Count - 1)) canvasIndex--;
|
||||
canvasChanges.RemoveAt(first ? 0 : canvasChanges.Count - 1);
|
||||
break;
|
||||
case ChangeType.Font:
|
||||
if (fontChanges.Count <= 1) return false;
|
||||
if ((first && fontIndex > 0) || (!first && fontIndex == fontChanges.Count - 1)) fontIndex--;
|
||||
if (ce.Canvas != null) {
|
||||
if ((first && canvasIndex > 0) || (!first && canvasIndex == canvasChanges.Count - 1)) canvasIndex--;
|
||||
canvasChanges.Remove((FrameMiniature)ce.Canvas);
|
||||
}
|
||||
fontChanges.RemoveAt(first ? 0 : fontChanges.Count - 1);
|
||||
break;
|
||||
case ChangeType.Selection:
|
||||
if (selectionChanges.Count <= 1) return false;
|
||||
if ((first && selectionIndex > 0) || (!first && selectionIndex == selectionChanges.Count - 1)) selectionIndex--;
|
||||
if (ce.Canvas != null) {
|
||||
if ((first && canvasIndex > 0) || (!first && canvasIndex == canvasChanges.Count - 1)) canvasIndex--;
|
||||
canvasChanges.Remove((FrameMiniature)ce.Canvas);
|
||||
}
|
||||
selectionChanges.RemoveAt(first ? 0 : selectionChanges.Count - 1);
|
||||
break;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
if ((first && Index > 0) || (!first && Index == Count - 1) || Count == 1) Index--;
|
||||
timeline.RemoveAt(first ? 0 : Count - 1);
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
// Remove oldest event
|
||||
private bool RemoveOldest() {
|
||||
if (Count == 0) return false;
|
||||
ChangeEvent ce = timeline.First();
|
||||
RemoveByType(ce);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
// Remove last event
|
||||
public bool RemoveLast() {
|
||||
if (Count == 0) return false;
|
||||
var ce = timeline.Last();
|
||||
RemoveByType(ce, false);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
// Remove history tail
|
||||
private void TruncateTail() {
|
||||
// Check if the Index does not point to the last event
|
||||
//while (Index < Count - 1) Remove
|
||||
if (Index >= -1 && Index < Count - 1) {
|
||||
timeline.RemoveRange( Index + 1, Count - Index - 1);
|
||||
canvasChanges.RemoveRange( canvasIndex + 1, canvasChanges.Count - canvasIndex - 1);
|
||||
fontChanges.RemoveRange( fontIndex + 1, fontChanges.Count - fontIndex - 1);
|
||||
selectionChanges.RemoveRange(selectionIndex + 1, selectionChanges.Count - selectionIndex - 1);
|
||||
}
|
||||
}
|
||||
|
||||
// Add first states to all lists
|
||||
private void Add() {
|
||||
Add(mainForm.f, false);
|
||||
Add(mainForm.frames, false);
|
||||
var fff = mainForm.f; // Marshal-by-reference warning workaround
|
||||
int ccс = fff.code; //
|
||||
Add(ccс, false);
|
||||
}
|
||||
|
||||
// Add canvas change
|
||||
public FrameMiniature? Add(FrameMiniature f, bool useIndex = true) {
|
||||
if (Doing) return null ;
|
||||
TruncateTail();
|
||||
|
||||
if (Count >= Depth) RemoveOldest();
|
||||
canvasChanges.Add(CopyFrameSimple(f));
|
||||
if (useIndex) {
|
||||
timeline.Add(new ChangeEvent(ChangeType.Canvas));
|
||||
Index++;
|
||||
canvasIndex++;
|
||||
}
|
||||
return canvasChanges.Last();
|
||||
}
|
||||
|
||||
// Add Font change
|
||||
public void Add(List<FrameMiniature> ff, bool useIndex = true) {
|
||||
if (Doing) return;
|
||||
TruncateTail();
|
||||
|
||||
var l = new List<FrameMiniature>();
|
||||
foreach (var f in ff) {
|
||||
l.Add(CopyFrameSimple(f));
|
||||
}
|
||||
|
||||
if (Count >= Depth) RemoveOldest();
|
||||
fontChanges.Add(l);
|
||||
if (useIndex) {
|
||||
var canv = Add(mainForm.f, false);
|
||||
canvasIndex++;
|
||||
timeline.Add(new ChangeEvent(ChangeType.Font, canv));
|
||||
Index++;
|
||||
fontIndex++;
|
||||
}
|
||||
}
|
||||
|
||||
// Add Frame selection change
|
||||
public void Add(int code, bool useIndex = true) {
|
||||
if (Doing) return;
|
||||
TruncateTail();
|
||||
|
||||
if (Count >= Depth) RemoveOldest();
|
||||
selectionChanges.Add(code);
|
||||
if (useIndex) {
|
||||
var canv = Add(mainForm.f, false);
|
||||
canvasIndex++;
|
||||
timeline.Add(new ChangeEvent(ChangeType.Selection, canv));
|
||||
Index++;
|
||||
selectionIndex++;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void Do(bool undo = true) {
|
||||
if (!undo && Index >= Count - 1) return;
|
||||
Doing = true;
|
||||
var ce = timeline.ElementAt(Index + (undo ? 0 : 1));
|
||||
int dIndex = undo ? -1 : 1;
|
||||
FrameMiniature fff;
|
||||
switch (ce.Type) {
|
||||
case ChangeType.Canvas:
|
||||
canvasIndex += dIndex;
|
||||
mainForm.f = CopyFrameSimple(canvasChanges[canvasIndex]);
|
||||
mainForm.SetModified();
|
||||
mainForm.nudX.ValueChanged -= mainForm.nudX_ValueChanged;
|
||||
mainForm.nudY.ValueChanged -= mainForm.nudY_ValueChanged;
|
||||
mainForm.nudY.Value = mainForm.dotHeight = canvasChanges[canvasIndex].height;
|
||||
mainForm.nudX.Value = mainForm.dotWidth = canvasChanges[canvasIndex].width;
|
||||
mainForm.SetNewWH();
|
||||
mainForm.nudX.ValueChanged += mainForm.nudX_ValueChanged;
|
||||
mainForm.nudY.ValueChanged += mainForm.nudY_ValueChanged;
|
||||
break;
|
||||
case ChangeType.Font:
|
||||
Cursor.Current = Cursors.WaitCursor;
|
||||
string selItem = "";
|
||||
int selCode = 0;
|
||||
if (mainForm.miniList.SelectedItems.Count > 0) {
|
||||
selItem = mainForm.miniList.SelectedItems[0].Name;
|
||||
selCode = Convert.ToInt32(selItem);
|
||||
}
|
||||
fontIndex += dIndex;
|
||||
canvasIndex += dIndex;
|
||||
mainForm.frames.Clear();
|
||||
mainForm.miniList.Clear();
|
||||
mainForm.ilMiniatures.Images.Clear();
|
||||
foreach (var f in fontChanges[fontIndex]) {
|
||||
mainForm.frames.Add(CopyFrameSimple(f));
|
||||
}
|
||||
mainForm.FillFrameLists();
|
||||
|
||||
if (selItem != "") {
|
||||
var selection = mainForm.miniList.Items.Find(selItem, false);
|
||||
if (selection.Length > 0) selection[0].Selected = true;
|
||||
fff = mainForm.frames.Find(x => x.code == selCode);
|
||||
} else {
|
||||
mainForm.miniList.Items[0].Selected = true;
|
||||
fff = mainForm.frames[0];
|
||||
}
|
||||
mainForm.f = mainForm.CopyFrame(fff);
|
||||
mainForm.nudX.ValueChanged -= mainForm.nudX_ValueChanged;
|
||||
mainForm.nudY.ValueChanged -= mainForm.nudY_ValueChanged;
|
||||
mainForm.nudY.Value = mainForm.dotHeight = fff.height;
|
||||
mainForm.nudX.Value = mainForm.dotWidth = fff.width;
|
||||
mainForm.SetNewWH();
|
||||
mainForm.nudX.ValueChanged += mainForm.nudX_ValueChanged;
|
||||
mainForm.nudY.ValueChanged += mainForm.nudY_ValueChanged;
|
||||
|
||||
Cursor.Current = Cursors.Default;
|
||||
break;
|
||||
case ChangeType.Selection:
|
||||
selectionIndex += dIndex;
|
||||
canvasIndex += dIndex;
|
||||
var s = selectionChanges[selectionIndex].ToString().PadLeft(3, '0');
|
||||
var sel = mainForm.miniList.Items.Find(s, false);
|
||||
if (sel.Length > 0) sel[0].Selected = true;
|
||||
fff = mainForm.frames.Find(x => x.code == selectionChanges[selectionIndex]);
|
||||
mainForm.f = CopyFrameSimple(fff);
|
||||
mainForm.nudX.ValueChanged -= mainForm.nudX_ValueChanged;
|
||||
mainForm.nudY.ValueChanged -= mainForm.nudY_ValueChanged;
|
||||
mainForm.nudY.Value = mainForm.dotHeight = fff.height;
|
||||
mainForm.nudX.Value = mainForm.dotWidth = fff.width;
|
||||
mainForm.SetNewWH();
|
||||
mainForm.nudX.ValueChanged += mainForm.nudX_ValueChanged;
|
||||
mainForm.nudY.ValueChanged += mainForm.nudY_ValueChanged;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
Index += dIndex;
|
||||
Doing = false;
|
||||
|
||||
}
|
||||
|
||||
// Undo last change
|
||||
public bool Undo() {
|
||||
if (Undos < 1) return false;
|
||||
Do();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
// Redo last ondone change
|
||||
public bool Redo() {
|
||||
if (Redos < 1) return false;
|
||||
Do(false);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
2
McBitFont/CodeShift.Designer.cs
generated
@@ -164,7 +164,7 @@
|
||||
Name = "CodeShift";
|
||||
ShowIcon = false;
|
||||
ShowInTaskbar = false;
|
||||
StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
|
||||
StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
|
||||
Text = "Code Shift";
|
||||
Load += CodeShift_Load;
|
||||
((System.ComponentModel.ISupportInitialize)nudValue).EndInit();
|
||||
|
2
McBitFont/Export.Designer.cs
generated
@@ -343,7 +343,7 @@
|
||||
Name = "Export";
|
||||
ShowIcon = false;
|
||||
ShowInTaskbar = false;
|
||||
StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
|
||||
StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
|
||||
Text = "Export";
|
||||
Load += Export_Load;
|
||||
gbScan.ResumeLayout(false);
|
||||
|
216
McBitFont/FontTester.Designer.cs
generated
Normal file
@@ -0,0 +1,216 @@
|
||||
namespace McBitFont {
|
||||
partial class FontTester {
|
||||
/// <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() {
|
||||
components = new System.ComponentModel.Container();
|
||||
lblSpace = new System.Windows.Forms.Label();
|
||||
nudSpace = new System.Windows.Forms.NumericUpDown();
|
||||
lblText = new System.Windows.Forms.Label();
|
||||
tbText = new System.Windows.Forms.TextBox();
|
||||
dotPanel = new System.Windows.Forms.Panel();
|
||||
vScroll = new System.Windows.Forms.VScrollBar();
|
||||
hScroll = new System.Windows.Forms.HScrollBar();
|
||||
lblZoom = new System.Windows.Forms.Label();
|
||||
cbZoom = new System.Windows.Forms.ComboBox();
|
||||
toolTip1 = new System.Windows.Forms.ToolTip(components);
|
||||
btnCopy = new System.Windows.Forms.Button();
|
||||
chkBaseline = new System.Windows.Forms.CheckBox();
|
||||
((System.ComponentModel.ISupportInitialize)nudSpace).BeginInit();
|
||||
SuspendLayout();
|
||||
//
|
||||
// lblSpace
|
||||
//
|
||||
lblSpace.AutoSize = true;
|
||||
lblSpace.Location = new System.Drawing.Point(12, 9);
|
||||
lblSpace.Name = "lblSpace";
|
||||
lblSpace.Size = new System.Drawing.Size(41, 15);
|
||||
lblSpace.TabIndex = 0;
|
||||
lblSpace.Text = "Space:";
|
||||
//
|
||||
// nudSpace
|
||||
//
|
||||
nudSpace.Location = new System.Drawing.Point(59, 6);
|
||||
nudSpace.Maximum = new decimal(new int[] { 255, 0, 0, 0 });
|
||||
nudSpace.Name = "nudSpace";
|
||||
nudSpace.Size = new System.Drawing.Size(40, 23);
|
||||
nudSpace.TabIndex = 2;
|
||||
toolTip1.SetToolTip(nudSpace, "Space between symbols in pixels");
|
||||
nudSpace.Value = new decimal(new int[] { 1, 0, 0, 0 });
|
||||
nudSpace.ValueChanged += Scrolling;
|
||||
//
|
||||
// lblText
|
||||
//
|
||||
lblText.AutoSize = true;
|
||||
lblText.Location = new System.Drawing.Point(12, 37);
|
||||
lblText.Name = "lblText";
|
||||
lblText.Size = new System.Drawing.Size(138, 15);
|
||||
lblText.TabIndex = 2;
|
||||
lblText.Text = "Text to test the font with:";
|
||||
//
|
||||
// tbText
|
||||
//
|
||||
tbText.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right;
|
||||
tbText.Font = new System.Drawing.Font("Segoe UI Semibold", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, 204);
|
||||
tbText.Location = new System.Drawing.Point(12, 55);
|
||||
tbText.Name = "tbText";
|
||||
tbText.Size = new System.Drawing.Size(260, 29);
|
||||
tbText.TabIndex = 1;
|
||||
toolTip1.SetToolTip(tbText, "Text to test the font with");
|
||||
tbText.TextChanged += Text_Changed;
|
||||
//
|
||||
// dotPanel
|
||||
//
|
||||
dotPanel.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right;
|
||||
dotPanel.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
|
||||
dotPanel.BackColor = System.Drawing.Color.White;
|
||||
dotPanel.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
|
||||
dotPanel.Location = new System.Drawing.Point(12, 90);
|
||||
dotPanel.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
|
||||
dotPanel.Name = "dotPanel";
|
||||
dotPanel.Size = new System.Drawing.Size(238, 98);
|
||||
dotPanel.TabIndex = 4;
|
||||
dotPanel.Paint += PaintPixels;
|
||||
dotPanel.Resize += ZoomChanged;
|
||||
//
|
||||
// vScroll
|
||||
//
|
||||
vScroll.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right;
|
||||
vScroll.LargeChange = 25;
|
||||
vScroll.Location = new System.Drawing.Point(251, 84);
|
||||
vScroll.Name = "vScroll";
|
||||
vScroll.Size = new System.Drawing.Size(21, 104);
|
||||
vScroll.TabIndex = 17;
|
||||
vScroll.ValueChanged += Scrolling;
|
||||
//
|
||||
// hScroll
|
||||
//
|
||||
hScroll.Anchor = System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right;
|
||||
hScroll.Location = new System.Drawing.Point(12, 188);
|
||||
hScroll.Name = "hScroll";
|
||||
hScroll.Size = new System.Drawing.Size(238, 21);
|
||||
hScroll.TabIndex = 16;
|
||||
hScroll.ValueChanged += Scrolling;
|
||||
//
|
||||
// lblZoom
|
||||
//
|
||||
lblZoom.AutoSize = true;
|
||||
lblZoom.Location = new System.Drawing.Point(173, 9);
|
||||
lblZoom.Name = "lblZoom";
|
||||
lblZoom.Size = new System.Drawing.Size(42, 15);
|
||||
lblZoom.TabIndex = 18;
|
||||
lblZoom.Text = "Zoom:";
|
||||
//
|
||||
// cbZoom
|
||||
//
|
||||
cbZoom.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
cbZoom.FormattingEnabled = true;
|
||||
cbZoom.Items.AddRange(new object[] { "1", "2", "3", "5", "10", "15", "20", "25", "30", "35", "40", "45", "50" });
|
||||
cbZoom.Location = new System.Drawing.Point(222, 6);
|
||||
cbZoom.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
|
||||
cbZoom.Name = "cbZoom";
|
||||
cbZoom.Size = new System.Drawing.Size(50, 23);
|
||||
cbZoom.TabIndex = 3;
|
||||
cbZoom.TabStop = false;
|
||||
toolTip1.SetToolTip(cbZoom, "Zoom level");
|
||||
cbZoom.SelectedIndexChanged += ZoomChanged;
|
||||
//
|
||||
// toolTip1
|
||||
//
|
||||
toolTip1.AutoPopDelay = 10000;
|
||||
toolTip1.InitialDelay = 500;
|
||||
toolTip1.ReshowDelay = 100;
|
||||
//
|
||||
// btnCopy
|
||||
//
|
||||
btnCopy.Anchor = System.Windows.Forms.AnchorStyles.Bottom;
|
||||
btnCopy.Image = Properties.Resources.Famfamfam_Silk_Page_copy_16;
|
||||
btnCopy.ImageAlign = System.Drawing.ContentAlignment.MiddleRight;
|
||||
btnCopy.Location = new System.Drawing.Point(110, 214);
|
||||
btnCopy.Name = "btnCopy";
|
||||
btnCopy.Size = new System.Drawing.Size(80, 30);
|
||||
btnCopy.TabIndex = 5;
|
||||
btnCopy.Text = " Copy";
|
||||
btnCopy.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText;
|
||||
toolTip1.SetToolTip(btnCopy, "Copy BitPixels you see to Clipboard");
|
||||
btnCopy.UseVisualStyleBackColor = true;
|
||||
btnCopy.MouseClick += Copy_Click;
|
||||
//
|
||||
// chkBaseline
|
||||
//
|
||||
chkBaseline.AutoSize = true;
|
||||
chkBaseline.Location = new System.Drawing.Point(203, 36);
|
||||
chkBaseline.Name = "chkBaseline";
|
||||
chkBaseline.Size = new System.Drawing.Size(69, 19);
|
||||
chkBaseline.TabIndex = 4;
|
||||
chkBaseline.Text = "Baseline";
|
||||
chkBaseline.UseVisualStyleBackColor = true;
|
||||
chkBaseline.CheckedChanged += Scrolling;
|
||||
//
|
||||
// FontTester
|
||||
//
|
||||
AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
|
||||
AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
ClientSize = new System.Drawing.Size(284, 251);
|
||||
Controls.Add(btnCopy);
|
||||
Controls.Add(chkBaseline);
|
||||
Controls.Add(cbZoom);
|
||||
Controls.Add(lblZoom);
|
||||
Controls.Add(vScroll);
|
||||
Controls.Add(hScroll);
|
||||
Controls.Add(dotPanel);
|
||||
Controls.Add(tbText);
|
||||
Controls.Add(lblText);
|
||||
Controls.Add(nudSpace);
|
||||
Controls.Add(lblSpace);
|
||||
MaximizeBox = false;
|
||||
MinimizeBox = false;
|
||||
MinimumSize = new System.Drawing.Size(300, 290);
|
||||
Name = "FontTester";
|
||||
ShowIcon = false;
|
||||
ShowInTaskbar = false;
|
||||
StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
|
||||
Text = "Font Tester";
|
||||
Load += FontTester_Load;
|
||||
Resize += Form_Resize;
|
||||
((System.ComponentModel.ISupportInitialize)nudSpace).EndInit();
|
||||
ResumeLayout(false);
|
||||
PerformLayout();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.Label lblSpace;
|
||||
private System.Windows.Forms.NumericUpDown nudSpace;
|
||||
private System.Windows.Forms.Label lblText;
|
||||
private System.Windows.Forms.TextBox tbText;
|
||||
private System.Windows.Forms.Panel dotPanel;
|
||||
private System.Windows.Forms.VScrollBar vScroll;
|
||||
private System.Windows.Forms.HScrollBar hScroll;
|
||||
private System.Windows.Forms.Label lblZoom;
|
||||
private System.Windows.Forms.ToolTip toolTip1;
|
||||
private System.Windows.Forms.ComboBox cbZoom;
|
||||
private System.Windows.Forms.CheckBox chkBaseline;
|
||||
private System.Windows.Forms.Button btnCopy;
|
||||
}
|
||||
}
|
205
McBitFont/FontTester.cs
Normal file
@@ -0,0 +1,205 @@
|
||||
using MessagePack;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace McBitFont {
|
||||
public partial class FontTester : Form {
|
||||
|
||||
private int codepage = 1251;
|
||||
private int height;
|
||||
private List<MainForm.FrameMiniature> frames;
|
||||
private int baseline;
|
||||
private readonly int absentWidth = 5;
|
||||
private readonly int pixelOffset = 5;
|
||||
|
||||
private int baselineThickness = 1;
|
||||
private byte[] encoded = [];
|
||||
private int cellSize;
|
||||
private int width;
|
||||
|
||||
private readonly DataFormats.Format clpbFormat = DataFormats.GetFormat("McBitFontFrame");
|
||||
|
||||
public FontTester(int codepage, int height, int baseline, List<MainForm.FrameMiniature> frames) {
|
||||
InitializeComponent();
|
||||
Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);
|
||||
this.codepage = codepage;
|
||||
this.height = height;
|
||||
this.baseline = baseline;
|
||||
this.frames = frames;
|
||||
}
|
||||
|
||||
private void FontTester_Load(object sender, EventArgs e) {
|
||||
cbZoom.SelectedIndex = 2;
|
||||
//cbZoom.SelectedIndexChanged += ZoomChanged;
|
||||
dotPanel.MouseWheel += new MouseEventHandler(DotPanel_MouseWheel);
|
||||
}
|
||||
|
||||
private void PaintPixels(object sender, PaintEventArgs e) {
|
||||
Graphics g = dotPanel.CreateGraphics();
|
||||
SolidBrush sbb = new SolidBrush(Color.Black);
|
||||
SolidBrush sbw = new SolidBrush(Color.White);
|
||||
SolidBrush sbp = new SolidBrush(Color.LightPink);
|
||||
SolidBrush sb;
|
||||
Pen blackPen = new(Color.Black);
|
||||
Pen bluePen = new(Color.FromArgb(100, 20, 20, 200), baselineThickness);
|
||||
int x, y, i, j;
|
||||
|
||||
// Sycle through ecoded bytes of test text
|
||||
int space = (int)nudSpace.Value;
|
||||
int index = 0;
|
||||
for (int c = 0; c < encoded.Length; c++) {
|
||||
// Check if we have such symbol
|
||||
var f = frames.FindAll(x => x.code == encoded[c]);
|
||||
if (f.Count == 1) {
|
||||
// Draw the symbol
|
||||
for (i = 0; i < f[0].width; i++) {
|
||||
x = pixelOffset + (index + i) * cellSize - hScroll.Value;
|
||||
for (j = 0; j < f[0].height; j++) {
|
||||
y = pixelOffset + j * cellSize - vScroll.Value;
|
||||
// Fill the cell with color
|
||||
if (f[0].data[i, j]) sb = sbb;
|
||||
else sb = sbw;
|
||||
g.FillRectangle(sb, x, y, cellSize, cellSize);
|
||||
}
|
||||
}
|
||||
index += (f[0].width > 0 ? f[0].width + space : 0);
|
||||
} else {
|
||||
blackPen.Width = cellSize;
|
||||
blackPen.Alignment = System.Drawing.Drawing2D.PenAlignment.Inset;
|
||||
x = pixelOffset + index * cellSize - hScroll.Value;
|
||||
y = pixelOffset - vScroll.Value;
|
||||
g.DrawRectangle(blackPen, x, y + cellSize, absentWidth * cellSize, (height - 2) * cellSize);
|
||||
g.FillRectangle(sbp, x + cellSize, y + 2 * cellSize, (absentWidth - 2) * cellSize, (height - 4) * cellSize);
|
||||
index += 5 + space;
|
||||
}
|
||||
}
|
||||
|
||||
// Draw baseline
|
||||
if (chkBaseline.Checked && baseline > 0) {
|
||||
x = pixelOffset - hScroll.Value;
|
||||
y = pixelOffset + baseline * cellSize - vScroll.Value;
|
||||
g.DrawLine(bluePen, x, y, dotPanel.Width - 2 * pixelOffset, y);
|
||||
}
|
||||
}
|
||||
|
||||
private void Text_Changed(object sender, EventArgs e) {
|
||||
int space = (int)nudSpace.Value;
|
||||
|
||||
encoded = Encoding.GetEncoding(codepage).GetBytes(tbText.Text);
|
||||
|
||||
width = space > 0 ? space : 1;
|
||||
for (int c = 0; c < encoded.Length; c++) {
|
||||
var f = frames.FindAll(x => x.code == encoded[c]);
|
||||
width += (f.Count == 1 ? f[0].width : absentWidth) + space;
|
||||
}
|
||||
dotPanel.Invalidate();
|
||||
}
|
||||
|
||||
private void ZoomChanged(object sender, EventArgs e) {
|
||||
cellSize = Convert.ToInt32(cbZoom.Text);
|
||||
|
||||
int w = pixelOffset + width * cellSize;
|
||||
int h = pixelOffset + height * cellSize;
|
||||
|
||||
if (w <= dotPanel.Width) {
|
||||
hScroll.Enabled = false;
|
||||
hScroll.Value = 0;
|
||||
} else {
|
||||
hScroll.Maximum = w - dotPanel.Width + 12;
|
||||
hScroll.Minimum = 0;
|
||||
hScroll.Enabled = true;
|
||||
}
|
||||
|
||||
if (h <= dotPanel.Height) {
|
||||
vScroll.Enabled = false;
|
||||
vScroll.Value = 0;
|
||||
} else {
|
||||
vScroll.Maximum = h - dotPanel.Height + 12;
|
||||
vScroll.Minimum = 0;
|
||||
vScroll.Enabled = true;
|
||||
}
|
||||
|
||||
// Baseline thickness calc
|
||||
baselineThickness = cellSize / 5;
|
||||
if (baselineThickness > 5) baselineThickness = 5;
|
||||
if (baselineThickness < 1) baselineThickness = 1;
|
||||
|
||||
dotPanel.Refresh();
|
||||
}
|
||||
|
||||
private void DotPanel_MouseWheel(object sender, MouseEventArgs e) {
|
||||
int t = e.Delta / 120;
|
||||
if (e.Delta == 0) return;
|
||||
if (ModifierKeys.HasFlag(Keys.Control)) {
|
||||
t += cbZoom.SelectedIndex;
|
||||
if (t > cbZoom.Items.Count - 1) return;
|
||||
if (t < 0) return;
|
||||
cbZoom.SelectedIndex = t;
|
||||
} else if (ModifierKeys.HasFlag(Keys.Shift)) {
|
||||
if (hScroll.Enabled) {
|
||||
t = t * -1 * cellSize + hScroll.Value;
|
||||
if (t < hScroll.Minimum) t = hScroll.Minimum;
|
||||
if (t > hScroll.Maximum) t = hScroll.Maximum;
|
||||
hScroll.Value = t;
|
||||
}
|
||||
} else {
|
||||
if (vScroll.Enabled) {
|
||||
t = t * -1 * cellSize + vScroll.Value;
|
||||
if (t < vScroll.Minimum) t = vScroll.Minimum;
|
||||
if (t > vScroll.Maximum) t = vScroll.Maximum;
|
||||
vScroll.Value = t;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void Scrolling(object sender, EventArgs e) {
|
||||
dotPanel.Invalidate();
|
||||
}
|
||||
|
||||
private void Form_Resize(object sender, EventArgs e) {
|
||||
btnCopy.Left = this.Width / 2 - 40;
|
||||
}
|
||||
|
||||
private void Copy_Click(object sender, MouseEventArgs e) {
|
||||
if (encoded.Length < 1) {
|
||||
MessageBox.Show("Nothing to copy! Type some symbols first.", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
return;
|
||||
}
|
||||
// Sycle through ecoded bytes of test text
|
||||
int space = (int)nudSpace.Value;
|
||||
int index = 0;
|
||||
int i, j;
|
||||
MainForm.FrameMiniature ff = new(0, width, frames[0].height);
|
||||
for (int c = 0; c < encoded.Length; c++) {
|
||||
// Check if we have such symbol
|
||||
var f = frames.FindAll(x => x.code == encoded[c]);
|
||||
if (f.Count == 1) {
|
||||
// Draw the symbol
|
||||
for (i = 0; i < f[0].width; i++) {
|
||||
for (j = 0; j < f[0].height; j++) {
|
||||
// Fill the frame with data
|
||||
ff.data[index + i, j] = f[0].data[i, j];
|
||||
}
|
||||
}
|
||||
index += (f[0].width > 0 ? f[0].width + space : 0);
|
||||
} else {
|
||||
index += 5 + space;
|
||||
}
|
||||
}
|
||||
// Copy the frame we made into Clipboard
|
||||
var bb = MessagePackSerializer.Serialize(ChangeHistory.CopyFrameSimple(ff));
|
||||
DataObject clpbObj = new DataObject(clpbFormat.Name, bb);
|
||||
Clipboard.SetDataObject(clpbObj, true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
123
McBitFont/FontTester.resx
Normal file
@@ -0,0 +1,123 @@
|
||||
<?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>
|
||||
<metadata name="toolTip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
</root>
|
335
McBitFont/Form1.Designer.cs
generated
@@ -28,8 +28,8 @@
|
||||
dotPanel = new System.Windows.Forms.Panel();
|
||||
nudX = new System.Windows.Forms.NumericUpDown();
|
||||
nudY = new System.Windows.Forms.NumericUpDown();
|
||||
label1 = new System.Windows.Forms.Label();
|
||||
label2 = new System.Windows.Forms.Label();
|
||||
lblWidth = new System.Windows.Forms.Label();
|
||||
lblHeight = new System.Windows.Forms.Label();
|
||||
lblType = new System.Windows.Forms.Label();
|
||||
cbZoom = new System.Windows.Forms.ComboBox();
|
||||
label4 = new System.Windows.Forms.Label();
|
||||
@@ -64,9 +64,12 @@
|
||||
openToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
saveToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
saveAsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
|
||||
importTextToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
|
||||
importImageToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
exportToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
exportFontLayoutPNGToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator();
|
||||
exitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
editToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
undoToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
@@ -82,7 +85,13 @@
|
||||
removeSymbolToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
removeBeforeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
removeAfterToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
zerofyWidthToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
CodeShiftToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
toolStripSeparator3 = new System.Windows.Forms.ToolStripSeparator();
|
||||
previousSymbolToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
nextSymbolToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
toolStripSeparator4 = new System.Windows.Forms.ToolStripSeparator();
|
||||
testFontToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
canvasToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
ClearToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
FillToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
@@ -95,6 +104,7 @@
|
||||
mirrorYToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
applyToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
aboutToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
toggleBarToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||
dlgSave = new System.Windows.Forms.SaveFileDialog();
|
||||
dlgOpen = new System.Windows.Forms.OpenFileDialog();
|
||||
btnBaseline = new System.Windows.Forms.Button();
|
||||
@@ -103,15 +113,23 @@
|
||||
chkTopSide = new System.Windows.Forms.CheckBox();
|
||||
chkHexCodes = new System.Windows.Forms.CheckBox();
|
||||
chkRectSelect = new System.Windows.Forms.CheckBox();
|
||||
nudBrush = new System.Windows.Forms.NumericUpDown();
|
||||
label3 = new System.Windows.Forms.Label();
|
||||
lblSelectionLabel = new System.Windows.Forms.Label();
|
||||
lblSelection = new System.Windows.Forms.Label();
|
||||
lblModified = new System.Windows.Forms.Label();
|
||||
dlgSavePNG = new System.Windows.Forms.SaveFileDialog();
|
||||
pnlRightButtons = new System.Windows.Forms.Panel();
|
||||
lblBrush = new System.Windows.Forms.Label();
|
||||
pnlInfo = new System.Windows.Forms.Panel();
|
||||
((System.ComponentModel.ISupportInitialize)nudX).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)nudY).BeginInit();
|
||||
panel1.SuspendLayout();
|
||||
cmMinilist.SuspendLayout();
|
||||
menuStrip1.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)nudBrush).BeginInit();
|
||||
pnlRightButtons.SuspendLayout();
|
||||
pnlInfo.SuspendLayout();
|
||||
SuspendLayout();
|
||||
//
|
||||
// dotPanel
|
||||
@@ -131,8 +149,7 @@
|
||||
//
|
||||
// nudX
|
||||
//
|
||||
nudX.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right;
|
||||
nudX.Location = new System.Drawing.Point(777, 31);
|
||||
nudX.Location = new System.Drawing.Point(59, 3);
|
||||
nudX.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
|
||||
nudX.Maximum = new decimal(new int[] { 255, 0, 0, 0 });
|
||||
nudX.Name = "nudX";
|
||||
@@ -144,8 +161,7 @@
|
||||
//
|
||||
// nudY
|
||||
//
|
||||
nudY.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right;
|
||||
nudY.Location = new System.Drawing.Point(777, 57);
|
||||
nudY.Location = new System.Drawing.Point(59, 27);
|
||||
nudY.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
|
||||
nudY.Maximum = new decimal(new int[] { 255, 0, 0, 0 });
|
||||
nudY.Minimum = new decimal(new int[] { 1, 0, 0, 0 });
|
||||
@@ -156,32 +172,29 @@
|
||||
nudY.Value = new decimal(new int[] { 32, 0, 0, 0 });
|
||||
nudY.ValueChanged += nudY_ValueChanged;
|
||||
//
|
||||
// label1
|
||||
// lblWidth
|
||||
//
|
||||
label1.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right;
|
||||
label1.AutoSize = true;
|
||||
label1.Location = new System.Drawing.Point(726, 33);
|
||||
label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||
label1.Name = "label1";
|
||||
label1.Size = new System.Drawing.Size(42, 15);
|
||||
label1.TabIndex = 3;
|
||||
label1.Text = "Width:";
|
||||
lblWidth.AutoSize = true;
|
||||
lblWidth.Location = new System.Drawing.Point(8, 5);
|
||||
lblWidth.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||
lblWidth.Name = "lblWidth";
|
||||
lblWidth.Size = new System.Drawing.Size(42, 15);
|
||||
lblWidth.TabIndex = 3;
|
||||
lblWidth.Text = "Width:";
|
||||
//
|
||||
// label2
|
||||
// lblHeight
|
||||
//
|
||||
label2.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right;
|
||||
label2.AutoSize = true;
|
||||
label2.Location = new System.Drawing.Point(722, 59);
|
||||
label2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||
label2.Name = "label2";
|
||||
label2.Size = new System.Drawing.Size(46, 15);
|
||||
label2.TabIndex = 4;
|
||||
label2.Text = "Height:";
|
||||
lblHeight.AutoSize = true;
|
||||
lblHeight.Location = new System.Drawing.Point(4, 29);
|
||||
lblHeight.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||
lblHeight.Name = "lblHeight";
|
||||
lblHeight.Size = new System.Drawing.Size(46, 15);
|
||||
lblHeight.TabIndex = 4;
|
||||
lblHeight.Text = "Height:";
|
||||
//
|
||||
// lblType
|
||||
//
|
||||
lblType.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right;
|
||||
lblType.Location = new System.Drawing.Point(718, 159);
|
||||
lblType.Location = new System.Drawing.Point(2, 136);
|
||||
lblType.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||
lblType.Name = "lblType";
|
||||
lblType.Size = new System.Drawing.Size(181, 15);
|
||||
@@ -195,7 +208,7 @@
|
||||
cbZoom.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
cbZoom.FormattingEnabled = true;
|
||||
cbZoom.Items.AddRange(new object[] { "2", "3", "5", "10", "15", "20", "25", "30", "35", "40", "45", "50" });
|
||||
cbZoom.Location = new System.Drawing.Point(619, 52);
|
||||
cbZoom.Location = new System.Drawing.Point(7, 28);
|
||||
cbZoom.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
|
||||
cbZoom.Name = "cbZoom";
|
||||
cbZoom.Size = new System.Drawing.Size(75, 23);
|
||||
@@ -207,7 +220,7 @@
|
||||
//
|
||||
label4.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right;
|
||||
label4.AutoSize = true;
|
||||
label4.Location = new System.Drawing.Point(618, 33);
|
||||
label4.Location = new System.Drawing.Point(6, 9);
|
||||
label4.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||
label4.Name = "label4";
|
||||
label4.Size = new System.Drawing.Size(69, 15);
|
||||
@@ -352,9 +365,8 @@
|
||||
//
|
||||
// btnExport
|
||||
//
|
||||
btnExport.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right;
|
||||
btnExport.Image = Properties.Resources.z_export;
|
||||
btnExport.Location = new System.Drawing.Point(812, 126);
|
||||
btnExport.Location = new System.Drawing.Point(94, 109);
|
||||
btnExport.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
|
||||
btnExport.Name = "btnExport";
|
||||
btnExport.Size = new System.Drawing.Size(88, 27);
|
||||
@@ -364,7 +376,7 @@
|
||||
btnExport.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText;
|
||||
toolTip1.SetToolTip(btnExport, "Configure and export data");
|
||||
btnExport.UseVisualStyleBackColor = true;
|
||||
btnExport.Click += button1_Click;
|
||||
btnExport.Click += Export_Click;
|
||||
//
|
||||
// miniList
|
||||
//
|
||||
@@ -470,9 +482,8 @@
|
||||
//
|
||||
// btnApply
|
||||
//
|
||||
btnApply.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right;
|
||||
btnApply.Image = Properties.Resources.z_tick;
|
||||
btnApply.Location = new System.Drawing.Point(718, 126);
|
||||
btnApply.Location = new System.Drawing.Point(4, 109);
|
||||
btnApply.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
|
||||
btnApply.Name = "btnApply";
|
||||
btnApply.Size = new System.Drawing.Size(88, 27);
|
||||
@@ -487,7 +498,10 @@
|
||||
// hScroll
|
||||
//
|
||||
hScroll.Anchor = System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right;
|
||||
hScroll.Enabled = false;
|
||||
hScroll.LargeChange = 2;
|
||||
hScroll.Location = new System.Drawing.Point(14, 609);
|
||||
hScroll.Maximum = 1;
|
||||
hScroll.Name = "hScroll";
|
||||
hScroll.Size = new System.Drawing.Size(427, 21);
|
||||
hScroll.TabIndex = 14;
|
||||
@@ -496,8 +510,10 @@
|
||||
// vScroll
|
||||
//
|
||||
vScroll.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right;
|
||||
vScroll.LargeChange = 25;
|
||||
vScroll.Enabled = false;
|
||||
vScroll.LargeChange = 2;
|
||||
vScroll.Location = new System.Drawing.Point(444, 31);
|
||||
vScroll.Maximum = 1;
|
||||
vScroll.Name = "vScroll";
|
||||
vScroll.Size = new System.Drawing.Size(21, 575);
|
||||
vScroll.TabIndex = 15;
|
||||
@@ -507,7 +523,7 @@
|
||||
//
|
||||
lblCoords.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right;
|
||||
lblCoords.AutoSize = true;
|
||||
lblCoords.Location = new System.Drawing.Point(616, 138);
|
||||
lblCoords.Location = new System.Drawing.Point(4, 114);
|
||||
lblCoords.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||
lblCoords.Name = "lblCoords";
|
||||
lblCoords.Size = new System.Drawing.Size(24, 15);
|
||||
@@ -517,7 +533,7 @@
|
||||
//
|
||||
// menuStrip1
|
||||
//
|
||||
menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { fileToolStripMenuItem, editToolStripMenuItem, fontToolStripMenuItem, canvasToolStripMenuItem, aboutToolStripMenuItem });
|
||||
menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { fileToolStripMenuItem, editToolStripMenuItem, fontToolStripMenuItem, canvasToolStripMenuItem, aboutToolStripMenuItem, toggleBarToolStripMenuItem });
|
||||
menuStrip1.Location = new System.Drawing.Point(0, 0);
|
||||
menuStrip1.Name = "menuStrip1";
|
||||
menuStrip1.Padding = new System.Windows.Forms.Padding(7, 2, 0, 2);
|
||||
@@ -527,7 +543,7 @@
|
||||
//
|
||||
// fileToolStripMenuItem
|
||||
//
|
||||
fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { newToolStripMenuItem, openToolStripMenuItem, saveToolStripMenuItem, saveAsToolStripMenuItem, importTextToolStripMenuItem1, importImageToolStripMenuItem, exportToolStripMenuItem, exitToolStripMenuItem });
|
||||
fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { newToolStripMenuItem, openToolStripMenuItem, saveToolStripMenuItem, saveAsToolStripMenuItem, toolStripSeparator1, importTextToolStripMenuItem1, importImageToolStripMenuItem, exportToolStripMenuItem, exportFontLayoutPNGToolStripMenuItem, toolStripSeparator2, exitToolStripMenuItem });
|
||||
fileToolStripMenuItem.Name = "fileToolStripMenuItem";
|
||||
fileToolStripMenuItem.Size = new System.Drawing.Size(37, 20);
|
||||
fileToolStripMenuItem.Text = "File";
|
||||
@@ -576,12 +592,18 @@
|
||||
saveAsToolStripMenuItem.ToolTipText = "Save changes to another file";
|
||||
saveAsToolStripMenuItem.Click += SaveToolStripMenuItem_Click;
|
||||
//
|
||||
// toolStripSeparator1
|
||||
//
|
||||
toolStripSeparator1.Name = "toolStripSeparator1";
|
||||
toolStripSeparator1.Size = new System.Drawing.Size(221, 6);
|
||||
//
|
||||
// importTextToolStripMenuItem1
|
||||
//
|
||||
importTextToolStripMenuItem1.Image = Properties.Resources.folder_table;
|
||||
importTextToolStripMenuItem1.Name = "importTextToolStripMenuItem1";
|
||||
importTextToolStripMenuItem1.Size = new System.Drawing.Size(224, 22);
|
||||
importTextToolStripMenuItem1.Text = "Import text file (very limited)";
|
||||
importTextToolStripMenuItem1.ToolTipText = "Import a font from a C array in a file";
|
||||
importTextToolStripMenuItem1.Click += importTextToolStripMenuItem1_Click;
|
||||
//
|
||||
// importImageToolStripMenuItem
|
||||
@@ -602,7 +624,21 @@
|
||||
exportToolStripMenuItem.Size = new System.Drawing.Size(224, 22);
|
||||
exportToolStripMenuItem.Text = "Export";
|
||||
exportToolStripMenuItem.ToolTipText = "Configure and export data";
|
||||
exportToolStripMenuItem.Click += button1_Click;
|
||||
exportToolStripMenuItem.Click += Export_Click;
|
||||
//
|
||||
// exportFontLayoutPNGToolStripMenuItem
|
||||
//
|
||||
exportFontLayoutPNGToolStripMenuItem.Image = Properties.Resources.picture_go;
|
||||
exportFontLayoutPNGToolStripMenuItem.Name = "exportFontLayoutPNGToolStripMenuItem";
|
||||
exportFontLayoutPNGToolStripMenuItem.Size = new System.Drawing.Size(224, 22);
|
||||
exportFontLayoutPNGToolStripMenuItem.Text = "Export font layout PNG";
|
||||
exportFontLayoutPNGToolStripMenuItem.ToolTipText = "Create an image with all a table showing all 256 symbols";
|
||||
exportFontLayoutPNGToolStripMenuItem.Click += ExportPNG;
|
||||
//
|
||||
// toolStripSeparator2
|
||||
//
|
||||
toolStripSeparator2.Name = "toolStripSeparator2";
|
||||
toolStripSeparator2.Size = new System.Drawing.Size(221, 6);
|
||||
//
|
||||
// exitToolStripMenuItem
|
||||
//
|
||||
@@ -656,7 +692,6 @@
|
||||
//
|
||||
// pasteToolStripMenuItem
|
||||
//
|
||||
pasteToolStripMenuItem.Enabled = false;
|
||||
pasteToolStripMenuItem.Image = Properties.Resources.Famfamfam_Silk_Page_paste_16;
|
||||
pasteToolStripMenuItem.Name = "pasteToolStripMenuItem";
|
||||
pasteToolStripMenuItem.ShortcutKeyDisplayString = "";
|
||||
@@ -673,6 +708,7 @@
|
||||
selectToolStripMenuItem.ShortcutKeys = System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.R;
|
||||
selectToolStripMenuItem.Size = new System.Drawing.Size(164, 22);
|
||||
selectToolStripMenuItem.Text = "Select";
|
||||
selectToolStripMenuItem.ToolTipText = "Toggle Rectangle selection tool";
|
||||
selectToolStripMenuItem.Click += selectToolStripMenuItem_Click;
|
||||
//
|
||||
// selectAllToolStripMenuItem
|
||||
@@ -683,20 +719,22 @@
|
||||
selectAllToolStripMenuItem.ShortcutKeys = System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.A;
|
||||
selectAllToolStripMenuItem.Size = new System.Drawing.Size(164, 22);
|
||||
selectAllToolStripMenuItem.Text = "Select All";
|
||||
selectAllToolStripMenuItem.ToolTipText = "Select entire canvas";
|
||||
selectAllToolStripMenuItem.Click += selectAllToolStripMenuItem_Click;
|
||||
//
|
||||
// fontToolStripMenuItem
|
||||
//
|
||||
fontToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { makeVarWidthToolStripMenuItem, prependSymbolToolStripMenuItem, appendSymbolToolStripMenuItem, removeSymbolToolStripMenuItem, removeBeforeToolStripMenuItem, removeAfterToolStripMenuItem, CodeShiftToolStripMenuItem });
|
||||
fontToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { makeVarWidthToolStripMenuItem, prependSymbolToolStripMenuItem, appendSymbolToolStripMenuItem, removeSymbolToolStripMenuItem, removeBeforeToolStripMenuItem, removeAfterToolStripMenuItem, zerofyWidthToolStripMenuItem, CodeShiftToolStripMenuItem, toolStripSeparator3, previousSymbolToolStripMenuItem, nextSymbolToolStripMenuItem, toolStripSeparator4, testFontToolStripMenuItem });
|
||||
fontToolStripMenuItem.Name = "fontToolStripMenuItem";
|
||||
fontToolStripMenuItem.Size = new System.Drawing.Size(43, 20);
|
||||
fontToolStripMenuItem.Text = "Font";
|
||||
fontToolStripMenuItem.DropDownOpening += fontToolStripMenuItem_DropDownOpening;
|
||||
//
|
||||
// makeVarWidthToolStripMenuItem
|
||||
//
|
||||
makeVarWidthToolStripMenuItem.Image = Properties.Resources.z_asterisk;
|
||||
makeVarWidthToolStripMenuItem.Name = "makeVarWidthToolStripMenuItem";
|
||||
makeVarWidthToolStripMenuItem.Size = new System.Drawing.Size(215, 22);
|
||||
makeVarWidthToolStripMenuItem.Size = new System.Drawing.Size(241, 22);
|
||||
makeVarWidthToolStripMenuItem.Text = "Make Variable Width";
|
||||
makeVarWidthToolStripMenuItem.ToolTipText = "Make Font Variable width one";
|
||||
makeVarWidthToolStripMenuItem.Visible = false;
|
||||
@@ -709,7 +747,7 @@
|
||||
prependSymbolToolStripMenuItem.Name = "prependSymbolToolStripMenuItem";
|
||||
prependSymbolToolStripMenuItem.ShortcutKeyDisplayString = "Ctrl+Ins";
|
||||
prependSymbolToolStripMenuItem.ShortcutKeys = System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Insert;
|
||||
prependSymbolToolStripMenuItem.Size = new System.Drawing.Size(215, 22);
|
||||
prependSymbolToolStripMenuItem.Size = new System.Drawing.Size(241, 22);
|
||||
prependSymbolToolStripMenuItem.Text = "Prepend symbol";
|
||||
prependSymbolToolStripMenuItem.ToolTipText = "Add a symbol to the beginning of the sequence";
|
||||
prependSymbolToolStripMenuItem.Click += prependSymbolToolStripMenuItem_Click;
|
||||
@@ -721,7 +759,7 @@
|
||||
appendSymbolToolStripMenuItem.Name = "appendSymbolToolStripMenuItem";
|
||||
appendSymbolToolStripMenuItem.ShortcutKeyDisplayString = "";
|
||||
appendSymbolToolStripMenuItem.ShortcutKeys = System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.End;
|
||||
appendSymbolToolStripMenuItem.Size = new System.Drawing.Size(215, 22);
|
||||
appendSymbolToolStripMenuItem.Size = new System.Drawing.Size(241, 22);
|
||||
appendSymbolToolStripMenuItem.Text = "Append symbol";
|
||||
appendSymbolToolStripMenuItem.ToolTipText = "Add a symbol to the end of the sequence";
|
||||
appendSymbolToolStripMenuItem.Click += prependSymbolToolStripMenuItem_Click;
|
||||
@@ -733,7 +771,7 @@
|
||||
removeSymbolToolStripMenuItem.Name = "removeSymbolToolStripMenuItem";
|
||||
removeSymbolToolStripMenuItem.ShortcutKeyDisplayString = "";
|
||||
removeSymbolToolStripMenuItem.ShortcutKeys = System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Delete;
|
||||
removeSymbolToolStripMenuItem.Size = new System.Drawing.Size(215, 22);
|
||||
removeSymbolToolStripMenuItem.Size = new System.Drawing.Size(241, 22);
|
||||
removeSymbolToolStripMenuItem.Text = "Remove symbol";
|
||||
removeSymbolToolStripMenuItem.ToolTipText = "Remove current symbol (works only for first or last symbol in the sequence)";
|
||||
removeSymbolToolStripMenuItem.Click += removeSymbolToolStripMenuItem_Click;
|
||||
@@ -743,7 +781,7 @@
|
||||
removeBeforeToolStripMenuItem.Enabled = false;
|
||||
removeBeforeToolStripMenuItem.Image = Properties.Resources.delete;
|
||||
removeBeforeToolStripMenuItem.Name = "removeBeforeToolStripMenuItem";
|
||||
removeBeforeToolStripMenuItem.Size = new System.Drawing.Size(215, 22);
|
||||
removeBeforeToolStripMenuItem.Size = new System.Drawing.Size(241, 22);
|
||||
removeBeforeToolStripMenuItem.Text = "Remove all before selected";
|
||||
removeBeforeToolStripMenuItem.ToolTipText = "Remove all symbols before current one";
|
||||
removeBeforeToolStripMenuItem.Click += removeBeforeToolStripMenuItem_Click;
|
||||
@@ -753,20 +791,69 @@
|
||||
removeAfterToolStripMenuItem.Enabled = false;
|
||||
removeAfterToolStripMenuItem.Image = Properties.Resources.delete;
|
||||
removeAfterToolStripMenuItem.Name = "removeAfterToolStripMenuItem";
|
||||
removeAfterToolStripMenuItem.Size = new System.Drawing.Size(215, 22);
|
||||
removeAfterToolStripMenuItem.Size = new System.Drawing.Size(241, 22);
|
||||
removeAfterToolStripMenuItem.Text = "Remove all after selected";
|
||||
removeAfterToolStripMenuItem.ToolTipText = "Remove all symbols after current one";
|
||||
removeAfterToolStripMenuItem.Click += removeAfterToolStripMenuItem_Click;
|
||||
//
|
||||
// zerofyWidthToolStripMenuItem
|
||||
//
|
||||
zerofyWidthToolStripMenuItem.Enabled = false;
|
||||
zerofyWidthToolStripMenuItem.Image = Properties.Resources.text_letterspacing2;
|
||||
zerofyWidthToolStripMenuItem.Name = "zerofyWidthToolStripMenuItem";
|
||||
zerofyWidthToolStripMenuItem.Size = new System.Drawing.Size(241, 22);
|
||||
zerofyWidthToolStripMenuItem.Text = "Make all blank symbols 0-width";
|
||||
zerofyWidthToolStripMenuItem.ToolTipText = "Make width equals zero for all blank symbols (except code 32 (space))";
|
||||
zerofyWidthToolStripMenuItem.Click += ZerofyBlankWidth;
|
||||
//
|
||||
// CodeShiftToolStripMenuItem
|
||||
//
|
||||
CodeShiftToolStripMenuItem.Image = Properties.Resources.z_align_center;
|
||||
CodeShiftToolStripMenuItem.Name = "CodeShiftToolStripMenuItem";
|
||||
CodeShiftToolStripMenuItem.Size = new System.Drawing.Size(215, 22);
|
||||
CodeShiftToolStripMenuItem.Size = new System.Drawing.Size(241, 22);
|
||||
CodeShiftToolStripMenuItem.Text = "Code shift";
|
||||
CodeShiftToolStripMenuItem.ToolTipText = "Shift the font on the code line";
|
||||
CodeShiftToolStripMenuItem.Click += CodeShiftToolStripMenuItem_Click;
|
||||
//
|
||||
// toolStripSeparator3
|
||||
//
|
||||
toolStripSeparator3.Name = "toolStripSeparator3";
|
||||
toolStripSeparator3.Size = new System.Drawing.Size(238, 6);
|
||||
//
|
||||
// previousSymbolToolStripMenuItem
|
||||
//
|
||||
previousSymbolToolStripMenuItem.Image = Properties.Resources.arrow_turn_left;
|
||||
previousSymbolToolStripMenuItem.Name = "previousSymbolToolStripMenuItem";
|
||||
previousSymbolToolStripMenuItem.ShortcutKeys = System.Windows.Forms.Keys.Alt | System.Windows.Forms.Keys.Left;
|
||||
previousSymbolToolStripMenuItem.Size = new System.Drawing.Size(241, 22);
|
||||
previousSymbolToolStripMenuItem.Text = "Previous Symbol";
|
||||
previousSymbolToolStripMenuItem.ToolTipText = "Select previous symbol";
|
||||
previousSymbolToolStripMenuItem.Click += previousSymbolToolStripMenuItem_Click;
|
||||
//
|
||||
// nextSymbolToolStripMenuItem
|
||||
//
|
||||
nextSymbolToolStripMenuItem.Image = Properties.Resources.arrow_turn_right;
|
||||
nextSymbolToolStripMenuItem.Name = "nextSymbolToolStripMenuItem";
|
||||
nextSymbolToolStripMenuItem.ShortcutKeys = System.Windows.Forms.Keys.Alt | System.Windows.Forms.Keys.Right;
|
||||
nextSymbolToolStripMenuItem.Size = new System.Drawing.Size(241, 22);
|
||||
nextSymbolToolStripMenuItem.Text = "Next symbol";
|
||||
nextSymbolToolStripMenuItem.ToolTipText = "Select next symbol";
|
||||
nextSymbolToolStripMenuItem.Click += nextSymbolToolStripMenuItem_Click;
|
||||
//
|
||||
// toolStripSeparator4
|
||||
//
|
||||
toolStripSeparator4.Name = "toolStripSeparator4";
|
||||
toolStripSeparator4.Size = new System.Drawing.Size(238, 6);
|
||||
//
|
||||
// testFontToolStripMenuItem
|
||||
//
|
||||
testFontToolStripMenuItem.Image = Properties.Resources.font;
|
||||
testFontToolStripMenuItem.Name = "testFontToolStripMenuItem";
|
||||
testFontToolStripMenuItem.Size = new System.Drawing.Size(241, 22);
|
||||
testFontToolStripMenuItem.Text = "Test font";
|
||||
testFontToolStripMenuItem.ToolTipText = "Open dialog where you can test the font with any text you type";
|
||||
testFontToolStripMenuItem.Click += TestFont_Click;
|
||||
//
|
||||
// canvasToolStripMenuItem
|
||||
//
|
||||
canvasToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { ClearToolStripMenuItem, FillToolStripMenuItem, shiftUpToolStripMenuItem, shiftDownToolStripMenuItem, shiftLeftToolStripMenuItem, shiftRightToolStripMenuItem, invertToolStripMenuItem, mirrorXToolStripMenuItem, mirrorYToolStripMenuItem, applyToolStripMenuItem });
|
||||
@@ -888,6 +975,16 @@
|
||||
aboutToolStripMenuItem.Text = "About";
|
||||
aboutToolStripMenuItem.Click += aboutToolStripMenuItem_Click;
|
||||
//
|
||||
// toggleBarToolStripMenuItem
|
||||
//
|
||||
toggleBarToolStripMenuItem.Alignment = System.Windows.Forms.ToolStripItemAlignment.Right;
|
||||
toggleBarToolStripMenuItem.CheckOnClick = true;
|
||||
toggleBarToolStripMenuItem.Name = "toggleBarToolStripMenuItem";
|
||||
toggleBarToolStripMenuItem.Size = new System.Drawing.Size(35, 20);
|
||||
toggleBarToolStripMenuItem.Text = ">>";
|
||||
toggleBarToolStripMenuItem.ToolTipText = "Toggle side bar state";
|
||||
toggleBarToolStripMenuItem.Click += toggleBarToolStripMenuItem_Click;
|
||||
//
|
||||
// dlgSave
|
||||
//
|
||||
dlgSave.DefaultExt = "mbf";
|
||||
@@ -900,10 +997,9 @@
|
||||
//
|
||||
// btnBaseline
|
||||
//
|
||||
btnBaseline.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right;
|
||||
btnBaseline.Image = Properties.Resources.fam_base;
|
||||
btnBaseline.ImageAlign = System.Drawing.ContentAlignment.MiddleRight;
|
||||
btnBaseline.Location = new System.Drawing.Point(812, 93);
|
||||
btnBaseline.Location = new System.Drawing.Point(94, 81);
|
||||
btnBaseline.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
|
||||
btnBaseline.Name = "btnBaseline";
|
||||
btnBaseline.Size = new System.Drawing.Size(88, 27);
|
||||
@@ -922,9 +1018,8 @@
|
||||
//
|
||||
// chkLeftSide
|
||||
//
|
||||
chkLeftSide.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right;
|
||||
chkLeftSide.AutoSize = true;
|
||||
chkLeftSide.Location = new System.Drawing.Point(831, 33);
|
||||
chkLeftSide.Location = new System.Drawing.Point(113, 5);
|
||||
chkLeftSide.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
|
||||
chkLeftSide.Name = "chkLeftSide";
|
||||
chkLeftSide.Size = new System.Drawing.Size(70, 19);
|
||||
@@ -935,9 +1030,8 @@
|
||||
//
|
||||
// chkTopSide
|
||||
//
|
||||
chkTopSide.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right;
|
||||
chkTopSide.AutoSize = true;
|
||||
chkTopSide.Location = new System.Drawing.Point(831, 58);
|
||||
chkTopSide.Location = new System.Drawing.Point(113, 28);
|
||||
chkTopSide.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
|
||||
chkTopSide.Name = "chkTopSide";
|
||||
chkTopSide.Size = new System.Drawing.Size(70, 19);
|
||||
@@ -950,7 +1044,7 @@
|
||||
//
|
||||
chkHexCodes.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right;
|
||||
chkHexCodes.AutoSize = true;
|
||||
chkHexCodes.Location = new System.Drawing.Point(618, 155);
|
||||
chkHexCodes.Location = new System.Drawing.Point(6, 131);
|
||||
chkHexCodes.Name = "chkHexCodes";
|
||||
chkHexCodes.Size = new System.Drawing.Size(95, 19);
|
||||
chkHexCodes.TabIndex = 22;
|
||||
@@ -961,13 +1055,12 @@
|
||||
//
|
||||
// chkRectSelect
|
||||
//
|
||||
chkRectSelect.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right;
|
||||
chkRectSelect.Appearance = System.Windows.Forms.Appearance.Button;
|
||||
chkRectSelect.Image = Properties.Resources.fam_rectt;
|
||||
chkRectSelect.ImageAlign = System.Drawing.ContentAlignment.MiddleRight;
|
||||
chkRectSelect.Location = new System.Drawing.Point(718, 93);
|
||||
chkRectSelect.Location = new System.Drawing.Point(4, 81);
|
||||
chkRectSelect.Name = "chkRectSelect";
|
||||
chkRectSelect.Size = new System.Drawing.Size(87, 27);
|
||||
chkRectSelect.Size = new System.Drawing.Size(88, 27);
|
||||
chkRectSelect.TabIndex = 23;
|
||||
chkRectSelect.Text = " Select";
|
||||
chkRectSelect.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
|
||||
@@ -976,11 +1069,24 @@
|
||||
chkRectSelect.UseVisualStyleBackColor = true;
|
||||
chkRectSelect.CheckedChanged += chkRectSelect_CheckedChanged;
|
||||
//
|
||||
// nudBrush
|
||||
//
|
||||
nudBrush.Location = new System.Drawing.Point(59, 51);
|
||||
nudBrush.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
|
||||
nudBrush.Maximum = new decimal(new int[] { 32, 0, 0, 0 });
|
||||
nudBrush.Minimum = new decimal(new int[] { 1, 0, 0, 0 });
|
||||
nudBrush.Name = "nudBrush";
|
||||
nudBrush.Size = new System.Drawing.Size(47, 23);
|
||||
nudBrush.TabIndex = 24;
|
||||
toolTip1.SetToolTip(nudBrush, "Symbol height");
|
||||
nudBrush.Value = new decimal(new int[] { 1, 0, 0, 0 });
|
||||
nudBrush.ValueChanged += nudBrush_ValueChanged;
|
||||
//
|
||||
// label3
|
||||
//
|
||||
label3.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right;
|
||||
label3.AutoSize = true;
|
||||
label3.Location = new System.Drawing.Point(615, 123);
|
||||
label3.Location = new System.Drawing.Point(3, 99);
|
||||
label3.Name = "label3";
|
||||
label3.Size = new System.Drawing.Size(45, 15);
|
||||
label3.TabIndex = 21;
|
||||
@@ -990,7 +1096,7 @@
|
||||
//
|
||||
lblSelectionLabel.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right;
|
||||
lblSelectionLabel.AutoSize = true;
|
||||
lblSelectionLabel.Location = new System.Drawing.Point(616, 93);
|
||||
lblSelectionLabel.Location = new System.Drawing.Point(4, 69);
|
||||
lblSelectionLabel.Name = "lblSelectionLabel";
|
||||
lblSelectionLabel.Size = new System.Drawing.Size(58, 15);
|
||||
lblSelectionLabel.TabIndex = 25;
|
||||
@@ -1001,7 +1107,7 @@
|
||||
//
|
||||
lblSelection.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right;
|
||||
lblSelection.AutoSize = true;
|
||||
lblSelection.Location = new System.Drawing.Point(617, 108);
|
||||
lblSelection.Location = new System.Drawing.Point(5, 84);
|
||||
lblSelection.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||
lblSelection.Name = "lblSelection";
|
||||
lblSelection.Size = new System.Drawing.Size(30, 15);
|
||||
@@ -1016,41 +1122,78 @@
|
||||
lblModified.AutoSize = true;
|
||||
lblModified.Font = new System.Drawing.Font("Segoe UI Semibold", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, 204);
|
||||
lblModified.ForeColor = System.Drawing.SystemColors.Highlight;
|
||||
lblModified.Location = new System.Drawing.Point(616, 78);
|
||||
lblModified.Location = new System.Drawing.Point(4, 54);
|
||||
lblModified.Name = "lblModified";
|
||||
lblModified.Size = new System.Drawing.Size(91, 15);
|
||||
lblModified.TabIndex = 26;
|
||||
lblModified.Text = "Frame modified";
|
||||
lblModified.Visible = false;
|
||||
//
|
||||
// dlgSavePNG
|
||||
//
|
||||
dlgSavePNG.DefaultExt = "png";
|
||||
dlgSavePNG.Filter = "PNG Image|*.png;*.PNG";
|
||||
//
|
||||
// pnlRightButtons
|
||||
//
|
||||
pnlRightButtons.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right;
|
||||
pnlRightButtons.Controls.Add(nudBrush);
|
||||
pnlRightButtons.Controls.Add(lblBrush);
|
||||
pnlRightButtons.Controls.Add(chkLeftSide);
|
||||
pnlRightButtons.Controls.Add(nudX);
|
||||
pnlRightButtons.Controls.Add(nudY);
|
||||
pnlRightButtons.Controls.Add(lblWidth);
|
||||
pnlRightButtons.Controls.Add(lblHeight);
|
||||
pnlRightButtons.Controls.Add(chkRectSelect);
|
||||
pnlRightButtons.Controls.Add(lblType);
|
||||
pnlRightButtons.Controls.Add(btnExport);
|
||||
pnlRightButtons.Controls.Add(btnApply);
|
||||
pnlRightButtons.Controls.Add(chkTopSide);
|
||||
pnlRightButtons.Controls.Add(btnBaseline);
|
||||
pnlRightButtons.Location = new System.Drawing.Point(715, 24);
|
||||
pnlRightButtons.Margin = new System.Windows.Forms.Padding(0);
|
||||
pnlRightButtons.Name = "pnlRightButtons";
|
||||
pnlRightButtons.Size = new System.Drawing.Size(184, 154);
|
||||
pnlRightButtons.TabIndex = 27;
|
||||
//
|
||||
// lblBrush
|
||||
//
|
||||
lblBrush.AutoSize = true;
|
||||
lblBrush.Location = new System.Drawing.Point(10, 54);
|
||||
lblBrush.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
|
||||
lblBrush.Name = "lblBrush";
|
||||
lblBrush.Size = new System.Drawing.Size(40, 15);
|
||||
lblBrush.TabIndex = 25;
|
||||
lblBrush.Text = "Brush:";
|
||||
//
|
||||
// pnlInfo
|
||||
//
|
||||
pnlInfo.Anchor = System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right;
|
||||
pnlInfo.Controls.Add(label4);
|
||||
pnlInfo.Controls.Add(cbZoom);
|
||||
pnlInfo.Controls.Add(lblCoords);
|
||||
pnlInfo.Controls.Add(lblModified);
|
||||
pnlInfo.Controls.Add(label3);
|
||||
pnlInfo.Controls.Add(lblSelectionLabel);
|
||||
pnlInfo.Controls.Add(chkHexCodes);
|
||||
pnlInfo.Controls.Add(lblSelection);
|
||||
pnlInfo.Location = new System.Drawing.Point(615, 24);
|
||||
pnlInfo.Margin = new System.Windows.Forms.Padding(0);
|
||||
pnlInfo.Name = "pnlInfo";
|
||||
pnlInfo.Size = new System.Drawing.Size(103, 154);
|
||||
pnlInfo.TabIndex = 28;
|
||||
//
|
||||
// MainForm
|
||||
//
|
||||
AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
|
||||
AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
ClientSize = new System.Drawing.Size(915, 647);
|
||||
Controls.Add(lblModified);
|
||||
Controls.Add(lblSelectionLabel);
|
||||
Controls.Add(lblSelection);
|
||||
Controls.Add(chkRectSelect);
|
||||
Controls.Add(chkHexCodes);
|
||||
Controls.Add(label3);
|
||||
Controls.Add(chkTopSide);
|
||||
Controls.Add(chkLeftSide);
|
||||
Controls.Add(btnBaseline);
|
||||
Controls.Add(btnApply);
|
||||
Controls.Add(btnExport);
|
||||
Controls.Add(lblCoords);
|
||||
Controls.Add(pnlInfo);
|
||||
Controls.Add(pnlRightButtons);
|
||||
Controls.Add(vScroll);
|
||||
Controls.Add(hScroll);
|
||||
Controls.Add(miniList);
|
||||
Controls.Add(panel1);
|
||||
Controls.Add(label4);
|
||||
Controls.Add(cbZoom);
|
||||
Controls.Add(lblType);
|
||||
Controls.Add(label2);
|
||||
Controls.Add(label1);
|
||||
Controls.Add(nudY);
|
||||
Controls.Add(nudX);
|
||||
Controls.Add(dotPanel);
|
||||
Controls.Add(menuStrip1);
|
||||
Icon = (System.Drawing.Icon)resources.GetObject("$this.Icon");
|
||||
@@ -1068,6 +1211,11 @@
|
||||
cmMinilist.ResumeLayout(false);
|
||||
menuStrip1.ResumeLayout(false);
|
||||
menuStrip1.PerformLayout();
|
||||
((System.ComponentModel.ISupportInitialize)nudBrush).EndInit();
|
||||
pnlRightButtons.ResumeLayout(false);
|
||||
pnlRightButtons.PerformLayout();
|
||||
pnlInfo.ResumeLayout(false);
|
||||
pnlInfo.PerformLayout();
|
||||
ResumeLayout(false);
|
||||
PerformLayout();
|
||||
|
||||
@@ -1076,10 +1224,8 @@
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.Panel dotPanel;
|
||||
private System.Windows.Forms.NumericUpDown nudX;
|
||||
private System.Windows.Forms.NumericUpDown nudY;
|
||||
private System.Windows.Forms.Label label1;
|
||||
private System.Windows.Forms.Label label2;
|
||||
private System.Windows.Forms.Label lblWidth;
|
||||
private System.Windows.Forms.Label lblHeight;
|
||||
private System.Windows.Forms.Label lblType;
|
||||
private System.Windows.Forms.ComboBox cbZoom;
|
||||
private System.Windows.Forms.Label label4;
|
||||
@@ -1092,8 +1238,6 @@
|
||||
private System.Windows.Forms.Button btnMirrorX;
|
||||
private System.Windows.Forms.Button btnMirrorY;
|
||||
private System.Windows.Forms.Button btnExport;
|
||||
private System.Windows.Forms.ListView miniList;
|
||||
private System.Windows.Forms.ImageList ilMiniatures;
|
||||
private System.Windows.Forms.Button btnApply;
|
||||
private System.Windows.Forms.HScrollBar hScroll;
|
||||
private System.Windows.Forms.VScrollBar vScroll;
|
||||
@@ -1157,6 +1301,25 @@
|
||||
private System.Windows.Forms.Label lblSelection;
|
||||
private System.Windows.Forms.ToolStripMenuItem selectAllToolStripMenuItem;
|
||||
private System.Windows.Forms.Label lblModified;
|
||||
private System.Windows.Forms.ToolStripMenuItem testFontToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem exportFontLayoutPNGToolStripMenuItem;
|
||||
private System.Windows.Forms.SaveFileDialog dlgSavePNG;
|
||||
private System.Windows.Forms.ToolStripSeparator toolStripSeparator1;
|
||||
private System.Windows.Forms.ToolStripSeparator toolStripSeparator2;
|
||||
private System.Windows.Forms.ToolStripSeparator toolStripSeparator3;
|
||||
public System.Windows.Forms.ListView miniList;
|
||||
public System.Windows.Forms.ImageList ilMiniatures;
|
||||
public System.Windows.Forms.NumericUpDown nudX;
|
||||
public System.Windows.Forms.NumericUpDown nudY;
|
||||
private System.Windows.Forms.ToolStripMenuItem previousSymbolToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripMenuItem nextSymbolToolStripMenuItem;
|
||||
private System.Windows.Forms.Panel pnlRightButtons;
|
||||
private System.Windows.Forms.Panel pnlInfo;
|
||||
private System.Windows.Forms.ToolStripMenuItem toggleBarToolStripMenuItem;
|
||||
private System.Windows.Forms.ToolStripSeparator toolStripSeparator4;
|
||||
private System.Windows.Forms.ToolStripMenuItem zerofyWidthToolStripMenuItem;
|
||||
public System.Windows.Forms.NumericUpDown nudBrush;
|
||||
private System.Windows.Forms.Label lblBrush;
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -3,6 +3,7 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.Drawing.Drawing2D;
|
||||
using System.Drawing.Imaging;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Runtime.InteropServices;
|
||||
@@ -46,26 +47,28 @@ namespace McBitFont {
|
||||
public List<FrameMiniature> frames;
|
||||
}
|
||||
|
||||
private FrameMiniature f;
|
||||
public FrameMiniature f;
|
||||
public List<FrameMiniature> frames = new List<FrameMiniature>();
|
||||
private CanvasHistory history = new();
|
||||
//private CanvasHistory history = new();
|
||||
private ChangeHistory history;
|
||||
private int cellSize = 10;
|
||||
public int dotWidth, dotHeight;
|
||||
private int pixelOffset = 5;
|
||||
private readonly int pixelOffset = 5;
|
||||
private int gap;
|
||||
private int w, h;
|
||||
public bool monospaced = false;
|
||||
private bool modified = false;
|
||||
private bool prjModified = false;
|
||||
public const string version = "2.2";
|
||||
public const string version = "2.6";
|
||||
public string prjName = "Untitled";
|
||||
public string prjFileName = "";
|
||||
private int codepage = 1251;
|
||||
public int codepage = 1251;
|
||||
private FrameMiniature fbuf;
|
||||
private bool fbuffer = false;
|
||||
private readonly DataFormats.Format clpbFormat = DataFormats.GetFormat("McBitFontFrame");
|
||||
private int baseline = 0;
|
||||
private bool set_base = false;
|
||||
private Point selection1, selection2;
|
||||
private Point[,] sidebarLocs = new Point[2, 3];
|
||||
|
||||
|
||||
public MainForm() {
|
||||
@@ -74,7 +77,7 @@ namespace McBitFont {
|
||||
this.dotPanel.MouseWheel += new MouseEventHandler(this.DotPanel_MouseWheel);
|
||||
}
|
||||
|
||||
private void SetNewWH() {
|
||||
public void SetNewWH() {
|
||||
w = pixelOffset + dotWidth * (cellSize + gap);
|
||||
h = pixelOffset + dotHeight * (cellSize + gap);
|
||||
}
|
||||
@@ -83,7 +86,7 @@ namespace McBitFont {
|
||||
lblSelection.Text = width.ToString() + ',' + height.ToString();
|
||||
}
|
||||
|
||||
private void SetModified(bool modif = true, bool prj = false) {
|
||||
public void SetModified(bool modif = true, bool prj = false) {
|
||||
string suffix = "";
|
||||
if (prj) {
|
||||
prjModified = modif;
|
||||
@@ -95,6 +98,30 @@ namespace McBitFont {
|
||||
}
|
||||
}
|
||||
|
||||
// Check if a frame is "blank"
|
||||
private static bool IsFrameBlank(FrameMiniature frame) {
|
||||
if (frame.code == 32) return false; // Space character is always blank, so skip it
|
||||
for (int i = 0; i < frame.width; i++) {
|
||||
for (int j = 0; j < frame.height; j++) {
|
||||
if (frame.data[i, j]) return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
// Remember sidebar panels locations
|
||||
private void SideBarRecalc() {
|
||||
|
||||
sidebarLocs[0, 0] = new Point(this.Width - 459, 31);
|
||||
sidebarLocs[0, 1] = new Point(this.Width - 316, 24);
|
||||
sidebarLocs[0, 2] = new Point(this.Width - 487, 31);
|
||||
sidebarLocs[1, 0] = new Point(this.Width - panel1.Width - 70, 180);
|
||||
sidebarLocs[1, 1] = new Point(this.Width - pnlInfo.Width - 110, 320);
|
||||
sidebarLocs[1, 2] = new Point(dotPanel.Width + 17, 31);
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void Form1_Load(object sender, EventArgs e) {
|
||||
lblType.Text = monospaced ? "Monospaced" : "Variable width / Single";
|
||||
tsmiMakeVarWidth.Visible = monospaced;
|
||||
@@ -126,6 +153,8 @@ namespace McBitFont {
|
||||
|
||||
fbuf = new FrameMiniature(0, dotWidth, dotHeight);
|
||||
|
||||
history = new(this);
|
||||
|
||||
// Chek for arguments
|
||||
if (Environment.GetCommandLineArgs().Length > 1) {
|
||||
LoadProject(Environment.GetCommandLineArgs()[1]);
|
||||
@@ -136,6 +165,12 @@ namespace McBitFont {
|
||||
tsmiCodeShift.Visible = frames.Count > 1;
|
||||
CodeShiftToolStripMenuItem.Visible = frames.Count > 1;
|
||||
|
||||
CheckForAdd();
|
||||
|
||||
SideBarRecalc();
|
||||
|
||||
// Create default cursor
|
||||
dotPanel.Cursor = McCursor.GetCursor((int)nudBrush.Value, cellSize, gap);
|
||||
|
||||
}
|
||||
|
||||
@@ -146,9 +181,9 @@ namespace McBitFont {
|
||||
return (int)(((ushort)lowPart) | (uint)(highPart << 16));
|
||||
}
|
||||
|
||||
private FrameMiniature CopyFrame(FrameMiniature frame, bool clipboard = false) {
|
||||
int width = chkRectSelect.Checked ? selection2.X - selection1.X + 1 : frame.width;
|
||||
int height = chkRectSelect.Checked ? selection2.Y - selection1.Y + 1 : frame.height;
|
||||
public FrameMiniature CopyFrame(FrameMiniature frame, bool clipboard = false) {
|
||||
int width = chkRectSelect.Checked && clipboard ? selection2.X - selection1.X + 1 : frame.width;
|
||||
int height = chkRectSelect.Checked && clipboard ? selection2.Y - selection1.Y + 1 : frame.height;
|
||||
var ff = new FrameMiniature(frame.code, width, height);
|
||||
|
||||
if (chkRectSelect.Checked && clipboard) {
|
||||
@@ -183,6 +218,12 @@ namespace McBitFont {
|
||||
if (t > hScroll.Maximum) t = hScroll.Maximum;
|
||||
hScroll.Value = t;
|
||||
}
|
||||
} else if (ModifierKeys.HasFlag(Keys.Alt)) {
|
||||
t += (int)nudBrush.Value;
|
||||
if (t < nudBrush.Minimum) t = (int)nudBrush.Minimum;
|
||||
if (t > nudBrush.Maximum) t = (int)nudBrush.Maximum;
|
||||
if (t > dotWidth || t > dotHeight) t = dotWidth < dotHeight ? dotWidth : dotHeight;
|
||||
nudBrush.Value = t;
|
||||
} else {
|
||||
if (vScroll.Enabled) {
|
||||
t = t * -1 * (cellSize + gap) + vScroll.Value;
|
||||
@@ -193,17 +234,11 @@ namespace McBitFont {
|
||||
}
|
||||
}
|
||||
|
||||
private void nudX_ValueChanged(object sender, EventArgs e) {
|
||||
public void nudX_ValueChanged(object sender, EventArgs e) {
|
||||
Cursor.Current = Cursors.WaitCursor;
|
||||
if (monospaced) {
|
||||
Bitmap bmp;
|
||||
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().PadLeft(3, '0');
|
||||
ilMiniatures.Images.RemoveByKey(s);
|
||||
ilMiniatures.Images.Add(s, (Image)bmp);
|
||||
miniList.Items[s].ImageKey = s;
|
||||
frames[i] = FrameResize(frames[i], (int)nudX.Value, dotHeight, true);
|
||||
}
|
||||
SetModified(true, true);
|
||||
}
|
||||
@@ -212,19 +247,16 @@ namespace McBitFont {
|
||||
}
|
||||
|
||||
DotResize((int)nudX.Value, dotHeight);
|
||||
if (monospaced) history.Add(frames);
|
||||
else history.Add(f);
|
||||
|
||||
Cursor.Current = Cursors.Default;
|
||||
}
|
||||
|
||||
private void nudY_ValueChanged(object sender, EventArgs e) {
|
||||
public void nudY_ValueChanged(object sender, EventArgs e) {
|
||||
Cursor.Current = Cursors.WaitCursor;
|
||||
Bitmap bmp;
|
||||
for (int i = 0; i < frames.Count; i++) {
|
||||
frames[i] = FrameResize(frames[i], frames[i].width, (int)nudY.Value);
|
||||
bmp = GetMiniPictue(frames[i]);
|
||||
string s = frames[i].code.ToString().PadLeft(3, '0');
|
||||
ilMiniatures.Images.RemoveByKey(s);
|
||||
ilMiniatures.Images.Add(s, (Image)bmp);
|
||||
miniList.Items[s].ImageKey = s;
|
||||
frames[i] = FrameResize(frames[i], frames[i].width, (int)nudY.Value, true);
|
||||
}
|
||||
if (nudY.Focused) {
|
||||
SetModified();
|
||||
@@ -232,10 +264,11 @@ namespace McBitFont {
|
||||
}
|
||||
|
||||
DotResize(dotWidth, (int)nudY.Value);
|
||||
history.Add(frames);
|
||||
Cursor.Current = Cursors.Default;
|
||||
}
|
||||
|
||||
private FrameMiniature FrameResize(FrameMiniature ff, int neww, int newh) {
|
||||
private FrameMiniature FrameResize(FrameMiniature ff, int neww, int newh, bool updateMiniList = false) {
|
||||
int oldw = ff.width;
|
||||
int oldh = ff.height;
|
||||
int di = 0, dj = 0;
|
||||
@@ -260,6 +293,15 @@ namespace McBitFont {
|
||||
}
|
||||
ff.data = t;
|
||||
|
||||
// update miniList with images
|
||||
if (updateMiniList) {
|
||||
Bitmap bmp = GetMiniPictue(ff);
|
||||
string s = ff.code.ToString().PadLeft(3, '0');
|
||||
ilMiniatures.Images.RemoveByKey(s);
|
||||
ilMiniatures.Images.Add(s, (Image)bmp);
|
||||
miniList.Items[s].ImageKey = s;
|
||||
}
|
||||
|
||||
return ff;
|
||||
}
|
||||
|
||||
@@ -277,9 +319,6 @@ namespace McBitFont {
|
||||
}
|
||||
SetNewWH();
|
||||
cbZoom_SelectedIndexChanged(cbZoom, null);
|
||||
|
||||
// Re-create history object
|
||||
history = new CanvasHistory();
|
||||
}
|
||||
|
||||
private void cbZoom_SelectedIndexChanged(object sender, EventArgs e) {
|
||||
@@ -290,6 +329,7 @@ namespace McBitFont {
|
||||
if (w <= dotPanel.Width) {
|
||||
hScroll.Enabled = false;
|
||||
hScroll.Value = 0;
|
||||
vScroll.Maximum = 0;
|
||||
} else {
|
||||
hScroll.Maximum = w - dotPanel.Width + 12;
|
||||
hScroll.Minimum = 0;
|
||||
@@ -299,12 +339,14 @@ namespace McBitFont {
|
||||
if (h <= dotPanel.Height) {
|
||||
vScroll.Enabled = false;
|
||||
vScroll.Value = 0;
|
||||
vScroll.Maximum = 0;
|
||||
} else {
|
||||
vScroll.Maximum = h - dotPanel.Height + 12;
|
||||
vScroll.Minimum = 0;
|
||||
vScroll.Enabled = true;
|
||||
}
|
||||
|
||||
dotPanel.Cursor = McCursor.GetCursor((int)nudBrush.Value, cellSize, gap);
|
||||
dotPanel.Refresh();
|
||||
}
|
||||
|
||||
@@ -327,7 +369,6 @@ namespace McBitFont {
|
||||
|
||||
(x, y, x2, y2) = RectSelCoords();
|
||||
|
||||
history.AddPre(f);
|
||||
for (int i = x; i <= x2; i++) {
|
||||
c = f.data[i, y];
|
||||
for (int j = y; j <= y2; j++) {
|
||||
@@ -338,7 +379,7 @@ namespace McBitFont {
|
||||
}
|
||||
}
|
||||
}
|
||||
history.AddPost(f);
|
||||
history.Add(f);
|
||||
CheckHistoryButtons();
|
||||
SetModified();
|
||||
dotPanel.Refresh();
|
||||
@@ -350,7 +391,6 @@ namespace McBitFont {
|
||||
|
||||
(x, y, x2, y2) = RectSelCoords();
|
||||
|
||||
history.AddPre(f);
|
||||
for (int i = x; i <= x2; i++) {
|
||||
c = f.data[i, y2];
|
||||
for (int j = y2; j >= y; j--) {
|
||||
@@ -361,7 +401,7 @@ namespace McBitFont {
|
||||
}
|
||||
}
|
||||
}
|
||||
history.AddPost(f);
|
||||
history.Add(f);
|
||||
CheckHistoryButtons();
|
||||
SetModified();
|
||||
dotPanel.Refresh();
|
||||
@@ -373,7 +413,6 @@ namespace McBitFont {
|
||||
|
||||
(x, y, x2, y2) = RectSelCoords();
|
||||
|
||||
history.AddPre(f);
|
||||
for (int j = y; j <= y2; j++) {
|
||||
c = f.data[x, j];
|
||||
for (int i = x; i <= x2; i++) {
|
||||
@@ -384,7 +423,7 @@ namespace McBitFont {
|
||||
}
|
||||
}
|
||||
}
|
||||
history.AddPost(f);
|
||||
history.Add(f);
|
||||
CheckHistoryButtons();
|
||||
SetModified();
|
||||
dotPanel.Refresh();
|
||||
@@ -395,7 +434,6 @@ namespace McBitFont {
|
||||
bool c;
|
||||
(x, y, x2, y2) = RectSelCoords();
|
||||
|
||||
history.AddPre(f);
|
||||
for (int j = y; j <= y2; j++) {
|
||||
c = f.data[x2, j];
|
||||
for (int i = x2; i >= x; i--) {
|
||||
@@ -406,18 +444,54 @@ namespace McBitFont {
|
||||
}
|
||||
}
|
||||
}
|
||||
history.AddPost(f);
|
||||
history.Add(f);
|
||||
CheckHistoryButtons();
|
||||
SetModified();
|
||||
dotPanel.Refresh();
|
||||
}
|
||||
|
||||
private bool mouseDown = false;
|
||||
private bool fChanged = false;
|
||||
private bool mouseDown = false; // Used in canvas history tracking and rectangle selection logics
|
||||
private bool fChanged = false; // Used in canvas history (undo / redo) tracking
|
||||
private bool mouseDownMiddle = false; // Used in middle mouse dragging logic
|
||||
private int mouseX, mouseY; // To remember last mouse X and Y (used in middle mouse dragging logic)
|
||||
private int lastX = 0, lastY = 0; // Used for drawing straight lines
|
||||
private void dotPanel_MouseMove(object sender, MouseEventArgs e) {
|
||||
var rectSel = chkRectSelect.Checked;
|
||||
bool rectSelUpdated = false;
|
||||
|
||||
// Drag with middle mouse button
|
||||
if (vScroll.Enabled || hScroll.Enabled) {
|
||||
if (mouseDownMiddle) {
|
||||
var dY = mouseY - e.Y <= -cellSize - gap || mouseY - e.Y >= cellSize + gap;
|
||||
var dX = mouseX - e.X <= -cellSize - gap || mouseX - e.X >= cellSize + gap;
|
||||
int newY = vScroll.Value;
|
||||
int newX = hScroll.Value;
|
||||
if (dX) {
|
||||
newX += (mouseX - e.X);
|
||||
if (newX < hScroll.Minimum) newX = hScroll.Minimum;
|
||||
if (newX > hScroll.Maximum) newX = hScroll.Maximum;
|
||||
mouseX = e.X;
|
||||
hScroll.Value = newX;
|
||||
}
|
||||
if (dY) {
|
||||
newY += (mouseY - e.Y);
|
||||
if (newY < vScroll.Minimum) newY = vScroll.Minimum;
|
||||
if (newY > vScroll.Maximum) newY = vScroll.Maximum;
|
||||
mouseY = e.Y;
|
||||
vScroll.Value = newY;
|
||||
}
|
||||
}
|
||||
if (!mouseDownMiddle && e.Button == MouseButtons.Middle) {
|
||||
mouseDownMiddle = true;
|
||||
mouseX = e.X;
|
||||
mouseY = e.Y;
|
||||
}
|
||||
if (mouseDownMiddle && e.Button == MouseButtons.None) {
|
||||
mouseDownMiddle = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Moving baseline
|
||||
Rectangle rect1, rect2;
|
||||
if (set_base) {
|
||||
@@ -456,6 +530,7 @@ namespace McBitFont {
|
||||
}
|
||||
}
|
||||
if (e.Button != MouseButtons.None && !mouseDown) {
|
||||
// Started to move a mouse with button held
|
||||
mouseDown = true;
|
||||
if (rectSel) {
|
||||
selection1.X = i;
|
||||
@@ -463,20 +538,18 @@ namespace McBitFont {
|
||||
selection2.X = i;
|
||||
selection2.Y = j;
|
||||
dotPanel.Invalidate();
|
||||
} else history.AddPre(f, false);
|
||||
}
|
||||
}
|
||||
if (e.Button == MouseButtons.None && mouseDown) {
|
||||
// Released a mouse button
|
||||
mouseDown = false;
|
||||
if (rectSel) {
|
||||
NormPoints(ref selection1, ref selection2);
|
||||
dotPanel.Invalidate();
|
||||
} else {
|
||||
if (!fChanged) {
|
||||
history.Remove(false);
|
||||
} else {
|
||||
if (fChanged) {
|
||||
fChanged = false;
|
||||
history.ApplyAdded();
|
||||
history.AddPost(f);
|
||||
history.Add(f);
|
||||
}
|
||||
CheckHistoryButtons();
|
||||
}
|
||||
@@ -513,33 +586,50 @@ namespace McBitFont {
|
||||
return;
|
||||
}
|
||||
|
||||
// Paint black / white
|
||||
if (e.Button == MouseButtons.Left && !f.data[i, j]) {
|
||||
f.data[i, j] = true;
|
||||
fChanged = true;
|
||||
int x = pixelOffset + i * (cellSize + gap) - hScroll.Value;
|
||||
int y = pixelOffset + j * (cellSize + gap) - vScroll.Value;
|
||||
SetModified();
|
||||
rect1 = new Rectangle(x, y, cellSize, cellSize);
|
||||
dotPanel.Invalidate(rect1);
|
||||
// Check for Shift / Ctrl keys for straight lines
|
||||
if (ModifierKeys.HasFlag(Keys.Shift) && mouseDown) {
|
||||
j = lastY;
|
||||
} else if (ModifierKeys.HasFlag(Keys.Control) && mouseDown) {
|
||||
i = lastX;
|
||||
}
|
||||
if (e.Button == MouseButtons.Right && f.data[i, j]) {
|
||||
f.data[i, j] = false;
|
||||
fChanged = true;
|
||||
int x = pixelOffset + i * (cellSize + gap) - hScroll.Value;
|
||||
int y = pixelOffset + j * (cellSize + gap) - vScroll.Value;
|
||||
SetModified();
|
||||
rect1 = new Rectangle(x, y, cellSize, cellSize);
|
||||
dotPanel.Invalidate(rect1);
|
||||
lastX = i;
|
||||
lastY = j;
|
||||
|
||||
// Paint black / white
|
||||
if (e.Button == MouseButtons.Left) {
|
||||
if (PaintPixel(i, j, true)) fChanged = true;
|
||||
|
||||
}
|
||||
if (e.Button == MouseButtons.Right) {
|
||||
if (PaintPixel(i, j, false)) fChanged = true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private bool PaintPixel(int i, int j, bool color) {
|
||||
bool changed = false;
|
||||
for (int a = 0; a < (int)nudBrush.Value; a++) {
|
||||
if (i + a >= f.width) break;
|
||||
for (int b = 0; b < (int)nudBrush.Value; b++) {
|
||||
if (j + b >= f.height) break;
|
||||
if (f.data[i + a, j + b] != color) {
|
||||
f.data[i + a, j + b] = color;
|
||||
int x = pixelOffset + (i + a) * (cellSize + gap) - hScroll.Value;
|
||||
int y = pixelOffset + (j + b) * (cellSize + gap) - vScroll.Value;
|
||||
Rectangle rect1 = new(x, y, cellSize, cellSize);
|
||||
dotPanel.Invalidate(rect1);
|
||||
SetModified();
|
||||
changed = true;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
return changed;
|
||||
}
|
||||
|
||||
private void btnInvert_Click(object sender, EventArgs e) {
|
||||
int x, y, x2, y2;
|
||||
|
||||
history.AddPre(f);
|
||||
|
||||
(x, y, x2, y2) = RectSelCoords();
|
||||
|
||||
for (int i = x; i <= x2; i++) {
|
||||
@@ -548,7 +638,7 @@ namespace McBitFont {
|
||||
}
|
||||
}
|
||||
|
||||
history.AddPost(f);
|
||||
history.Add(f);
|
||||
CheckHistoryButtons();
|
||||
SetModified();
|
||||
dotPanel.Refresh();
|
||||
@@ -560,7 +650,6 @@ namespace McBitFont {
|
||||
|
||||
(x, y, x2, y2) = RectSelCoords();
|
||||
|
||||
history.AddPre(f);
|
||||
for (j = y; j <= y2; j++) {
|
||||
a = x;
|
||||
b = x2;
|
||||
@@ -572,7 +661,7 @@ namespace McBitFont {
|
||||
b--;
|
||||
}
|
||||
}
|
||||
history.AddPost(f);
|
||||
history.Add(f);
|
||||
CheckHistoryButtons();
|
||||
SetModified();
|
||||
dotPanel.Refresh();
|
||||
@@ -584,7 +673,6 @@ namespace McBitFont {
|
||||
|
||||
(x, y, x2, y2) = RectSelCoords();
|
||||
|
||||
history.AddPre(f);
|
||||
for (i = x; i <= x2; i++) {
|
||||
a = y;
|
||||
b = y2;
|
||||
@@ -596,13 +684,13 @@ namespace McBitFont {
|
||||
b--;
|
||||
}
|
||||
}
|
||||
history.AddPost(f);
|
||||
history.Add(f);
|
||||
CheckHistoryButtons();
|
||||
SetModified();
|
||||
dotPanel.Refresh();
|
||||
}
|
||||
|
||||
private void button1_Click(object sender, EventArgs e) {
|
||||
private void Export_Click(object sender, EventArgs e) {
|
||||
if (modified) {
|
||||
if (MessageBox.Show("Current symbol is modified.\nDo you want to save the changes?", "Symbol was modified!", MessageBoxButtons.YesNo) == DialogResult.Yes) {
|
||||
SaveFrame();
|
||||
@@ -634,7 +722,7 @@ namespace McBitFont {
|
||||
SetModified(true, true);
|
||||
}
|
||||
|
||||
private static Bitmap GetMiniPictue(FrameMiniature m) {
|
||||
public static Bitmap GetMiniPictue(FrameMiniature m) {
|
||||
int picSize = (m.width > m.height) ? m.width : m.height;
|
||||
var bmp = new Bitmap(picSize, picSize);
|
||||
int imin = m.width < picSize ? (picSize - m.width) / 2 : 0;
|
||||
@@ -646,7 +734,7 @@ namespace McBitFont {
|
||||
bmp.SetPixel(i + imin, j + jmin, c);
|
||||
}
|
||||
}
|
||||
Bitmap sbmp = new Bitmap(50, 50);
|
||||
Bitmap sbmp = new(50, 50);
|
||||
using (Graphics g = Graphics.FromImage(sbmp)) {
|
||||
g.InterpolationMode = InterpolationMode.NearestNeighbor;
|
||||
g.PixelOffsetMode = PixelOffsetMode.Half;
|
||||
@@ -767,7 +855,6 @@ namespace McBitFont {
|
||||
FrameMiniature newf;
|
||||
if (form.cbSingle.Checked) {
|
||||
frames.Add(new FrameMiniature(0, neww, newh));
|
||||
//f = frames.Find(x => x.code == 0);
|
||||
append = "Single";
|
||||
monospaced = false;
|
||||
} else {
|
||||
@@ -796,6 +883,7 @@ namespace McBitFont {
|
||||
}
|
||||
makeVarWidthToolStripMenuItem.Visible = monospaced;
|
||||
tsmiMakeVarWidth.Visible = monospaced;
|
||||
zerofyWidthToolStripMenuItem.Enabled = !monospaced;
|
||||
CodeShiftToolStripMenuItem.Visible = !form.cbSingle.Checked;
|
||||
tsmiCodeShift.Visible = !form.cbSingle.Checked;
|
||||
lblType.Text = monospaced ? "Monospaced" : "Variable width / Single";
|
||||
@@ -816,13 +904,11 @@ namespace McBitFont {
|
||||
SetWindowCap();
|
||||
SetModified(false); ;
|
||||
CheckForAdd();
|
||||
fbuffer = false;
|
||||
miniList.Items[0].Selected = true;
|
||||
miniList.Refresh();
|
||||
dotPanel.Refresh();
|
||||
|
||||
// Re-create history object
|
||||
history = new CanvasHistory();
|
||||
history.Clear();
|
||||
|
||||
Cursor.Current = Cursors.Default;
|
||||
}
|
||||
@@ -838,14 +924,10 @@ namespace McBitFont {
|
||||
tsmiRemoveSymbol.Enabled = false;
|
||||
tsmiRemoveBefore.Enabled = false;
|
||||
tsmiRemoveAfter.Enabled = false;
|
||||
//copyToolStripMenuItem.Enabled = false;
|
||||
pasteToolStripMenuItem.Enabled = false;
|
||||
return;
|
||||
//miniList.Items[0].Selected = true;
|
||||
}
|
||||
|
||||
// Clear history
|
||||
history.Clear();
|
||||
return;
|
||||
}
|
||||
dotPanel.SuspendLayout();
|
||||
|
||||
var sel = miniList.SelectedItems[0];
|
||||
int code = Convert.ToInt32(sel.ImageKey);
|
||||
@@ -853,7 +935,10 @@ namespace McBitFont {
|
||||
nudX.Value = ff.width;
|
||||
nudY.Value = ff.height;
|
||||
f = ff;
|
||||
dotPanel.Refresh();
|
||||
|
||||
|
||||
history.Add(code);
|
||||
|
||||
ff = frames.Find(x => x.code == code);
|
||||
if (frames.Count > 1 && (ff.Equals(frames.First()) || ff.Equals(frames.Last()))) {
|
||||
removeSymbolToolStripMenuItem.Enabled = true;
|
||||
@@ -862,26 +947,27 @@ namespace McBitFont {
|
||||
removeSymbolToolStripMenuItem.Enabled = false;
|
||||
tsmiRemoveSymbol.Enabled = false;
|
||||
}
|
||||
//copyToolStripMenuItem.Enabled = true;
|
||||
if (ff.Equals(frames.First())) {
|
||||
|
||||
dotPanel.ResumeLayout();
|
||||
dotPanel.Refresh();
|
||||
|
||||
if (frames.Count > 1 && ff.Equals(frames.First())) {
|
||||
removeBeforeToolStripMenuItem.Enabled = false;
|
||||
removeAfterToolStripMenuItem.Enabled = true;
|
||||
tsmiRemoveBefore.Enabled = false;
|
||||
tsmiRemoveAfter.Enabled = true;
|
||||
} else if (ff.Equals(frames.Last())) {
|
||||
} else if (frames.Count > 1 && ff.Equals(frames.Last())) {
|
||||
removeBeforeToolStripMenuItem.Enabled = true;
|
||||
removeAfterToolStripMenuItem.Enabled = false;
|
||||
tsmiRemoveBefore.Enabled = true;
|
||||
tsmiRemoveAfter.Enabled = false;
|
||||
} else {
|
||||
} else if (frames.Count > 1) {
|
||||
removeBeforeToolStripMenuItem.Enabled = true;
|
||||
removeAfterToolStripMenuItem.Enabled = true;
|
||||
tsmiRemoveBefore.Enabled = true;
|
||||
tsmiRemoveAfter.Enabled = true;
|
||||
}
|
||||
|
||||
if (fbuffer) pasteToolStripMenuItem.Enabled = true;
|
||||
else pasteToolStripMenuItem.Enabled = false;
|
||||
}
|
||||
|
||||
private void SaveToolStripMenuItem_Click(object sender, EventArgs e) {
|
||||
@@ -891,6 +977,16 @@ namespace McBitFont {
|
||||
}
|
||||
}
|
||||
|
||||
public void FillFrameLists() {
|
||||
foreach (FrameMiniature f in frames) {
|
||||
var s = f.code.ToString().PadLeft(3, '0');
|
||||
var sHex = 'x' + Convert.ToString(f.code, 16).PadLeft(2, '0').ToUpper();
|
||||
var sss = DecodeSymbol(f.code);
|
||||
ilMiniatures.Images.Add(s, (Image)GetMiniPictue(f));
|
||||
miniList.Items.Add(s, (chkHexCodes.Checked ? sHex : s) + ' ' + sss, s);
|
||||
}
|
||||
}
|
||||
|
||||
private void LoadProject(string filename) {
|
||||
SaveBlock sav;
|
||||
|
||||
@@ -908,13 +1004,7 @@ namespace McBitFont {
|
||||
tsmiMakeVarWidth.Visible = monospaced;
|
||||
miniList.Items.Clear();
|
||||
ilMiniatures.Images.Clear();
|
||||
foreach (FrameMiniature ff in frames) {
|
||||
var s = ff.code.ToString().PadLeft(3, '0');
|
||||
var sHex = 'x' + Convert.ToString(ff.code, 16).PadLeft(2, '0').ToUpper();
|
||||
var sss = DecodeSymbol(ff.code);
|
||||
ilMiniatures.Images.Add(s, (Image)GetMiniPictue(ff));
|
||||
miniList.Items.Add(s, (chkHexCodes.Checked ? sHex : s) + ' ' + sss, s);
|
||||
}
|
||||
FillFrameLists();
|
||||
nudX.ValueChanged -= nudX_ValueChanged;
|
||||
nudY.ValueChanged -= nudY_ValueChanged;
|
||||
nudX.Value = frames.First().width;
|
||||
@@ -932,19 +1022,19 @@ namespace McBitFont {
|
||||
|
||||
prjFileName = filename;
|
||||
prjName = Path.GetFileNameWithoutExtension(filename);
|
||||
dlgSavePNG.FileName = prjName + ".png";
|
||||
dlgSave.FileName = prjName + ".mbfont";
|
||||
SetWindowCap();
|
||||
|
||||
miniList.Items[0].Selected = true;
|
||||
|
||||
CheckForAdd();
|
||||
fbuffer = false;
|
||||
//copyToolStripMenuItem.Enabled = true;
|
||||
|
||||
// Re-create history object
|
||||
history = new CanvasHistory();
|
||||
history.Clear();
|
||||
|
||||
tsmiMakeVarWidth.Visible = monospaced;
|
||||
makeVarWidthToolStripMenuItem.Visible = monospaced;
|
||||
zerofyWidthToolStripMenuItem.Enabled = !monospaced;
|
||||
tsmiCodeShift.Visible = frames.Count > 1;
|
||||
CodeShiftToolStripMenuItem.Visible = frames.Count > 1;
|
||||
Cursor.Current = Cursors.Default;
|
||||
@@ -961,7 +1051,7 @@ namespace McBitFont {
|
||||
MessagePackSerializer.Serialize(ms, sav);
|
||||
ms.Close();
|
||||
}
|
||||
|
||||
|
||||
prjName = Path.GetFileNameWithoutExtension(filename);
|
||||
prjFileName = filename;
|
||||
SetModified(false, true);
|
||||
@@ -991,9 +1081,11 @@ namespace McBitFont {
|
||||
var sel = miniList.SelectedItems[0].ImageKey;
|
||||
int code = Convert.ToInt32(miniList.SelectedItems[0].ImageKey);
|
||||
FrameMiniature ff = frames.Find(x => x.code == code);
|
||||
bool isLast = frames.Last().Equals(ff);
|
||||
frames.Remove(ff);
|
||||
miniList.SelectedItems[0].Remove();
|
||||
//miniList.Items[0].Selected = true;
|
||||
|
||||
miniList.Items[isLast ? miniList.Items.Count - 1 : 0].Selected = true;
|
||||
}
|
||||
|
||||
private void prependSymbolToolStripMenuItem_Click(object sender, EventArgs e) {
|
||||
@@ -1031,45 +1123,51 @@ namespace McBitFont {
|
||||
}
|
||||
} else {
|
||||
prependSymbolToolStripMenuItem.Enabled = false;
|
||||
appendSymbolToolStripMenuItem.Enabled = false;
|
||||
appendSymbolToolStripMenuItem.Enabled = true;
|
||||
tsmiPrepensSymbol.Enabled = false;
|
||||
tsmiAppendSymbol.Enabled = false;
|
||||
tsmiAppendSymbol.Enabled = true;
|
||||
}
|
||||
}
|
||||
|
||||
private void copyToolStripMenuItem_Click(object sender, EventArgs e) {
|
||||
fbuffer = true;
|
||||
fbuf = CopyFrame(f, true);
|
||||
pasteToolStripMenuItem.Enabled = true;
|
||||
var bb = MessagePackSerializer.Serialize(CopyFrame(f, true));
|
||||
DataObject clpbObj = new DataObject(clpbFormat.Name, bb);
|
||||
Clipboard.SetDataObject(clpbObj, true);
|
||||
}
|
||||
|
||||
private void pasteToolStripMenuItem_Click(object sender, EventArgs e) {
|
||||
history.AddPre(f);
|
||||
if (fbuf.width == f.width && fbuf.height == f.height) {
|
||||
Array.Copy(fbuf.data, f.data, fbuf.data.Length);
|
||||
} else {
|
||||
int di, dj, wmax, hmax, selw, selh;
|
||||
if (chkRectSelect.Checked) {
|
||||
di = selection1.X;
|
||||
dj = selection1.Y;
|
||||
selw = selection2.X - selection1.X + 1;
|
||||
selh = selection2.Y - selection1.Y + 1;
|
||||
wmax = fbuf.width > selw ? selw : fbuf.width;
|
||||
hmax = fbuf.height > selh ? selh : fbuf.height;
|
||||
} else {
|
||||
di = 0;
|
||||
dj = 0;
|
||||
wmax = (fbuf.width > f.width) ? f.width : fbuf.width;
|
||||
hmax = (fbuf.height > f.height) ? f.height : fbuf.height;
|
||||
}
|
||||
// Try to read from clipboard
|
||||
try {
|
||||
IDataObject clpbObj = Clipboard.GetDataObject();
|
||||
byte[] bb = (byte[])clpbObj.GetData(clpbFormat.Name);
|
||||
fbuf = MessagePackSerializer.Deserialize<FrameMiniature>(bb);
|
||||
}
|
||||
catch {
|
||||
return;
|
||||
}
|
||||
|
||||
for (int i = 0; i < wmax; i++) {
|
||||
for (int j = 0; j < hmax; j++) {
|
||||
f.data[i + di, j + dj] = fbuf.data[i, j];
|
||||
}
|
||||
int di, dj, wmax, hmax, selw, selh;
|
||||
if (chkRectSelect.Checked) {
|
||||
di = selection1.X;
|
||||
dj = selection1.Y;
|
||||
selw = selection2.X - selection1.X + 1;
|
||||
selh = selection2.Y - selection1.Y + 1;
|
||||
wmax = fbuf.width > selw ? selw : fbuf.width;
|
||||
hmax = fbuf.height > selh ? selh : fbuf.height;
|
||||
} else {
|
||||
di = 0;
|
||||
dj = 0;
|
||||
wmax = (fbuf.width > f.width) ? f.width : fbuf.width;
|
||||
hmax = (fbuf.height > f.height) ? f.height : fbuf.height;
|
||||
}
|
||||
|
||||
for (int i = 0; i < wmax; i++) {
|
||||
for (int j = 0; j < hmax; j++) {
|
||||
f.data[i + di, j + dj] = fbuf.data[i, j];
|
||||
}
|
||||
}
|
||||
history.AddPost(f);
|
||||
|
||||
history.Add(f);
|
||||
CheckHistoryButtons();
|
||||
dotPanel.Refresh();
|
||||
SetModified();
|
||||
@@ -1118,8 +1216,6 @@ namespace McBitFont {
|
||||
private void FillFrame(bool val) {
|
||||
int x, y, x2, y2;
|
||||
|
||||
history.AddPre(f);
|
||||
|
||||
(x, y, x2, y2) = RectSelCoords();
|
||||
|
||||
for (int i = x; i <= x2; i++) {
|
||||
@@ -1128,7 +1224,7 @@ namespace McBitFont {
|
||||
}
|
||||
}
|
||||
|
||||
history.AddPost(f);
|
||||
history.Add(f);
|
||||
CheckHistoryButtons();
|
||||
SetModified();
|
||||
dotPanel.Refresh();
|
||||
@@ -1192,6 +1288,7 @@ namespace McBitFont {
|
||||
monospaced = false;
|
||||
makeVarWidthToolStripMenuItem.Visible = false;
|
||||
tsmiMakeVarWidth.Visible = false;
|
||||
zerofyWidthToolStripMenuItem.Enabled = true;
|
||||
lblType.Text = "Variable width / Single";
|
||||
SetModified(true, true);
|
||||
}
|
||||
@@ -1209,13 +1306,13 @@ namespace McBitFont {
|
||||
}
|
||||
|
||||
private void undoToolStripMenuItem_Click(object sender, EventArgs e) {
|
||||
history.Undo(f);
|
||||
history.Undo();
|
||||
dotPanel.Refresh();
|
||||
CheckHistoryButtons();
|
||||
}
|
||||
|
||||
private void redoToolStripMenuItem_Click(object sender, EventArgs e) {
|
||||
history.Redo(f);
|
||||
history.Redo();
|
||||
dotPanel.Refresh();
|
||||
CheckHistoryButtons();
|
||||
}
|
||||
@@ -1266,13 +1363,12 @@ namespace McBitFont {
|
||||
private void importImageToolStripMenuItem_Click(object sender, EventArgs e) {
|
||||
ImageImporter iform = new ImageImporter(f.width, f.height);
|
||||
if (iform.ShowDialog() == DialogResult.OK) {
|
||||
history.AddPre(f);
|
||||
for (int i = 0; i < iform.bmpScaled.Width; i++) {
|
||||
for (int j = 0; j < iform.bmpScaled.Height; j++) {
|
||||
f.data[i, j] = iform.bmpScaled.GetPixel(i, j).ToArgb().Equals(Color.Black.ToArgb());
|
||||
}
|
||||
}
|
||||
history.AddPost(f);
|
||||
history.Add(f);
|
||||
CheckHistoryButtons();
|
||||
dotPanel.Refresh();
|
||||
SetModified();
|
||||
@@ -1424,5 +1520,175 @@ namespace McBitFont {
|
||||
selection2.Y = dotHeight - 1;
|
||||
dotPanel.Refresh();
|
||||
}
|
||||
|
||||
private void TestFont_Click(object sender, EventArgs e) {
|
||||
var tester = new FontTester(codepage, dotHeight, baseline, frames);
|
||||
tester.ShowDialog();
|
||||
}
|
||||
|
||||
private void ExportPNG(object sender, EventArgs e) {
|
||||
CheckModifiedFrame();
|
||||
CheckModifiedProject();
|
||||
|
||||
if (dlgSavePNG.ShowDialog() == DialogResult.OK) {
|
||||
int pixelSize = 3;
|
||||
int symbolMargin = 2 * pixelSize;
|
||||
int headerHeight = 100;
|
||||
int maxWidth = 0;
|
||||
int i, j, v, h, x, y;
|
||||
string s;
|
||||
|
||||
foreach (FrameMiniature f in frames) {
|
||||
if (f.width > maxWidth) maxWidth = f.width;
|
||||
}
|
||||
|
||||
int cellWidth = (pixelSize * maxWidth + 2 * symbolMargin);
|
||||
int cellHeight = (pixelSize * dotHeight + 2 * symbolMargin);
|
||||
if (cellWidth < 10) cellWidth = 10;
|
||||
if (cellHeight < 10) cellHeight = 10;
|
||||
|
||||
int width = cellWidth * 16 + 17 + 50;
|
||||
int height = cellHeight * 16 + 17 + 25 + headerHeight;
|
||||
|
||||
Bitmap bmp = new(width > 450 ? width : 450, height);
|
||||
Graphics g = Graphics.FromImage(bmp);
|
||||
g.TextRenderingHint = System.Drawing.Text.TextRenderingHint.AntiAliasGridFit;
|
||||
Font font = new("Consolas", 14, FontStyle.Bold);
|
||||
Brush tb = Brushes.Black;
|
||||
|
||||
|
||||
// Draw basic information
|
||||
g.DrawString("Font project name: " + prjName, font, tb, 10, 10);
|
||||
|
||||
g.DrawString("Font height: " + dotHeight, font, tb, 10, 38);
|
||||
g.DrawString("Font max width: " + maxWidth, font, tb, 10, 62);
|
||||
g.DrawString("Symbols count: " + frames.Count, font, tb, 10, 86);
|
||||
|
||||
g.DrawString("First code: " + frames.First().code.ToString(), font, tb, 250, 38);
|
||||
g.DrawString("Last code: " + frames.Last().code.ToString(), font, tb, 250, 62);
|
||||
g.DrawString("Codepage: " + codepage.ToString(), font, tb, 250, 86);
|
||||
|
||||
|
||||
// Draw grid
|
||||
Pen p = new(Color.FromArgb(64, 0, 0, 0), 1);
|
||||
SolidBrush b = new SolidBrush(Color.FromArgb(160, Color.Black));
|
||||
//Brush b = Brushes.Black;
|
||||
|
||||
int xCapOffset = cellWidth / 2 - 8;
|
||||
int yCapOffset = cellHeight / 2 - 10;
|
||||
for (i = 0; i < 17; i++) {
|
||||
x = 50 + 17 + i * cellWidth - 1;
|
||||
y = headerHeight + 17 + 25 + i * cellHeight - 1;
|
||||
g.DrawLine(p, 1, y, width - 1, y);
|
||||
g.DrawLine(p, x, headerHeight + 20, x, headerHeight + height - 20);
|
||||
|
||||
if (i != 16) {
|
||||
s = Convert.ToString(i, 16).ToUpper();
|
||||
g.DrawString(s, font, b, x + xCapOffset, headerHeight + 20);
|
||||
s = "0x" + Convert.ToString(i * 16, 16).PadLeft(2, '0').ToUpper();
|
||||
g.DrawString(s, font, b, 10, y + yCapOffset);
|
||||
}
|
||||
}
|
||||
|
||||
// Draw symbols
|
||||
int code;
|
||||
List<FrameMiniature> ff;
|
||||
Rectangle rect;
|
||||
// Cycle through grid cells
|
||||
for (v = 0; v < 16; v++) {
|
||||
for (h = 0; h < 16; h++) {
|
||||
// Check if the font has a symbol with the code
|
||||
code = 16 * v + h;
|
||||
ff = frames.FindAll(x => x.code == code);
|
||||
if (ff.Count == 1) {
|
||||
x = 50 + 17 + h * cellWidth + symbolMargin;
|
||||
y = headerHeight + 17 + 25 + v * cellHeight + symbolMargin;
|
||||
// Cycly through symbol's pixels and draw the black ones
|
||||
for (i = 0; i < ff[0].width; i++) {
|
||||
for (j = 0; j < ff[0].height; j++) {
|
||||
if (ff[0].data[i, j]) {
|
||||
rect = new Rectangle(x + i * pixelSize, y + j * pixelSize, pixelSize, pixelSize);
|
||||
g.FillRectangle(tb, rect);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bmp.Save(dlgSavePNG.FileName, ImageFormat.Png);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void toggleBarToolStripMenuItem_Click(object sender, EventArgs e) {
|
||||
int state;
|
||||
|
||||
dotPanel.Width = this.Width - (toggleBarToolStripMenuItem.Checked ? 260 : 504);
|
||||
SideBarRecalc();
|
||||
if (toggleBarToolStripMenuItem.Checked) {
|
||||
toggleBarToolStripMenuItem.Text = "<<";
|
||||
state = 1;
|
||||
} else {
|
||||
toggleBarToolStripMenuItem.Text = ">>";
|
||||
state = 0;
|
||||
}
|
||||
panel1.Location = sidebarLocs[state, 0];
|
||||
pnlInfo.Location = sidebarLocs[state, 1];
|
||||
miniList.Visible = !toggleBarToolStripMenuItem.Checked;
|
||||
vScroll.Location = sidebarLocs[state, 2];
|
||||
hScroll.Width = dotPanel.Width;
|
||||
cbZoom.Focus();
|
||||
}
|
||||
|
||||
private void PrevNextMenuCheck() {
|
||||
if (frames.Count < 2) {
|
||||
nextSymbolToolStripMenuItem.Enabled = false;
|
||||
previousSymbolToolStripMenuItem.Enabled = false;
|
||||
return;
|
||||
}
|
||||
previousSymbolToolStripMenuItem.Enabled = f.code != frames.First().code;
|
||||
nextSymbolToolStripMenuItem.Enabled = f.code != frames.Last().code;
|
||||
}
|
||||
private void fontToolStripMenuItem_DropDownOpening(object sender, EventArgs e) {
|
||||
PrevNextMenuCheck();
|
||||
}
|
||||
|
||||
private void previousSymbolToolStripMenuItem_Click(object sender, EventArgs e) {
|
||||
if (f.code != frames.First().code && miniList.SelectedItems.Count > 0) {
|
||||
miniList.Items[miniList.SelectedIndices[0] - 1].Selected = true;
|
||||
}
|
||||
PrevNextMenuCheck();
|
||||
}
|
||||
|
||||
private void nextSymbolToolStripMenuItem_Click(object sender, EventArgs e) {
|
||||
if (f.code != frames.Last().code && miniList.SelectedItems.Count > 0) {
|
||||
miniList.Items[miniList.SelectedIndices[0] + 1].Selected = true;
|
||||
}
|
||||
PrevNextMenuCheck();
|
||||
}
|
||||
|
||||
private void ZerofyBlankWidth(object sender, EventArgs e) {
|
||||
if (monospaced) return; // Does not work for monospaced fonts
|
||||
if (frames.Count < 2) return; // Does not work for single images
|
||||
|
||||
bool flag = false;
|
||||
for (int i = 0; i < frames.Count; i++) {
|
||||
|
||||
if (IsFrameBlank(frames[i])) {
|
||||
frames[i] = FrameResize(frames[i], 0, dotHeight, true);
|
||||
|
||||
flag = true;
|
||||
}
|
||||
}
|
||||
if (flag) {
|
||||
SetModified(true, true);
|
||||
MiniList_SelectedIndexChanged(miniList, EventArgs.Empty);
|
||||
}
|
||||
}
|
||||
|
||||
private void nudBrush_ValueChanged(object sender, EventArgs e) {
|
||||
dotPanel.Cursor = McCursor.GetCursor((int)nudBrush.Value, cellSize, gap);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -135,6 +135,9 @@
|
||||
<metadata name="dlgOpen.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>336, 17</value>
|
||||
</metadata>
|
||||
<metadata name="dlgSavePNG.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>644, 17</value>
|
||||
</metadata>
|
||||
<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>
|
||||
|
2
McBitFont/ImageImporter.Designer.cs
generated
@@ -377,7 +377,7 @@
|
||||
Name = "ImageImporter";
|
||||
ShowIcon = false;
|
||||
ShowInTaskbar = false;
|
||||
StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
|
||||
StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
|
||||
Text = "Import Image";
|
||||
Paint += ImageImporter_Paint;
|
||||
((System.ComponentModel.ISupportInitialize)pbOriginal).EndInit();
|
||||
|
@@ -123,7 +123,4 @@
|
||||
<metadata name="dlgLoadImage.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>17, 17</value>
|
||||
</metadata>
|
||||
<metadata name="toolTip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>147, 17</value>
|
||||
</metadata>
|
||||
</root>
|
@@ -20,9 +20,9 @@
|
||||
<UseWindowsForms>true</UseWindowsForms>
|
||||
<ImportWindowsDesktopTargets>true</ImportWindowsDesktopTargets>
|
||||
<ApplicationIcon>icon_64.ico</ApplicationIcon>
|
||||
<AssemblyVersion>2.2.0.0</AssemblyVersion>
|
||||
<FileVersion>2.2.0.0</FileVersion>
|
||||
<Version>$(VersionPrefix)2.2.0</Version>
|
||||
<AssemblyVersion>2.6.0.0</AssemblyVersion>
|
||||
<FileVersion>2.6.0.0</FileVersion>
|
||||
<Version>$(VersionPrefix)2.6.0</Version>
|
||||
<Copyright>Anton Mukhin</Copyright>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
|
||||
|
105
McBitFont/McCursor.cs
Normal file
@@ -0,0 +1,105 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.Drawing.Drawing2D;
|
||||
using System.Drawing.Imaging;
|
||||
using System.Linq;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace McBitFont {
|
||||
internal class McCursor {
|
||||
|
||||
public struct IconInfo {
|
||||
public bool fIcon;
|
||||
public int xHotspot;
|
||||
public int yHotspot;
|
||||
public IntPtr hbmMask;
|
||||
public IntPtr hbmColor;
|
||||
}
|
||||
[DllImport("user32.dll")]
|
||||
[return: MarshalAs(UnmanagedType.Bool)]
|
||||
public static extern bool GetIconInfo(IntPtr hIcon, ref IconInfo pIconInfo);
|
||||
[DllImport("user32.dll")]
|
||||
public static extern IntPtr CreateIconIndirect(ref IconInfo icon);
|
||||
|
||||
/// <summary>
|
||||
/// Create a cursor from a bitmap without resizing and with the specified
|
||||
/// hot spot
|
||||
/// </summary>
|
||||
public static Cursor CreateCursorNoResize(Bitmap bmp, int xHotSpot, int yHotSpot) {
|
||||
IntPtr ptr = bmp.GetHicon();
|
||||
IconInfo tmp = new IconInfo();
|
||||
GetIconInfo(ptr, ref tmp);
|
||||
tmp.xHotspot = xHotSpot;
|
||||
tmp.yHotspot = yHotSpot;
|
||||
tmp.fIcon = false;
|
||||
ptr = CreateIconIndirect(ref tmp);
|
||||
return new Cursor(ptr);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Create a 32x32 cursor from a bitmap, with the hot spot in the middle
|
||||
/// </summary>
|
||||
public static Cursor CreateCursor(Bitmap bmp) {
|
||||
int xHotSpot = 16;
|
||||
int yHotSpot = 16;
|
||||
|
||||
IntPtr ptr = ((Bitmap)ResizeImage(bmp, 32, 32)).GetHicon();
|
||||
IconInfo tmp = new IconInfo();
|
||||
GetIconInfo(ptr, ref tmp);
|
||||
tmp.xHotspot = xHotSpot;
|
||||
tmp.yHotspot = yHotSpot;
|
||||
tmp.fIcon = false;
|
||||
ptr = CreateIconIndirect(ref tmp);
|
||||
return new Cursor(ptr);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Resize the image to the specified width and height.
|
||||
/// </summary>
|
||||
/// <param name="image">The image to resize.</param>
|
||||
/// <param name="width">The width to resize to.</param>
|
||||
/// <param name="height">The height to resize to.</param>
|
||||
/// <returns>The resized image.</returns>
|
||||
public static Bitmap ResizeImage(Image image, int width, int height) {
|
||||
var destRect = new Rectangle(0, 0, width, height);
|
||||
var destImage = new Bitmap(width, height);
|
||||
|
||||
destImage.SetResolution(image.HorizontalResolution, image.VerticalResolution);
|
||||
|
||||
using (var graphics = Graphics.FromImage(destImage)) {
|
||||
graphics.CompositingMode = CompositingMode.SourceCopy;
|
||||
graphics.CompositingQuality = CompositingQuality.HighQuality;
|
||||
graphics.InterpolationMode = InterpolationMode.HighQualityBicubic;
|
||||
graphics.SmoothingMode = SmoothingMode.HighQuality;
|
||||
graphics.PixelOffsetMode = PixelOffsetMode.HighQuality;
|
||||
|
||||
using (var wrapMode = new ImageAttributes()) {
|
||||
wrapMode.SetWrapMode(WrapMode.TileFlipXY);
|
||||
graphics.DrawImage(image, destRect, 0, 0, image.Width, image.Height, GraphicsUnit.Pixel, wrapMode);
|
||||
}
|
||||
}
|
||||
|
||||
return destImage;
|
||||
}
|
||||
|
||||
public static Cursor GetCursor(int penSize, int cellSize, int gap) {
|
||||
int size = (cellSize + gap) * penSize;
|
||||
|
||||
Bitmap bmp = new(size, size);
|
||||
Pen pb = new(Color.Black, 1);
|
||||
SolidBrush bw = new(Color.FromArgb(160, Color.White));
|
||||
using (Graphics g = Graphics.FromImage(bmp)) {
|
||||
g.DrawRectangle(pb, 0, 0, size-1, size-1);
|
||||
g.FillRectangle(bw, 1, 1, size - 2, size - 2);
|
||||
}
|
||||
return CreateCursorNoResize(bmp, cellSize / 2, cellSize / 2);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
686
McBitFont/New.Designer.cs
generated
@@ -23,469 +23,421 @@
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent() {
|
||||
this.components = new System.ComponentModel.Container();
|
||||
this.nudNewX = new System.Windows.Forms.NumericUpDown();
|
||||
this.nudNewY = new System.Windows.Forms.NumericUpDown();
|
||||
this.label1 = new System.Windows.Forms.Label();
|
||||
this.label2 = new System.Windows.Forms.Label();
|
||||
this.rbMono = new System.Windows.Forms.RadioButton();
|
||||
this.rbVar = new System.Windows.Forms.RadioButton();
|
||||
this.cbNotPrintable = new System.Windows.Forms.CheckBox();
|
||||
this.cbLatin = new System.Windows.Forms.CheckBox();
|
||||
this.cbExtended = new System.Windows.Forms.CheckBox();
|
||||
this.btnOK = new System.Windows.Forms.Button();
|
||||
this.btnCancel = new System.Windows.Forms.Button();
|
||||
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.label4 = new System.Windows.Forms.Label();
|
||||
this.label3 = new System.Windows.Forms.Label();
|
||||
this.nudChar2 = new System.Windows.Forms.NumericUpDown();
|
||||
this.nudChar1 = new System.Windows.Forms.NumericUpDown();
|
||||
this.cbDigits = new System.Windows.Forms.CheckBox();
|
||||
((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();
|
||||
components = new System.ComponentModel.Container();
|
||||
nudNewX = new System.Windows.Forms.NumericUpDown();
|
||||
nudNewY = new System.Windows.Forms.NumericUpDown();
|
||||
label1 = new System.Windows.Forms.Label();
|
||||
label2 = new System.Windows.Forms.Label();
|
||||
rbMono = new System.Windows.Forms.RadioButton();
|
||||
rbVar = new System.Windows.Forms.RadioButton();
|
||||
cbNotPrintable = new System.Windows.Forms.CheckBox();
|
||||
cbLatin = new System.Windows.Forms.CheckBox();
|
||||
cbExtended = new System.Windows.Forms.CheckBox();
|
||||
btnOK = new System.Windows.Forms.Button();
|
||||
btnCancel = new System.Windows.Forms.Button();
|
||||
cbSingle = new System.Windows.Forms.CheckBox();
|
||||
toolTip1 = new System.Windows.Forms.ToolTip(components);
|
||||
cbEncoding = new System.Windows.Forms.ComboBox();
|
||||
panel1 = new System.Windows.Forms.Panel();
|
||||
pbChar2 = new System.Windows.Forms.PictureBox();
|
||||
pbChar1 = new System.Windows.Forms.PictureBox();
|
||||
btnFont = new System.Windows.Forms.Button();
|
||||
dlgFont = new System.Windows.Forms.FontDialog();
|
||||
cbFontBased = new System.Windows.Forms.CheckBox();
|
||||
lblFont = new System.Windows.Forms.Label();
|
||||
nudShiftX = new System.Windows.Forms.NumericUpDown();
|
||||
nudShiftY = new System.Windows.Forms.NumericUpDown();
|
||||
lblShiftX = new System.Windows.Forms.Label();
|
||||
lblShiftY = new System.Windows.Forms.Label();
|
||||
pnlFont = new System.Windows.Forms.Panel();
|
||||
label4 = new System.Windows.Forms.Label();
|
||||
label3 = new System.Windows.Forms.Label();
|
||||
nudChar2 = new System.Windows.Forms.NumericUpDown();
|
||||
nudChar1 = new System.Windows.Forms.NumericUpDown();
|
||||
cbDigits = new System.Windows.Forms.CheckBox();
|
||||
((System.ComponentModel.ISupportInitialize)nudNewX).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)nudNewY).BeginInit();
|
||||
panel1.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)pbChar2).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)pbChar1).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)nudShiftX).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)nudShiftY).BeginInit();
|
||||
pnlFont.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)nudChar2).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)nudChar1).BeginInit();
|
||||
SuspendLayout();
|
||||
//
|
||||
// nudNewX
|
||||
//
|
||||
this.nudNewX.Location = new System.Drawing.Point(68, 32);
|
||||
this.nudNewX.Maximum = new decimal(new int[] {
|
||||
255,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
this.nudNewX.Minimum = new decimal(new int[] {
|
||||
1,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
this.nudNewX.Name = "nudNewX";
|
||||
this.nudNewX.Size = new System.Drawing.Size(57, 20);
|
||||
this.nudNewX.TabIndex = 0;
|
||||
this.nudNewX.Value = new decimal(new int[] {
|
||||
32,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
this.nudNewX.ValueChanged += new System.EventHandler(this.nudNewX_ValueChanged);
|
||||
this.nudNewX.Enter += new System.EventHandler(this.nudFocus);
|
||||
nudNewX.Location = new System.Drawing.Point(68, 32);
|
||||
nudNewX.Maximum = new decimal(new int[] { 255, 0, 0, 0 });
|
||||
nudNewX.Minimum = new decimal(new int[] { 1, 0, 0, 0 });
|
||||
nudNewX.Name = "nudNewX";
|
||||
nudNewX.Size = new System.Drawing.Size(57, 23);
|
||||
nudNewX.TabIndex = 0;
|
||||
nudNewX.Value = new decimal(new int[] { 32, 0, 0, 0 });
|
||||
nudNewX.ValueChanged += nudNewX_ValueChanged;
|
||||
nudNewX.Enter += nudFocus;
|
||||
//
|
||||
// nudNewY
|
||||
//
|
||||
this.nudNewY.Location = new System.Drawing.Point(68, 58);
|
||||
this.nudNewY.Maximum = new decimal(new int[] {
|
||||
255,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
this.nudNewY.Minimum = new decimal(new int[] {
|
||||
1,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
this.nudNewY.Name = "nudNewY";
|
||||
this.nudNewY.Size = new System.Drawing.Size(57, 20);
|
||||
this.nudNewY.TabIndex = 1;
|
||||
this.nudNewY.Value = new decimal(new int[] {
|
||||
32,
|
||||
0,
|
||||
0,
|
||||
0});
|
||||
this.nudNewY.ValueChanged += new System.EventHandler(this.nudNewX_ValueChanged);
|
||||
this.nudNewY.Enter += new System.EventHandler(this.nudFocus);
|
||||
nudNewY.Location = new System.Drawing.Point(68, 58);
|
||||
nudNewY.Maximum = new decimal(new int[] { 255, 0, 0, 0 });
|
||||
nudNewY.Minimum = new decimal(new int[] { 1, 0, 0, 0 });
|
||||
nudNewY.Name = "nudNewY";
|
||||
nudNewY.Size = new System.Drawing.Size(57, 23);
|
||||
nudNewY.TabIndex = 1;
|
||||
nudNewY.Value = new decimal(new int[] { 32, 0, 0, 0 });
|
||||
nudNewY.ValueChanged += nudNewX_ValueChanged;
|
||||
nudNewY.Enter += nudFocus;
|
||||
//
|
||||
// label1
|
||||
//
|
||||
this.label1.AutoSize = true;
|
||||
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;
|
||||
this.label1.Text = "Width:";
|
||||
this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
|
||||
label1.AutoSize = true;
|
||||
label1.Location = new System.Drawing.Point(24, 34);
|
||||
label1.Name = "label1";
|
||||
label1.Size = new System.Drawing.Size(42, 15);
|
||||
label1.TabIndex = 2;
|
||||
label1.Text = "Width:";
|
||||
label1.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
|
||||
//
|
||||
// label2
|
||||
//
|
||||
this.label2.AutoSize = true;
|
||||
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;
|
||||
this.label2.Text = "Height:";
|
||||
this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
|
||||
label2.AutoSize = true;
|
||||
label2.Location = new System.Drawing.Point(21, 60);
|
||||
label2.Name = "label2";
|
||||
label2.Size = new System.Drawing.Size(46, 15);
|
||||
label2.TabIndex = 3;
|
||||
label2.Text = "Height:";
|
||||
label2.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
|
||||
//
|
||||
// rbMono
|
||||
//
|
||||
this.rbMono.AutoSize = true;
|
||||
this.rbMono.Checked = true;
|
||||
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;
|
||||
this.rbMono.TabStop = true;
|
||||
this.rbMono.Text = "Monospaced";
|
||||
this.rbMono.UseVisualStyleBackColor = true;
|
||||
rbMono.AutoSize = true;
|
||||
rbMono.Checked = true;
|
||||
rbMono.Location = new System.Drawing.Point(24, 84);
|
||||
rbMono.Name = "rbMono";
|
||||
rbMono.Size = new System.Drawing.Size(94, 19);
|
||||
rbMono.TabIndex = 4;
|
||||
rbMono.TabStop = true;
|
||||
rbMono.Text = "Monospaced";
|
||||
rbMono.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// rbVar
|
||||
//
|
||||
this.rbVar.AutoSize = true;
|
||||
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;
|
||||
this.rbVar.Text = "Variable width";
|
||||
this.rbVar.UseVisualStyleBackColor = true;
|
||||
rbVar.AutoSize = true;
|
||||
rbVar.Location = new System.Drawing.Point(24, 107);
|
||||
rbVar.Name = "rbVar";
|
||||
rbVar.Size = new System.Drawing.Size(99, 19);
|
||||
rbVar.TabIndex = 5;
|
||||
rbVar.Text = "Variable width";
|
||||
rbVar.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// cbNotPrintable
|
||||
//
|
||||
this.cbNotPrintable.AutoSize = true;
|
||||
this.cbNotPrintable.Location = new System.Drawing.Point(140, 77);
|
||||
this.cbNotPrintable.Name = "cbNotPrintable";
|
||||
this.cbNotPrintable.Size = new System.Drawing.Size(116, 17);
|
||||
this.cbNotPrintable.TabIndex = 7;
|
||||
this.cbNotPrintable.Text = "0-31 (Not printable)";
|
||||
this.cbNotPrintable.UseVisualStyleBackColor = true;
|
||||
this.cbNotPrintable.CheckedChanged += new System.EventHandler(this.checkboxChanged);
|
||||
cbNotPrintable.AutoSize = true;
|
||||
cbNotPrintable.Location = new System.Drawing.Point(140, 77);
|
||||
cbNotPrintable.Name = "cbNotPrintable";
|
||||
cbNotPrintable.Size = new System.Drawing.Size(130, 19);
|
||||
cbNotPrintable.TabIndex = 7;
|
||||
cbNotPrintable.Text = "0-31 (Not printable)";
|
||||
cbNotPrintable.UseVisualStyleBackColor = true;
|
||||
cbNotPrintable.CheckedChanged += checkboxChanged;
|
||||
//
|
||||
// cbLatin
|
||||
//
|
||||
this.cbLatin.AutoSize = true;
|
||||
this.cbLatin.Checked = true;
|
||||
this.cbLatin.CheckState = System.Windows.Forms.CheckState.Checked;
|
||||
this.cbLatin.Location = new System.Drawing.Point(140, 100);
|
||||
this.cbLatin.Name = "cbLatin";
|
||||
this.cbLatin.Size = new System.Drawing.Size(91, 17);
|
||||
this.cbLatin.TabIndex = 8;
|
||||
this.cbLatin.Text = "32-127 (Latin)";
|
||||
this.cbLatin.UseVisualStyleBackColor = true;
|
||||
this.cbLatin.CheckedChanged += new System.EventHandler(this.checkboxChanged);
|
||||
cbLatin.AutoSize = true;
|
||||
cbLatin.Checked = true;
|
||||
cbLatin.CheckState = System.Windows.Forms.CheckState.Checked;
|
||||
cbLatin.Location = new System.Drawing.Point(140, 100);
|
||||
cbLatin.Name = "cbLatin";
|
||||
cbLatin.Size = new System.Drawing.Size(98, 19);
|
||||
cbLatin.TabIndex = 8;
|
||||
cbLatin.Text = "32-127 (Latin)";
|
||||
cbLatin.UseVisualStyleBackColor = true;
|
||||
cbLatin.CheckedChanged += checkboxChanged;
|
||||
//
|
||||
// cbExtended
|
||||
//
|
||||
this.cbExtended.AutoSize = true;
|
||||
this.cbExtended.Location = new System.Drawing.Point(140, 123);
|
||||
this.cbExtended.Name = "cbExtended";
|
||||
this.cbExtended.Size = new System.Drawing.Size(119, 17);
|
||||
this.cbExtended.TabIndex = 9;
|
||||
this.cbExtended.Text = "128-255 (Extended)";
|
||||
this.cbExtended.UseVisualStyleBackColor = true;
|
||||
this.cbExtended.CheckedChanged += new System.EventHandler(this.checkboxChanged);
|
||||
cbExtended.AutoSize = true;
|
||||
cbExtended.Location = new System.Drawing.Point(140, 123);
|
||||
cbExtended.Name = "cbExtended";
|
||||
cbExtended.Size = new System.Drawing.Size(126, 19);
|
||||
cbExtended.TabIndex = 9;
|
||||
cbExtended.Text = "128-255 (Extended)";
|
||||
cbExtended.UseVisualStyleBackColor = true;
|
||||
cbExtended.CheckedChanged += checkboxChanged;
|
||||
//
|
||||
// btnOK
|
||||
//
|
||||
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;
|
||||
this.btnOK.Text = "OK";
|
||||
this.btnOK.UseVisualStyleBackColor = true;
|
||||
this.btnOK.Click += new System.EventHandler(this.btnOK_Click);
|
||||
btnOK.Anchor = System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left;
|
||||
btnOK.Location = new System.Drawing.Point(47, 178);
|
||||
btnOK.Name = "btnOK";
|
||||
btnOK.Size = new System.Drawing.Size(75, 23);
|
||||
btnOK.TabIndex = 10;
|
||||
btnOK.Text = "OK";
|
||||
btnOK.UseVisualStyleBackColor = true;
|
||||
btnOK.Click += btnOK_Click;
|
||||
//
|
||||
// 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(140, 178);
|
||||
this.btnCancel.Name = "btnCancel";
|
||||
this.btnCancel.Size = new System.Drawing.Size(75, 23);
|
||||
this.btnCancel.TabIndex = 11;
|
||||
this.btnCancel.Text = "Cancel";
|
||||
this.btnCancel.UseVisualStyleBackColor = true;
|
||||
this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
|
||||
btnCancel.Anchor = System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left;
|
||||
btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
|
||||
btnCancel.Location = new System.Drawing.Point(140, 178);
|
||||
btnCancel.Name = "btnCancel";
|
||||
btnCancel.Size = new System.Drawing.Size(75, 23);
|
||||
btnCancel.TabIndex = 11;
|
||||
btnCancel.Text = "Cancel";
|
||||
btnCancel.UseVisualStyleBackColor = true;
|
||||
btnCancel.Click += btnCancel_Click;
|
||||
//
|
||||
// cbSingle
|
||||
//
|
||||
this.cbSingle.AutoSize = true;
|
||||
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;
|
||||
this.cbSingle.Text = "Single frame";
|
||||
this.cbSingle.UseVisualStyleBackColor = true;
|
||||
this.cbSingle.CheckedChanged += new System.EventHandler(this.checkboxChanged);
|
||||
cbSingle.AutoSize = true;
|
||||
cbSingle.Location = new System.Drawing.Point(140, 31);
|
||||
cbSingle.Name = "cbSingle";
|
||||
cbSingle.Size = new System.Drawing.Size(92, 19);
|
||||
cbSingle.TabIndex = 12;
|
||||
cbSingle.Text = "Single frame";
|
||||
cbSingle.UseVisualStyleBackColor = true;
|
||||
cbSingle.CheckedChanged += checkboxChanged;
|
||||
//
|
||||
// toolTip1
|
||||
//
|
||||
this.toolTip1.AutoPopDelay = 10000;
|
||||
this.toolTip1.InitialDelay = 500;
|
||||
this.toolTip1.ReshowDelay = 100;
|
||||
this.toolTip1.ToolTipTitle = "Info";
|
||||
toolTip1.AutoPopDelay = 10000;
|
||||
toolTip1.InitialDelay = 500;
|
||||
toolTip1.ReshowDelay = 100;
|
||||
toolTip1.ToolTipTitle = "Info";
|
||||
//
|
||||
// cbEncoding
|
||||
//
|
||||
this.cbEncoding.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.cbEncoding.Enabled = false;
|
||||
this.cbEncoding.FormattingEnabled = true;
|
||||
this.cbEncoding.Location = new System.Drawing.Point(140, 146);
|
||||
this.cbEncoding.Name = "cbEncoding";
|
||||
this.cbEncoding.Size = new System.Drawing.Size(121, 21);
|
||||
this.cbEncoding.TabIndex = 13;
|
||||
cbEncoding.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
cbEncoding.Enabled = false;
|
||||
cbEncoding.FormattingEnabled = true;
|
||||
cbEncoding.Location = new System.Drawing.Point(140, 146);
|
||||
cbEncoding.Name = "cbEncoding";
|
||||
cbEncoding.Size = new System.Drawing.Size(121, 23);
|
||||
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;
|
||||
panel1.Controls.Add(pbChar2);
|
||||
panel1.Controls.Add(pbChar1);
|
||||
panel1.Location = new System.Drawing.Point(6, 24);
|
||||
panel1.Name = "panel1";
|
||||
panel1.Size = new System.Drawing.Size(200, 124);
|
||||
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;
|
||||
pbChar2.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
|
||||
pbChar2.Location = new System.Drawing.Point(100, 0);
|
||||
pbChar2.Name = "pbChar2";
|
||||
pbChar2.Size = new System.Drawing.Size(100, 124);
|
||||
pbChar2.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
|
||||
pbChar2.TabIndex = 1;
|
||||
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;
|
||||
pbChar1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
|
||||
pbChar1.Location = new System.Drawing.Point(0, 0);
|
||||
pbChar1.Name = "pbChar1";
|
||||
pbChar1.Size = new System.Drawing.Size(100, 124);
|
||||
pbChar1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
|
||||
pbChar1.TabIndex = 0;
|
||||
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);
|
||||
btnFont.Anchor = System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left;
|
||||
btnFont.Location = new System.Drawing.Point(6, 178);
|
||||
btnFont.Name = "btnFont";
|
||||
btnFont.Size = new System.Drawing.Size(71, 23);
|
||||
btnFont.TabIndex = 15;
|
||||
btnFont.Text = "Font ...";
|
||||
btnFont.UseVisualStyleBackColor = true;
|
||||
btnFont.Click += 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;
|
||||
dlgFont.Font = new System.Drawing.Font("Courier New", 15.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, 204);
|
||||
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.checkboxChanged);
|
||||
cbFontBased.AutoSize = true;
|
||||
cbFontBased.Location = new System.Drawing.Point(24, 130);
|
||||
cbFontBased.Name = "cbFontBased";
|
||||
cbFontBased.Size = new System.Drawing.Size(108, 19);
|
||||
cbFontBased.TabIndex = 16;
|
||||
cbFontBased.Text = "Based on a font";
|
||||
cbFontBased.UseVisualStyleBackColor = true;
|
||||
cbFontBased.CheckedChanged += checkboxChanged;
|
||||
//
|
||||
// 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";
|
||||
lblFont.Anchor = System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left;
|
||||
lblFont.Location = new System.Drawing.Point(83, 183);
|
||||
lblFont.Name = "lblFont";
|
||||
lblFont.Size = new System.Drawing.Size(123, 18);
|
||||
lblFont.TabIndex = 17;
|
||||
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);
|
||||
nudShiftX.Location = new System.Drawing.Point(61, 2);
|
||||
nudShiftX.Minimum = new decimal(new int[] { 100, 0, 0, int.MinValue });
|
||||
nudShiftX.Name = "nudShiftX";
|
||||
nudShiftX.Size = new System.Drawing.Size(45, 23);
|
||||
nudShiftX.TabIndex = 18;
|
||||
nudShiftX.ValueChanged += 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);
|
||||
nudShiftY.Location = new System.Drawing.Point(161, 2);
|
||||
nudShiftY.Minimum = new decimal(new int[] { 100, 0, 0, int.MinValue });
|
||||
nudShiftY.Name = "nudShiftY";
|
||||
nudShiftY.Size = new System.Drawing.Size(45, 23);
|
||||
nudShiftY.TabIndex = 19;
|
||||
nudShiftY.ValueChanged += 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;
|
||||
lblShiftX.AutoSize = true;
|
||||
lblShiftX.Location = new System.Drawing.Point(14, 4);
|
||||
lblShiftX.Name = "lblShiftX";
|
||||
lblShiftX.Size = new System.Drawing.Size(44, 15);
|
||||
lblShiftX.TabIndex = 20;
|
||||
lblShiftX.Text = "Shift X:";
|
||||
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;
|
||||
lblShiftY.AutoSize = true;
|
||||
lblShiftY.Location = new System.Drawing.Point(114, 4);
|
||||
lblShiftY.Name = "lblShiftY";
|
||||
lblShiftY.Size = new System.Drawing.Size(44, 15);
|
||||
lblShiftY.TabIndex = 21;
|
||||
lblShiftY.Text = "Shift Y:";
|
||||
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;
|
||||
pnlFont.Controls.Add(label4);
|
||||
pnlFont.Controls.Add(label3);
|
||||
pnlFont.Controls.Add(nudChar2);
|
||||
pnlFont.Controls.Add(nudChar1);
|
||||
pnlFont.Controls.Add(lblShiftX);
|
||||
pnlFont.Controls.Add(lblShiftY);
|
||||
pnlFont.Controls.Add(panel1);
|
||||
pnlFont.Controls.Add(btnFont);
|
||||
pnlFont.Controls.Add(nudShiftY);
|
||||
pnlFont.Controls.Add(lblFont);
|
||||
pnlFont.Controls.Add(nudShiftX);
|
||||
pnlFont.Dock = System.Windows.Forms.DockStyle.Right;
|
||||
pnlFont.Location = new System.Drawing.Point(270, 0);
|
||||
pnlFont.Name = "pnlFont";
|
||||
pnlFont.Size = new System.Drawing.Size(214, 211);
|
||||
pnlFont.TabIndex = 22;
|
||||
pnlFont.Visible = false;
|
||||
//
|
||||
// label4
|
||||
//
|
||||
this.label4.AutoSize = true;
|
||||
this.label4.Location = new System.Drawing.Point(112, 152);
|
||||
this.label4.Name = "label4";
|
||||
this.label4.Size = new System.Drawing.Size(45, 13);
|
||||
this.label4.TabIndex = 25;
|
||||
this.label4.Text = "Sample:";
|
||||
this.label4.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
|
||||
label4.AutoSize = true;
|
||||
label4.Location = new System.Drawing.Point(112, 152);
|
||||
label4.Name = "label4";
|
||||
label4.Size = new System.Drawing.Size(49, 15);
|
||||
label4.TabIndex = 25;
|
||||
label4.Text = "Sample:";
|
||||
label4.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
|
||||
//
|
||||
// label3
|
||||
//
|
||||
this.label3.AutoSize = true;
|
||||
this.label3.Location = new System.Drawing.Point(14, 152);
|
||||
this.label3.Name = "label3";
|
||||
this.label3.Size = new System.Drawing.Size(45, 13);
|
||||
this.label3.TabIndex = 24;
|
||||
this.label3.Text = "Sample:";
|
||||
this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
|
||||
label3.AutoSize = true;
|
||||
label3.Location = new System.Drawing.Point(14, 152);
|
||||
label3.Name = "label3";
|
||||
label3.Size = new System.Drawing.Size(49, 15);
|
||||
label3.TabIndex = 24;
|
||||
label3.Text = "Sample:";
|
||||
label3.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
|
||||
//
|
||||
// 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);
|
||||
nudChar2.Location = new System.Drawing.Point(161, 149);
|
||||
nudChar2.Maximum = new decimal(new int[] { 255, 0, 0, 0 });
|
||||
nudChar2.Name = "nudChar2";
|
||||
nudChar2.Size = new System.Drawing.Size(45, 23);
|
||||
nudChar2.TabIndex = 23;
|
||||
nudChar2.Value = new decimal(new int[] { 97, 0, 0, 0 });
|
||||
nudChar2.ValueChanged += 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);
|
||||
nudChar1.Location = new System.Drawing.Point(61, 149);
|
||||
nudChar1.Maximum = new decimal(new int[] { 255, 0, 0, 0 });
|
||||
nudChar1.Name = "nudChar1";
|
||||
nudChar1.Size = new System.Drawing.Size(45, 23);
|
||||
nudChar1.TabIndex = 22;
|
||||
nudChar1.Value = new decimal(new int[] { 65, 0, 0, 0 });
|
||||
nudChar1.ValueChanged += nudNewX_ValueChanged;
|
||||
//
|
||||
// cbDigits
|
||||
//
|
||||
this.cbDigits.AutoSize = true;
|
||||
this.cbDigits.Location = new System.Drawing.Point(140, 54);
|
||||
this.cbDigits.Name = "cbDigits";
|
||||
this.cbDigits.Size = new System.Drawing.Size(74, 17);
|
||||
this.cbDigits.TabIndex = 23;
|
||||
this.cbDigits.Text = "Digits only";
|
||||
this.cbDigits.UseVisualStyleBackColor = true;
|
||||
this.cbDigits.CheckedChanged += new System.EventHandler(this.checkboxChanged);
|
||||
cbDigits.AutoSize = true;
|
||||
cbDigits.Location = new System.Drawing.Point(140, 54);
|
||||
cbDigits.Name = "cbDigits";
|
||||
cbDigits.Size = new System.Drawing.Size(82, 19);
|
||||
cbDigits.TabIndex = 23;
|
||||
cbDigits.Text = "Digits only";
|
||||
cbDigits.UseVisualStyleBackColor = true;
|
||||
cbDigits.CheckedChanged += checkboxChanged;
|
||||
//
|
||||
// New
|
||||
//
|
||||
this.AcceptButton = this.btnOK;
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
|
||||
this.CancelButton = this.btnCancel;
|
||||
this.ClientSize = new System.Drawing.Size(484, 211);
|
||||
this.Controls.Add(this.cbDigits);
|
||||
this.Controls.Add(this.pnlFont);
|
||||
this.Controls.Add(this.cbFontBased);
|
||||
this.Controls.Add(this.cbEncoding);
|
||||
this.Controls.Add(this.cbSingle);
|
||||
this.Controls.Add(this.btnCancel);
|
||||
this.Controls.Add(this.btnOK);
|
||||
this.Controls.Add(this.cbExtended);
|
||||
this.Controls.Add(this.cbLatin);
|
||||
this.Controls.Add(this.cbNotPrintable);
|
||||
this.Controls.Add(this.rbVar);
|
||||
this.Controls.Add(this.rbMono);
|
||||
this.Controls.Add(this.label2);
|
||||
this.Controls.Add(this.label1);
|
||||
this.Controls.Add(this.nudNewY);
|
||||
this.Controls.Add(this.nudNewX);
|
||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
|
||||
this.MaximizeBox = false;
|
||||
this.MinimizeBox = false;
|
||||
this.MinimumSize = new System.Drawing.Size(300, 220);
|
||||
this.Name = "New";
|
||||
this.ShowIcon = false;
|
||||
this.ShowInTaskbar = false;
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
|
||||
this.Text = "New";
|
||||
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();
|
||||
AcceptButton = btnOK;
|
||||
AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
|
||||
CancelButton = btnCancel;
|
||||
ClientSize = new System.Drawing.Size(484, 211);
|
||||
Controls.Add(cbDigits);
|
||||
Controls.Add(pnlFont);
|
||||
Controls.Add(cbFontBased);
|
||||
Controls.Add(cbEncoding);
|
||||
Controls.Add(cbSingle);
|
||||
Controls.Add(btnCancel);
|
||||
Controls.Add(btnOK);
|
||||
Controls.Add(cbExtended);
|
||||
Controls.Add(cbLatin);
|
||||
Controls.Add(cbNotPrintable);
|
||||
Controls.Add(rbVar);
|
||||
Controls.Add(rbMono);
|
||||
Controls.Add(label2);
|
||||
Controls.Add(label1);
|
||||
Controls.Add(nudNewY);
|
||||
Controls.Add(nudNewX);
|
||||
FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
|
||||
MaximizeBox = false;
|
||||
MinimizeBox = false;
|
||||
MinimumSize = new System.Drawing.Size(300, 220);
|
||||
Name = "New";
|
||||
ShowIcon = false;
|
||||
ShowInTaskbar = false;
|
||||
StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
|
||||
Text = "New";
|
||||
Load += New_Load;
|
||||
((System.ComponentModel.ISupportInitialize)nudNewX).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)nudNewY).EndInit();
|
||||
panel1.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)pbChar2).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)pbChar1).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)nudShiftX).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)nudShiftY).EndInit();
|
||||
pnlFont.ResumeLayout(false);
|
||||
pnlFont.PerformLayout();
|
||||
((System.ComponentModel.ISupportInitialize)nudChar2).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)nudChar1).EndInit();
|
||||
ResumeLayout(false);
|
||||
PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
|
@@ -1,17 +1,17 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
<!--
|
||||
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
|
||||
|
||||
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>
|
||||
@@ -26,36 +26,36 @@
|
||||
<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
|
||||
|
||||
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
|
||||
|
||||
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
|
||||
|
||||
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
|
||||
|
||||
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
|
||||
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
|
||||
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
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
|
50
McBitFont/Properties/Resources.Designer.cs
generated
@@ -100,6 +100,26 @@ namespace McBitFont.Properties {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
internal static System.Drawing.Bitmap arrow_turn_left {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("arrow_turn_left", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
internal static System.Drawing.Bitmap arrow_turn_right {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("arrow_turn_right", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
@@ -270,6 +290,16 @@ namespace McBitFont.Properties {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
internal static System.Drawing.Bitmap font {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("font", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
@@ -300,6 +330,26 @@ namespace McBitFont.Properties {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
internal static System.Drawing.Bitmap picture_go {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("picture_go", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
internal static System.Drawing.Bitmap text_letterspacing2 {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("text_letterspacing2", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
|
@@ -136,15 +136,18 @@
|
||||
<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="picture_go" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\picture_go.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="arrow_inout" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\arrow_inout.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="font" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\font.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="arrow_redo" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\redo.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<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="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>
|
||||
@@ -178,20 +181,20 @@
|
||||
<data name="z_shading" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\shading.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="arrow_turn_left" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\arrow_turn_left.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="add" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\add.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="z_undo" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\arrow_undo.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="z_tick" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\tick.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="delete" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\delete.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
<data name="z_undo" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\arrow_undo.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="z_redo" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\arrow_redo.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
@@ -205,6 +208,15 @@
|
||||
<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="delete" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\delete.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="arrow_turn_right" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\arrow_turn_right.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<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_table" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\folder_table.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
@@ -223,10 +235,13 @@
|
||||
<data name="arrow_undo" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\undo.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>
|
||||
<data name="arrow_out" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\arrow_out.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>
|
||||
<data name="text_letterspacing2" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\text_letterspacing2.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
</root>
|
BIN
McBitFont/Resources/arrow_turn_left.png
Normal file
After Width: | Height: | Size: 512 B |
BIN
McBitFont/Resources/arrow_turn_right.png
Normal file
After Width: | Height: | Size: 489 B |
BIN
McBitFont/Resources/font.png
Normal file
After Width: | Height: | Size: 567 B |
BIN
McBitFont/Resources/picture_go.png
Normal file
After Width: | Height: | Size: 758 B |
BIN
McBitFont/Resources/text_letterspacing2.png
Normal file
After Width: | Height: | Size: 357 B |
14
README.md
@@ -8,6 +8,9 @@ Features:
|
||||
- Import an image
|
||||
- Save / Load your project for later edits
|
||||
- Export as a C array in different formats
|
||||
- Import from text C array
|
||||
- Export to a PNG image showing all the characters in a table
|
||||
- Test your font in special dialog
|
||||
|
||||
Requires:
|
||||
- Windows 7+
|
||||
@@ -17,9 +20,12 @@ Some basic hints on the interface:
|
||||
- Mouse 1 to mark a pixel black
|
||||
- Mouse 2 to mark a pixel white
|
||||
- Drag the mouse holding a button to draw pixels
|
||||
- Hold Shift to constrain painting horizontally
|
||||
- Hold Ctrl to constrain painting vertically
|
||||
- Mouse Scroll to scroll up and down
|
||||
- Shift + scroll to scroll left and right
|
||||
- Crtl + scroll to zoom
|
||||
- Alt + Scroll to change painting brush size
|
||||
|
||||
Download in the [Releases](https://gitea.mcflyer.ru/McFLY/McBitFont/releases) section!
|
||||
|
||||
@@ -37,6 +43,10 @@ New project dialog
|
||||
|
||||

|
||||
|
||||
Font test dialog
|
||||
|
||||

|
||||
|
||||
Export dialog
|
||||
|
||||

|
||||
@@ -48,3 +58,7 @@ Import Image dialog
|
||||
Code Shift dialog
|
||||
|
||||

|
||||
|
||||
Font PNG export example
|
||||
|
||||

|
||||
|
17
TODO.txt
@@ -1,15 +1,12 @@
|
||||
Application:
|
||||
V Move Select and Baseline buttons right
|
||||
V Display RectSelection width and width
|
||||
V Indicate modified project by adding "*" to window caption
|
||||
- Consider migrating to WPF in order to make DPI aware UI
|
||||
V Option to hide symbols list to narrow the side bar
|
||||
V Buttons to select previous/next symbol with shortcuts
|
||||
V Custom cursor showing painting size
|
||||
|
||||
Functionality:
|
||||
V Copy/Paste should be aware of rectangle selection
|
||||
V Select All function
|
||||
V Select and Select All shortcuts
|
||||
V Fix straight (Ctrl/Shift) lines paint to reset coordinate on mouse-up even if Ctrl/Shift is still held
|
||||
V Command to make all blank symbols zero-width
|
||||
V Alt-Scroll to change painting size
|
||||
|
||||
Bugs:
|
||||
V EncodingProvider hotfix
|
||||
V Check if frame changed before exit application
|
||||
V Hostory does not record pastes from clipboard
|
||||
V Undo/Redo menu availability recalculation does not happen sometimes
|
||||
|
BIN
examples/Cyrillic-pixel-7.mbfont
Normal file
BIN
examples/Font_3x3_mono_Latin.mbfont
Normal file
BIN
examples/Font_3x5_Latin.mbfont
Normal file
BIN
examples/Font_4x6_vw.mbfont
Normal file
BIN
examples/Font_9x17_Alagard_cyr_vw.mbfont
Normal file
BIN
examples/Font_Minecraft_Rus_5x7_vw.mbfont
Normal file
BIN
examples/Standard_narrow_Latin1.mbfont
Normal file
BIN
examples/Standard_wide_Latin1.mbfont
Normal file
BIN
examples/basis33_vw_cyr.mbfont
Normal file
BIN
examples/pixel_3x5_Cyr.mbfont
Normal file
BIN
icons/famfamfam/arrow_turn_left.png
Normal file
After Width: | Height: | Size: 512 B |
BIN
icons/famfamfam/arrow_turn_right.png
Normal file
After Width: | Height: | Size: 489 B |
BIN
icons/famfamfam/font.png
Normal file
After Width: | Height: | Size: 567 B |
BIN
icons/famfamfam/picture_go.png
Normal file
After Width: | Height: | Size: 758 B |
BIN
icons/famfamfam/text_letterspacing2.png
Normal file
After Width: | Height: | Size: 357 B |
BIN
images/Font_Minecraft_Rus_5x7_vw.png
Normal file
After Width: | Height: | Size: 43 KiB |
BIN
images/Screenshot_Font-tester.png
Normal file
After Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 49 KiB After Width: | Height: | Size: 51 KiB |