Compare commits
87 Commits
Author | SHA1 | Date | |
---|---|---|---|
6c860943a5 | |||
1852c697fc | |||
|
e76132cadb | ||
|
5948948eee | ||
|
c4067410c5 | ||
fe63d1bfab | |||
|
dd3309d8ea | ||
|
8efbd4da55 | ||
|
6a6d8f3e68 | ||
|
a7d052e799 | ||
|
ec9fbc4250 | ||
|
2e217c9a9e | ||
|
d10da7cb20 | ||
|
7db0b6d76e | ||
|
2930c42260 | ||
|
ace97302f2 | ||
|
ad15f08233 | ||
|
64531aecf0 | ||
|
4dd4743b21 | ||
|
686ff7b780 | ||
|
30729aca2f | ||
|
6cbc206260 | ||
d70d8d8a3c | |||
e5a4baadb7 | |||
37abcf2c8e | |||
2c2a8d6158 | |||
|
4115455a54 | ||
67be566605 | |||
7aa75224ee | |||
4fe2af03b0 | |||
|
fc4822065a | ||
|
3778a753fb | ||
|
20bd7095dd | ||
8ed1e33f22 | |||
|
1eb463c94f | ||
30142fda26 | |||
|
70a4d34d69 | ||
|
c913525b31 | ||
|
42c72b907f | ||
|
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 | |||
0d923ef8ed | |||
|
5e1a2085cf | ||
|
ca21c43926 |
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);
|
||||
|
@@ -233,7 +233,14 @@ namespace McBitFont {
|
||||
if (com && lines != 1 && fcount > 1) {
|
||||
// Comments enabled and other than "1 symbol per line" selected
|
||||
// Print a symbol comment before its data
|
||||
output += " // " + f.code.ToString() + " --> " + mainForm.DecodeSymbol(f.code) + "\n";
|
||||
string character = f.code switch {
|
||||
92 => "Backslash",
|
||||
_ => mainForm.DecodeSymbol(f.code),
|
||||
};
|
||||
string code = mainForm.chkHexCodes.Checked ? "0x" + Convert.ToString(f.code, 16).PadLeft(2, '0').ToUpper() : f.code.ToString();
|
||||
output += " // " + code + " --> " + character;
|
||||
if (f.note != "" && f.note != null) output += " (" + f.note.ToString() + ")";
|
||||
output += "\n";
|
||||
}
|
||||
if (lines == 1) {
|
||||
// "1 symbol per line" - new line offset
|
||||
@@ -369,7 +376,13 @@ namespace McBitFont {
|
||||
if (!f.Equals(flast) && f.width > 0) output += ",";
|
||||
if (com && fcount > 1) {
|
||||
//...with a comment
|
||||
output += " // " + f.code.ToString() + " --> " + mainForm.DecodeSymbol(f.code);
|
||||
string character = f.code switch {
|
||||
92 => "Backslash",
|
||||
_ => mainForm.DecodeSymbol(f.code),
|
||||
};
|
||||
string code = mainForm.chkHexCodes.Checked ? "0x" + Convert.ToString(f.code, 16).PadLeft(2, '0').ToUpper() : f.code.ToString();
|
||||
output += " // " + code + " --> " + character;
|
||||
if (f.note != "" && f.note != null) output += " (" + f.note.ToString() + ")";
|
||||
}
|
||||
output += "\n";
|
||||
}
|
||||
|
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>
|
542
McBitFont/Form1.Designer.cs
generated
@@ -135,6 +135,12 @@
|
||||
<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>
|
||||
<metadata name="cmBaseline.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>763, 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>
|
||||
|
169
McBitFont/FrameScreenshot.Designer.cs
generated
Normal file
@@ -0,0 +1,169 @@
|
||||
namespace McBitFont {
|
||||
partial class FrameScreenshot {
|
||||
/// <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();
|
||||
btnClose = new System.Windows.Forms.Button();
|
||||
btnOK = new System.Windows.Forms.Button();
|
||||
toolTip1 = new System.Windows.Forms.ToolTip(components);
|
||||
nudUpscale = new System.Windows.Forms.NumericUpDown();
|
||||
chkTransparent = new System.Windows.Forms.CheckBox();
|
||||
chkBlackBG = new System.Windows.Forms.CheckBox();
|
||||
btnCopy = new System.Windows.Forms.Button();
|
||||
dlgSaveImage = new System.Windows.Forms.SaveFileDialog();
|
||||
lblUpscale = new System.Windows.Forms.Label();
|
||||
((System.ComponentModel.ISupportInitialize)nudUpscale).BeginInit();
|
||||
SuspendLayout();
|
||||
//
|
||||
// btnClose
|
||||
//
|
||||
btnClose.Location = new System.Drawing.Point(234, 67);
|
||||
btnClose.Name = "btnClose";
|
||||
btnClose.Size = new System.Drawing.Size(88, 27);
|
||||
btnClose.TabIndex = 3;
|
||||
btnClose.Text = "Close";
|
||||
toolTip1.SetToolTip(btnClose, "Close the dialog");
|
||||
btnClose.UseVisualStyleBackColor = true;
|
||||
btnClose.Click += btnClose_Click;
|
||||
//
|
||||
// btnOK
|
||||
//
|
||||
btnOK.Image = Properties.Resources.Famfamfam_Silk_Disk_16;
|
||||
btnOK.ImageAlign = System.Drawing.ContentAlignment.MiddleRight;
|
||||
btnOK.Location = new System.Drawing.Point(12, 67);
|
||||
btnOK.Name = "btnOK";
|
||||
btnOK.Size = new System.Drawing.Size(88, 27);
|
||||
btnOK.TabIndex = 1;
|
||||
btnOK.Text = "Save";
|
||||
btnOK.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText;
|
||||
toolTip1.SetToolTip(btnOK, "Save to file");
|
||||
btnOK.UseVisualStyleBackColor = true;
|
||||
btnOK.Click += btnOK_Click;
|
||||
//
|
||||
// toolTip1
|
||||
//
|
||||
toolTip1.AutoPopDelay = 10000;
|
||||
toolTip1.InitialDelay = 500;
|
||||
toolTip1.ReshowDelay = 100;
|
||||
//
|
||||
// nudUpscale
|
||||
//
|
||||
nudUpscale.Location = new System.Drawing.Point(71, 27);
|
||||
nudUpscale.Maximum = new decimal(new int[] { 255, 0, 0, 0 });
|
||||
nudUpscale.Minimum = new decimal(new int[] { 1, 0, 0, 0 });
|
||||
nudUpscale.Name = "nudUpscale";
|
||||
nudUpscale.Size = new System.Drawing.Size(51, 23);
|
||||
nudUpscale.TabIndex = 2;
|
||||
toolTip1.SetToolTip(nudUpscale, "Pixel upscale factor (4 means that for each frame pixel there will be 4x4 pixels generated)");
|
||||
nudUpscale.Value = new decimal(new int[] { 4, 0, 0, 0 });
|
||||
//
|
||||
// chkTransparent
|
||||
//
|
||||
chkTransparent.AutoSize = true;
|
||||
chkTransparent.Location = new System.Drawing.Point(144, 18);
|
||||
chkTransparent.Name = "chkTransparent";
|
||||
chkTransparent.Size = new System.Drawing.Size(155, 19);
|
||||
chkTransparent.TabIndex = 5;
|
||||
chkTransparent.Text = "Transparent background";
|
||||
toolTip1.SetToolTip(chkTransparent, "Make background transparent (Doesn't work with clipboard - background will be gray)");
|
||||
chkTransparent.UseVisualStyleBackColor = true;
|
||||
chkTransparent.CheckedChanged += chkTransparent_CheckedChanged;
|
||||
//
|
||||
// chkBlackBG
|
||||
//
|
||||
chkBlackBG.AutoSize = true;
|
||||
chkBlackBG.Enabled = false;
|
||||
chkBlackBG.Location = new System.Drawing.Point(144, 35);
|
||||
chkBlackBG.Name = "chkBlackBG";
|
||||
chkBlackBG.Size = new System.Drawing.Size(132, 19);
|
||||
chkBlackBG.TabIndex = 6;
|
||||
chkBlackBG.Text = "Background is black";
|
||||
toolTip1.SetToolTip(chkBlackBG, "White color is considered as background by default. Check this to invert that");
|
||||
chkBlackBG.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// btnCopy
|
||||
//
|
||||
btnCopy.Image = Properties.Resources.Famfamfam_Silk_Page_copy_16;
|
||||
btnCopy.ImageAlign = System.Drawing.ContentAlignment.MiddleRight;
|
||||
btnCopy.Location = new System.Drawing.Point(122, 67);
|
||||
btnCopy.Name = "btnCopy";
|
||||
btnCopy.Size = new System.Drawing.Size(88, 27);
|
||||
btnCopy.TabIndex = 7;
|
||||
btnCopy.Text = "Copy";
|
||||
btnCopy.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText;
|
||||
toolTip1.SetToolTip(btnCopy, "Copy to clipboard");
|
||||
btnCopy.UseVisualStyleBackColor = true;
|
||||
btnCopy.Click += btnCopy_Click;
|
||||
//
|
||||
// dlgSaveImage
|
||||
//
|
||||
dlgSaveImage.DefaultExt = "png";
|
||||
dlgSaveImage.Filter = "PNG Image|*.png;*.PNG";
|
||||
//
|
||||
// lblUpscale
|
||||
//
|
||||
lblUpscale.AutoSize = true;
|
||||
lblUpscale.Location = new System.Drawing.Point(71, 9);
|
||||
lblUpscale.Name = "lblUpscale";
|
||||
lblUpscale.Size = new System.Drawing.Size(51, 15);
|
||||
lblUpscale.TabIndex = 4;
|
||||
lblUpscale.Text = "Upscale:";
|
||||
//
|
||||
// FrameScreenshot
|
||||
//
|
||||
AcceptButton = btnClose;
|
||||
AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
|
||||
AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
CancelButton = btnClose;
|
||||
ClientSize = new System.Drawing.Size(334, 111);
|
||||
Controls.Add(btnCopy);
|
||||
Controls.Add(chkBlackBG);
|
||||
Controls.Add(chkTransparent);
|
||||
Controls.Add(nudUpscale);
|
||||
Controls.Add(lblUpscale);
|
||||
Controls.Add(btnClose);
|
||||
Controls.Add(btnOK);
|
||||
FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
|
||||
Name = "FrameScreenshot";
|
||||
StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
|
||||
Text = "Frame Screenshot";
|
||||
Load += FrameScreenshot_Load;
|
||||
((System.ComponentModel.ISupportInitialize)nudUpscale).EndInit();
|
||||
ResumeLayout(false);
|
||||
PerformLayout();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.Button btnClose;
|
||||
private System.Windows.Forms.Button btnOK;
|
||||
private System.Windows.Forms.ToolTip toolTip1;
|
||||
private System.Windows.Forms.SaveFileDialog dlgSaveImage;
|
||||
private System.Windows.Forms.Label lblUpscale;
|
||||
private System.Windows.Forms.NumericUpDown nudUpscale;
|
||||
private System.Windows.Forms.CheckBox chkTransparent;
|
||||
private System.Windows.Forms.CheckBox chkBlackBG;
|
||||
private System.Windows.Forms.Button btnCopy;
|
||||
}
|
||||
}
|
87
McBitFont/FrameScreenshot.cs
Normal file
@@ -0,0 +1,87 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Drawing.Imaging;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Security.Policy;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Forms;
|
||||
using static McBitFont.MainForm;
|
||||
|
||||
namespace McBitFont {
|
||||
public partial class FrameScreenshot : Form {
|
||||
|
||||
private FrameMiniature f;
|
||||
|
||||
public FrameScreenshot(FrameMiniature frame) {
|
||||
InitializeComponent();
|
||||
f = frame;
|
||||
}
|
||||
|
||||
private Bitmap GenerateScreenshot() {
|
||||
int upscale = (int)nudUpscale.Value;
|
||||
int x, y;
|
||||
bool transp = chkTransparent.Checked;
|
||||
bool blackBG = chkBlackBG.Checked;
|
||||
|
||||
Bitmap bmp = new(f.width * upscale, f.height * upscale);
|
||||
SolidBrush bb = new(Color.Black);
|
||||
SolidBrush bw = new(Color.White);
|
||||
using (Graphics g = Graphics.FromImage(bmp)) {
|
||||
for (x = 0; x < f.width; x++) {
|
||||
for (y = 0; y < f.height; y++) {
|
||||
if (f.data[x, y]) {
|
||||
if (!transp || (transp && !blackBG)) g.FillRectangle(bb, x * upscale, y * upscale, upscale, upscale);
|
||||
} else
|
||||
if (!transp || (transp && blackBG)) g.FillRectangle(bw, x * upscale, y * upscale, upscale, upscale);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return bmp;
|
||||
}
|
||||
|
||||
private void btnOK_Click(object sender, EventArgs e) {
|
||||
if (dlgSaveImage.ShowDialog() == DialogResult.OK) {
|
||||
|
||||
Bitmap bmp = GenerateScreenshot();
|
||||
|
||||
bool err = false;
|
||||
try {
|
||||
bmp.Save(dlgSaveImage.FileName, ImageFormat.Png);
|
||||
}
|
||||
catch (Exception ex) {
|
||||
err = true;
|
||||
MessageBox.Show("There was an error during image save: " + ex.Message, "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
||||
}
|
||||
if (!err) MessageBox.Show("Screenshot has been saved!", "Success!", MessageBoxButtons.OK, MessageBoxIcon.Information);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private void FrameScreenshot_Load(object sender, EventArgs e) {
|
||||
btnOK.Focus();
|
||||
}
|
||||
|
||||
private void btnClose_Click(object sender, EventArgs e) {
|
||||
DialogResult = DialogResult.OK;
|
||||
}
|
||||
|
||||
private void chkTransparent_CheckedChanged(object sender, EventArgs e) {
|
||||
chkBlackBG.Enabled = chkTransparent.Checked;
|
||||
}
|
||||
|
||||
private void btnCopy_Click(object sender, EventArgs e) {
|
||||
Bitmap bmp = GenerateScreenshot();
|
||||
using MemoryStream stream = new();
|
||||
bmp.Save(stream, ImageFormat.Png);
|
||||
DataObject data = new("PNG", stream);
|
||||
data.SetImage(bmp);
|
||||
Clipboard.SetDataObject(data, true);
|
||||
}
|
||||
}
|
||||
}
|
126
McBitFont/FrameScreenshot.resx
Normal file
@@ -0,0 +1,126 @@
|
||||
<?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>
|
||||
<metadata name="dlgSaveImage.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||
<value>115, 17</value>
|
||||
</metadata>
|
||||
</root>
|
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.1.0.0</AssemblyVersion>
|
||||
<FileVersion>2.1.0.0</FileVersion>
|
||||
<Version>$(VersionPrefix)2.1.0</Version>
|
||||
<AssemblyVersion>2.10.0.0</AssemblyVersion>
|
||||
<FileVersion>2.10.0.0</FileVersion>
|
||||
<Version>$(VersionPrefix)2.10.0</Version>
|
||||
<Copyright>Anton Mukhin</Copyright>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
|
||||
|
172
McBitFont/McCursor.cs
Normal file
@@ -0,0 +1,172 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.Drawing.Drawing2D;
|
||||
using System.Drawing.Imaging;
|
||||
using System.Linq;
|
||||
using System.Runtime.CompilerServices;
|
||||
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);
|
||||
}
|
||||
|
||||
public static Cursor GetCursorSelect() {
|
||||
Point[] arrow = { new(1, 1), new(12, 12), new(11, 13), new(6, 13), new(2, 17), new(1, 16) };
|
||||
Point[] corner1 = { new(13, 6), new(20, 6), new(20, 13), new(17, 13), new(17, 9), new(13, 9) };
|
||||
Point[] corner2 = { new(17, 16), new(20, 16), new(20, 23), new(13, 23), new(13, 20), new(17, 20) };
|
||||
Point[] corner3 = { new(3, 16), new(6, 16), new(6, 20), new(10, 20), new(10, 23), new(3, 23) };
|
||||
Point[] corner4 = { new(6, 6), new(10, 6), new(10, 9), new(6, 9) };
|
||||
|
||||
Bitmap bmp = new(21, 24);
|
||||
Pen pb = new(Color.Black, 1);
|
||||
SolidBrush bw = new (Color.White);
|
||||
using (Graphics g = Graphics.FromImage(bmp)) {
|
||||
g.FillPolygon(bw, corner1);
|
||||
g.DrawPolygon(pb, corner1);
|
||||
g.FillPolygon(bw, corner2);
|
||||
g.DrawPolygon(pb, corner2);
|
||||
g.FillPolygon(bw, corner3);
|
||||
g.DrawPolygon(pb, corner3);
|
||||
g.FillPolygon(bw, corner4);
|
||||
g.DrawPolygon(pb, corner4);
|
||||
g.FillPolygon(bw, arrow);
|
||||
g.DrawPolygon(pb, arrow);
|
||||
}
|
||||
return CreateCursorNoResize(bmp, 1, 1);
|
||||
}
|
||||
|
||||
public static Cursor GetCursorLines() {
|
||||
Point[] arrow = { new(1, 1), new(12, 12), new(11, 13), new(6, 13), new(2, 17), new(1, 16) };
|
||||
Rectangle line = new(0, 18, 20, 5);
|
||||
|
||||
Bitmap bmp = new(21, 24);
|
||||
Pen pb = new(Color.Black, 1);
|
||||
Pen pw = new(Color.White, 1);
|
||||
SolidBrush bw = new(Color.White);
|
||||
SolidBrush bb = new(Color.Black);
|
||||
using (Graphics g = Graphics.FromImage(bmp)) {
|
||||
g.FillPolygon(bw, arrow);
|
||||
g.DrawPolygon(pb, arrow);
|
||||
g.FillRectangle(bb, line);
|
||||
g.DrawRectangle(pw, line);
|
||||
}
|
||||
|
||||
return CreateCursorNoResize(bmp, 1, 1);
|
||||
}
|
||||
|
||||
public static Cursor GetCursorDrag() {
|
||||
Point[] arrow1 = { new(11, 0), new(15, 4), new(13, 4), new(13, 7), new(9, 7), new(9, 4), new(7, 4) };
|
||||
Point[] arrow2 = { new(22, 11), new(18, 15), new(18, 13), new(15, 13), new(15, 9), new(18, 9), new(18, 7) };
|
||||
Point[] arrow3 = { new(11, 22), new(7, 18), new(9, 18), new(9, 15), new(13, 15), new(13, 18), new(15, 18) };
|
||||
Point[] arrow4 = { new(0, 11), new(4, 7), new(4, 9), new(7, 9), new(7, 13), new(4, 13), new(4, 15) };
|
||||
|
||||
Bitmap bmp = new(23, 23);
|
||||
Pen pb = new(Color.Black, 1);
|
||||
SolidBrush bw = new(Color.White);
|
||||
using (Graphics g = Graphics.FromImage(bmp)) {
|
||||
g.FillPolygon(bw, arrow1);
|
||||
g.DrawPolygon(pb, arrow1);
|
||||
g.FillPolygon(bw, arrow2);
|
||||
g.DrawPolygon(pb, arrow2);
|
||||
g.FillPolygon(bw, arrow3);
|
||||
g.DrawPolygon(pb, arrow3);
|
||||
g.FillPolygon(bw, arrow4);
|
||||
g.DrawPolygon(pb, arrow4);
|
||||
}
|
||||
return CreateCursorNoResize(bmp, 11, 11);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
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.
|
||||
-->
|
||||
|
100
McBitFont/Properties/Resources.Designer.cs
generated
@@ -80,6 +80,16 @@ namespace McBitFont.Properties {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
internal static System.Drawing.Bitmap arrow_out {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("arrow_out", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
@@ -90,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>
|
||||
@@ -150,6 +180,26 @@ namespace McBitFont.Properties {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
internal static System.Drawing.Bitmap fam_lines {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("fam_lines", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
internal static System.Drawing.Bitmap fam_mid {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("fam_mid", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
@@ -160,6 +210,16 @@ namespace McBitFont.Properties {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
internal static System.Drawing.Bitmap fam_top {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("fam_top", resourceCulture);
|
||||
return ((System.Drawing.Bitmap)(obj));
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized resource of type System.Drawing.Bitmap.
|
||||
/// </summary>
|
||||
@@ -260,6 +320,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>
|
||||
@@ -290,6 +360,36 @@ 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 picture_save {
|
||||
get {
|
||||
object obj = ResourceManager.GetObject("picture_save", 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>
|
||||
|
@@ -118,6 +118,9 @@
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||
<data name="fam_mid" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\fam_mid.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="z_left" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\arrow_left.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
@@ -130,15 +133,27 @@
|
||||
<data name="Famfamfam-Silk-Page-paste.16" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\Famfamfam-Silk-Page-paste.16.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="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>
|
||||
<data name="folder_open" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\folder_open.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
<data name="Famfamfam-Silk-Page-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="picture_save" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\picture_save.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>
|
||||
@@ -175,20 +190,23 @@
|
||||
<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 name="fam_lines" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\fam_lines.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>
|
||||
@@ -202,9 +220,18 @@
|
||||
<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="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>
|
||||
<data name="Canvas_Fill" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\Canvas_Fill.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
@@ -220,10 +247,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="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="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 name="fam_top" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||
<value>..\Resources\fam_top.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
|
||||
</data>
|
||||
</root>
|
BIN
McBitFont/Resources/arrow_out.png
Normal file
After Width: | Height: | Size: 594 B |
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/fam_lines.png
Normal file
After Width: | Height: | Size: 174 B |
BIN
McBitFont/Resources/fam_mid.png
Normal file
After Width: | Height: | Size: 137 B |
BIN
McBitFont/Resources/fam_top.png
Normal file
After Width: | Height: | Size: 136 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/picture_save.png
Normal file
After Width: | Height: | Size: 755 B |
BIN
McBitFont/Resources/text_letterspacing2.png
Normal file
After Width: | Height: | Size: 357 B |
33
README.md
@@ -2,26 +2,36 @@
|
||||
|
||||
McFLY's Bit Font and Image Editor
|
||||
|
||||
Features:
|
||||
Download in the [Releases](https://gitea.mcflyer.ru/McFLY/McBitFont/releases) section!
|
||||
|
||||
Library example instructions to implement to STM32 code: [mctext](STM32_HAL_Lib/README.md)
|
||||
|
||||
**Features:**
|
||||
- Generate a project based on a font installed in the system
|
||||
- Basic pixel manipulations: shift, flip, invert, etc...
|
||||
- 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:
|
||||
**Requires:**
|
||||
- Windows 7+
|
||||
- .NET 9
|
||||
|
||||
Some basic hints on the interface:
|
||||
**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 middle mouse button to drag the canvas
|
||||
- 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
|
||||
|
||||
Download in the [Releases](https://gitea.mcflyer.ru/McFLY/McBitFont/releases) section!
|
||||
- Alt + Scroll to change painting brush size
|
||||
- When Rectangle selection tool is active hold Ctrl+Alt to temporary disable it to be able to draw
|
||||
|
||||
#### Important:
|
||||
**Since v2.0 new save file format is implemented. You can use [McBitFont v1.7](https://gitea.mcflyer.ru/McFLY/McBitFont/releases/tag/v1.7) to convert old saved files to the new format.**
|
||||
@@ -37,6 +47,10 @@ New project dialog
|
||||
|
||||

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

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

|
||||
@@ -48,3 +62,12 @@ Import Image dialog
|
||||
Code Shift dialog
|
||||
|
||||

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

|
||||
|
||||
Frame screenshot dialog
|
||||
|
||||

|
||||
|
||||
|
13
STM32_HAL_Lib/README.md
Normal file
@@ -0,0 +1,13 @@
|
||||
# McText Library
|
||||
|
||||
- The library uses "Left to Right, Top to bottom" scan and "LSB Top" for pixels alignment
|
||||
|
||||
#### Instructions
|
||||
|
||||
To use the library you have to have a display driver with a function that paints a single pixel with X and Y coordinates and 0/1 color.<br>
|
||||
Find "SET A FUNCTION NAME HERE!" text in *mctext.c* file and change the function name that suits your driver.<br>
|
||||
**Note:** it is possible that you will have to change parameters in the function to match your driver.
|
||||
|
||||
**Note:** check the "include" in *mctext.h* file to match your HAL. (stm32f1xx_hal.h is fo STM32F1 MCU series)
|
||||
|
||||
Now use **mct_String** function to draw a string of text.
|
285
STM32_HAL_Lib/fonts.c
Normal file
@@ -0,0 +1,285 @@
|
||||
/*
|
||||
ST7565 LCD library
|
||||
|
||||
Anton Mukhin, 2023
|
||||
*/
|
||||
|
||||
#include <fonts.h>
|
||||
|
||||
/* Font header map:
|
||||
uint8_t packed; // Is it a packed font?
|
||||
uint8_t width; // Font width in pixels
|
||||
uint8_t height; // Font height in pixels
|
||||
uint8_t space; // Space between characters
|
||||
uint8_t first; // First character code
|
||||
uint8_t last; // Last character code
|
||||
*/
|
||||
|
||||
const uint8_t font_5x7_vw[] = {
|
||||
// Meta header
|
||||
1, // Is it a packed font?
|
||||
0, // Font width in pixels; 0 - variable width
|
||||
7, // Font height in pixels
|
||||
1, // Font space (between symbols) in pixels
|
||||
0, // First character code
|
||||
255, // Last character code
|
||||
// Data:
|
||||
0x00, // 0 -->
|
||||
0x05, 0xff, 0xff, 0xff, 0xff, 0x07, // 1 -->
|
||||
0x05, 0xff, 0x60, 0x30, 0xf8, 0x07, // 2 -->
|
||||
0x00, // 3 -->
|
||||
0x00, // 4 -->
|
||||
0x00, // 5 -->
|
||||
0x00, // 6 -->
|
||||
0x00, // 7 -->
|
||||
0x05, 0x0c, 0x0f, 0xcf, 0xc3, 0x00, // 8 -->
|
||||
0x05, 0x08, 0x96, 0x8f, 0x85, 0x00, // 9 -->
|
||||
0x05, 0x08, 0xa4, 0x1f, 0x89, 0x00, // 10 -->
|
||||
0x05, 0x22, 0x0a, 0x82, 0x22, 0x02, // 11 -->
|
||||
0x05, 0x10, 0x0c, 0x07, 0x03, 0x01, // 12 -->
|
||||
0x05, 0x3e, 0x9f, 0xcf, 0xe7, 0x03, // 13 -->
|
||||
0x05, 0x08, 0x8e, 0x8f, 0x83, 0x00, // 14 -->
|
||||
0x05, 0x1c, 0x9f, 0xcf, 0xc7, 0x01, // 15 -->
|
||||
0x18, 0x1c, 0x0e, 0x87, 0xc3, 0xe1, 0xf8, 0xfe, 0xff, 0xbf, 0x48, 0x04, 0x00, 0xfc, 0xff, 0x7f, 0x1f, 0x87, 0xc3, 0xe1, 0x70, 0x38, // 16 --> Not connected
|
||||
0x18, 0x1c, 0x0e, 0x87, 0xe3, 0xfb, 0xff, 0x83, 0xff, 0x60, 0xb7, 0x3b, 0xfe, 0x8f, 0xbb, 0xdd, 0xf5, 0xdf, 0xc7, 0xe1, 0x70, 0x38, // 17 --> IDC
|
||||
0x18, 0x1c, 0xdf, 0x7f, 0xb8, 0xff, 0x5f, 0xa7, 0xeb, 0xff, 0x79, 0x1d, 0xfc, 0xaf, 0xab, 0xeb, 0x7f, 0xb4, 0xda, 0xfe, 0xfb, 0x38, // 18 --> RS485
|
||||
0x0a, 0x0c, 0x06, 0x00, 0xc0, 0x60, 0x00, 0x00, 0x0c, 0x06, // 19 -->
|
||||
0x00, // 20 -->
|
||||
0x00, // 21 -->
|
||||
0x00, // 22 -->
|
||||
0x00, // 23 -->
|
||||
0x09, 0xc2, 0x70, 0xd4, 0x09, 0xe0, 0x48, 0xfe, 0x10, // 24 -->
|
||||
0x09, 0x00, 0xe1, 0x1f, 0x08, 0x38, 0x15, 0x8b, 0x39, // 25 -->
|
||||
0x00, // 26 -->
|
||||
0x00, // 27 -->
|
||||
0x00, // 28 -->
|
||||
0x00, // 29 -->
|
||||
0x00, // 30 -->
|
||||
0x00, // 31 -->
|
||||
0x01, 0x00, // 32 -->
|
||||
0x01, 0x5f, // 33 --> !
|
||||
0x03, 0x07, 0xc0, 0x01, // 34 --> "
|
||||
0x05, 0x94, 0x3f, 0xe5, 0x4f, 0x01, // 35 --> #
|
||||
0x05, 0x24, 0xd5, 0x5f, 0x25, 0x01, // 36 --> $
|
||||
0x05, 0xa3, 0x09, 0x82, 0x2c, 0x06, // 37 --> %
|
||||
0x05, 0xb6, 0x64, 0x55, 0x04, 0x05, // 38 --> &
|
||||
0x02, 0x85, 0x01, // 39 --> '
|
||||
0x02, 0xbe, 0x20, // 40 --> (
|
||||
0x02, 0x41, 0x1f, // 41 --> )
|
||||
0x05, 0x14, 0x84, 0x0f, 0x41, 0x01, // 42 --> *
|
||||
0x05, 0x08, 0x84, 0x0f, 0x81, 0x00, // 43 --> +
|
||||
0x02, 0x50, 0x18, // 44 --> ,
|
||||
0x05, 0x08, 0x04, 0x02, 0x81, 0x00, // 45 --> -
|
||||
0x02, 0x60, 0x30, // 46 --> .
|
||||
0x05, 0x20, 0x08, 0x82, 0x20, 0x00, // 47 --> /
|
||||
0x05, 0xbe, 0x68, 0xb2, 0xe8, 0x03, // 48 --> 0
|
||||
0x05, 0x00, 0xe1, 0x1f, 0x08, 0x00, // 49 --> 1
|
||||
0x05, 0xc2, 0x70, 0x34, 0x69, 0x04, // 50 --> 2
|
||||
0x05, 0xa1, 0x60, 0x71, 0x19, 0x03, // 51 --> 3
|
||||
0x05, 0x18, 0x8a, 0xe4, 0x0f, 0x01, // 52 --> 4
|
||||
0x05, 0xa7, 0x62, 0xb1, 0x98, 0x03, // 53 --> 5
|
||||
0x05, 0x3c, 0x65, 0x32, 0x09, 0x03, // 54 --> 6
|
||||
0x05, 0x83, 0x40, 0x3c, 0x71, 0x00, // 55 --> 7
|
||||
0x05, 0xb6, 0x64, 0x32, 0x69, 0x03, // 56 --> 8
|
||||
0x05, 0x86, 0x64, 0x32, 0xe5, 0x01, // 57 --> 9
|
||||
0x02, 0x36, 0x1b, // 58 --> :
|
||||
0x02, 0x56, 0x1b, // 59 --> ;
|
||||
0x04, 0x08, 0x8a, 0x28, 0x08, // 60 --> <
|
||||
0x05, 0x14, 0x0a, 0x85, 0x42, 0x01, // 61 --> =
|
||||
0x04, 0x41, 0x11, 0x05, 0x01, // 62 --> >
|
||||
0x05, 0x82, 0x40, 0x34, 0x61, 0x00, // 63 --> ?
|
||||
0x05, 0xb2, 0x64, 0x3e, 0xe8, 0x03, // 64 --> @
|
||||
0x05, 0xfe, 0x48, 0x24, 0xe2, 0x07, // 65 --> A
|
||||
0x05, 0xff, 0x64, 0x32, 0x69, 0x03, // 66 --> B
|
||||
0x05, 0xbe, 0x60, 0x30, 0x28, 0x02, // 67 --> C
|
||||
0x05, 0xff, 0x60, 0x50, 0xc4, 0x01, // 68 --> D
|
||||
0x05, 0xff, 0x64, 0x32, 0x19, 0x04, // 69 --> E
|
||||
0x05, 0xff, 0x44, 0x22, 0x11, 0x00, // 70 --> F
|
||||
0x05, 0xbe, 0x60, 0x32, 0xa9, 0x07, // 71 --> G
|
||||
0x05, 0x7f, 0x04, 0x02, 0xf1, 0x07, // 72 --> H
|
||||
0x03, 0xc1, 0x7f, 0x10, // 73 --> I
|
||||
0x05, 0x20, 0x60, 0xf0, 0x17, 0x00, // 74 --> J
|
||||
0x05, 0x7f, 0x04, 0x45, 0x14, 0x04, // 75 --> K
|
||||
0x05, 0x7f, 0x20, 0x10, 0x08, 0x04, // 76 --> L
|
||||
0x05, 0x7f, 0x01, 0x43, 0xf0, 0x07, // 77 --> M
|
||||
0x05, 0x7f, 0x02, 0x02, 0xf2, 0x07, // 78 --> N
|
||||
0x05, 0xbe, 0x60, 0x30, 0xe8, 0x03, // 79 --> O
|
||||
0x05, 0xff, 0x44, 0x22, 0x61, 0x00, // 80 --> P
|
||||
0x05, 0xbe, 0x60, 0x34, 0xe4, 0x05, // 81 --> Q
|
||||
0x05, 0xff, 0x44, 0x26, 0x65, 0x04, // 82 --> R
|
||||
0x05, 0xc6, 0x64, 0x32, 0x19, 0x03, // 83 --> S
|
||||
0x05, 0x81, 0xc0, 0x3f, 0x10, 0x00, // 84 --> T
|
||||
0x05, 0x3f, 0x20, 0x10, 0xf8, 0x03, // 85 --> U
|
||||
0x05, 0x1f, 0x10, 0x10, 0xf4, 0x01, // 86 --> V
|
||||
0x05, 0x3f, 0x20, 0x0e, 0xf8, 0x03, // 87 --> W
|
||||
0x05, 0x63, 0x0a, 0x82, 0x32, 0x06, // 88 --> X
|
||||
0x05, 0x07, 0x04, 0x1c, 0x71, 0x00, // 89 --> Y
|
||||
0x05, 0xe1, 0x68, 0xb2, 0x38, 0x04, // 90 --> Z
|
||||
0x02, 0xff, 0x20, // 91 --> [
|
||||
0x05, 0x02, 0x02, 0x02, 0x02, 0x02, // 92 --> backslash
|
||||
0x02, 0xc1, 0x3f, // 93 --> ]
|
||||
0x03, 0x04, 0x01, 0x01, // 94 --> ^
|
||||
0x05, 0x40, 0x20, 0x10, 0x08, 0x04, // 95 --> _
|
||||
0x03, 0x01, 0x01, 0x01, // 96 --> `
|
||||
0x04, 0x20, 0x2a, 0x15, 0x0f, // 97 --> a
|
||||
0x04, 0x7f, 0x24, 0x11, 0x07, // 98 --> b
|
||||
0x04, 0x38, 0x22, 0x11, 0x04, // 99 --> c
|
||||
0x04, 0x38, 0x22, 0xf2, 0x0f, // 100 --> d
|
||||
0x04, 0x38, 0x2a, 0x15, 0x03, // 101 --> e
|
||||
0x04, 0x08, 0x7f, 0x42, 0x00, // 102 --> f
|
||||
0x04, 0x0c, 0xa9, 0xd4, 0x07, // 103 --> g
|
||||
0x04, 0x7f, 0x04, 0x01, 0x0f, // 104 --> h
|
||||
0x03, 0xc4, 0x3e, 0x10, // 105 --> i
|
||||
0x04, 0x20, 0x20, 0xb1, 0x07, // 106 --> j
|
||||
0x04, 0x7f, 0x08, 0x8a, 0x08, // 107 --> k
|
||||
0x03, 0xc1, 0x3f, 0x10, // 108 --> l
|
||||
0x05, 0x7c, 0x02, 0x86, 0x80, 0x07, // 109 --> m
|
||||
0x04, 0x7c, 0x04, 0x01, 0x0f, // 110 --> n
|
||||
0x04, 0x38, 0x22, 0x11, 0x07, // 111 --> o
|
||||
0x04, 0x7c, 0x0a, 0x05, 0x01, // 112 --> p
|
||||
0x04, 0x08, 0x0a, 0x86, 0x0f, // 113 --> q
|
||||
0x04, 0x7c, 0x04, 0x01, 0x01, // 114 --> r
|
||||
0x04, 0x48, 0x2a, 0x15, 0x04, // 115 --> s
|
||||
0x04, 0x84, 0x1f, 0x11, 0x04, // 116 --> t
|
||||
0x04, 0x3c, 0x20, 0x88, 0x0f, // 117 --> u
|
||||
0x05, 0x1c, 0x10, 0x10, 0xc4, 0x01, // 118 --> v
|
||||
0x05, 0x3c, 0x20, 0x0e, 0xc8, 0x03, // 119 --> w
|
||||
0x04, 0x6c, 0x08, 0x84, 0x0d, // 120 --> x
|
||||
0x04, 0x0c, 0x28, 0x94, 0x07, // 121 --> y
|
||||
0x04, 0x64, 0x3a, 0x97, 0x09, // 122 --> z
|
||||
0x03, 0x08, 0x5b, 0x10, // 123 --> {
|
||||
0x01, 0x7f, // 124 --> |
|
||||
0x03, 0x41, 0x1b, 0x02, // 125 --> }
|
||||
0x05, 0x08, 0x02, 0x03, 0x41, 0x00, // 126 --> ~
|
||||
0x00, // 127 -->
|
||||
0x05, 0x81, 0x7f, 0x2a, 0x19, 0x03, // 128 --> <20>
|
||||
0x00, // 129 --> <20>
|
||||
0x00, // 130 --> <20>
|
||||
0x00, // 131 --> <20>
|
||||
0x03, 0x70, 0x00, 0x1c, // 132 --> <20>
|
||||
0x05, 0x40, 0x00, 0x10, 0x00, 0x04, // 133 --> <20>
|
||||
0x05, 0x04, 0xc2, 0x9f, 0x40, 0x00, // 134 --> <20>
|
||||
0x05, 0x14, 0xca, 0x9f, 0x42, 0x01, // 135 --> <20>
|
||||
0x05, 0xbe, 0x6a, 0x35, 0x28, 0x02, // 136 --> <20>
|
||||
0x05, 0xa8, 0x7f, 0x2a, 0x65, 0x00, // 137 --> <20>
|
||||
0x00, // 138 --> <20>
|
||||
0x03, 0x10, 0x14, 0x11, // 139 --> <20>
|
||||
0x00, // 140 --> <20>
|
||||
0x05, 0x04, 0xc1, 0x47, 0x40, 0x00, // 141 --> <20>
|
||||
0x05, 0x10, 0x10, 0x1f, 0x04, 0x01, // 142 --> <20>
|
||||
0x05, 0x08, 0x8e, 0x0a, 0x81, 0x00, // 143 --> <20>
|
||||
0x05, 0x08, 0x84, 0x8a, 0x83, 0x00, // 144 --> <20>
|
||||
0x00, // 145 --> <20>
|
||||
0x00, // 146 --> <20>
|
||||
0x00, // 147 --> <20>
|
||||
0x03, 0x07, 0xc0, 0x01, // 148 --> <20>
|
||||
0x03, 0x14, 0x04, 0x05, // 149 --> <20>
|
||||
0x03, 0x08, 0x04, 0x02, // 150 --> <20>
|
||||
0x05, 0x08, 0x04, 0x02, 0x81, 0x00, // 151 --> <20>
|
||||
0x00, // 152 -->
|
||||
0x00, // 153 --> <20>
|
||||
0x00, // 154 --> <20>
|
||||
0x03, 0x22, 0x0a, 0x02, // 155 --> <20>
|
||||
0x00, // 156 --> <20>
|
||||
0x05, 0x78, 0x30, 0x14, 0x49, 0x00, // 157 --> <20>
|
||||
0x05, 0x04, 0x24, 0x14, 0x8c, 0x07, // 158 --> <20>
|
||||
0x05, 0x90, 0x44, 0x61, 0xf0, 0x00, // 159 --> <20>
|
||||
0x05, 0x8f, 0x41, 0x21, 0x01, 0x01, // 160 --> <20>
|
||||
0x00, // 161 --> <20>
|
||||
0x00, // 162 --> <20>
|
||||
0x00, // 163 --> <20>
|
||||
0x05, 0x5d, 0x91, 0x48, 0xd4, 0x05, // 164 --> <20>
|
||||
0x00, // 165 --> <20>
|
||||
0x01, 0x77, // 166 --> <20>
|
||||
0x00, // 167 --> <20>
|
||||
0x05, 0xfe, 0xa5, 0x72, 0x29, 0x04, // 168 --> <20>
|
||||
0x05, 0xbe, 0xf1, 0x7a, 0xed, 0x03, // 169 --> <20>
|
||||
0x05, 0xbe, 0x64, 0x32, 0x29, 0x02, // 170 --> <20>
|
||||
0x05, 0x08, 0x8a, 0x8a, 0x22, 0x02, // 171 --> <20>
|
||||
0x05, 0x08, 0x04, 0x02, 0x81, 0x03, // 172 --> <20>
|
||||
0x00, // 173 --> <20>
|
||||
0x05, 0x9e, 0x50, 0x6d, 0xe5, 0x01, // 174 --> <20>
|
||||
0x05, 0x80, 0x00, 0x3f, 0x00, 0x00, // 175 --> <20>
|
||||
0x05, 0x83, 0x1d, 0x91, 0x88, 0x02, // 176 --> <20>
|
||||
0x03, 0x24, 0x17, 0x09, // 177 --> <20>
|
||||
0x00, // 178 --> <20>
|
||||
0x00, // 179 --> <20>
|
||||
0x00, // 180 --> <20>
|
||||
0x05, 0x7c, 0x08, 0x08, 0xc4, 0x03, // 181 --> <20>
|
||||
0x05, 0x86, 0x7f, 0xe0, 0x1f, 0x00, // 182 --> <20>
|
||||
0x03, 0x1c, 0x0e, 0x07, // 183 --> <20>
|
||||
0x04, 0x39, 0x6a, 0x15, 0x03, // 184 --> <20>
|
||||
0x04, 0x7c, 0x0c, 0x8c, 0x0f, // 185 --> <20>
|
||||
0x04, 0x38, 0x2a, 0x95, 0x08, // 186 --> <20>
|
||||
0x05, 0x22, 0x8a, 0x8a, 0x82, 0x00, // 187 --> <20>
|
||||
0x05, 0xc1, 0x60, 0x37, 0x18, 0x04, // 188 --> <20>
|
||||
0x05, 0xc1, 0x6e, 0xb0, 0x1b, 0x04, // 189 --> <20>
|
||||
0x05, 0xdd, 0x60, 0x37, 0xd8, 0x05, // 190 --> <20>
|
||||
0x05, 0x00, 0x02, 0x9c, 0x00, 0x00, // 191 --> <20>
|
||||
0x05, 0xfe, 0x48, 0x24, 0xe2, 0x07, // 192 --> <20>
|
||||
0x05, 0xff, 0x64, 0x32, 0x39, 0x03, // 193 --> <20>
|
||||
0x05, 0xff, 0x64, 0x32, 0x69, 0x03, // 194 --> <20>
|
||||
0x05, 0xff, 0x40, 0x20, 0x30, 0x00, // 195 --> <20>
|
||||
0x05, 0x60, 0x5f, 0xe8, 0x07, 0x06, // 196 --> <20>
|
||||
0x05, 0xff, 0x64, 0x32, 0x19, 0x04, // 197 --> <20>
|
||||
0x05, 0x77, 0xc4, 0x1f, 0x71, 0x07, // 198 --> <20>
|
||||
0x05, 0xc1, 0x64, 0x32, 0x69, 0x03, // 199 --> <20>
|
||||
0x05, 0x7f, 0x08, 0x82, 0xf0, 0x07, // 200 --> <20>
|
||||
0x05, 0xfe, 0x90, 0x24, 0xe1, 0x07, // 201 --> <20>
|
||||
0x05, 0x7f, 0x04, 0x45, 0x14, 0x04, // 202 --> <20>
|
||||
0x05, 0x40, 0x5f, 0x20, 0xf0, 0x07, // 203 --> <20>
|
||||
0x05, 0x7f, 0x01, 0x43, 0xf0, 0x07, // 204 --> <20>
|
||||
0x05, 0x7f, 0x04, 0x02, 0xf1, 0x07, // 205 --> <20>
|
||||
0x05, 0xbe, 0x60, 0x30, 0xe8, 0x03, // 206 --> <20>
|
||||
0x05, 0xff, 0x40, 0x20, 0xf0, 0x07, // 207 --> <20>
|
||||
0x05, 0xff, 0x44, 0x22, 0x61, 0x00, // 208 --> <20>
|
||||
0x05, 0xbe, 0x60, 0x30, 0x28, 0x02, // 209 --> <20>
|
||||
0x05, 0x81, 0xc0, 0x3f, 0x10, 0x00, // 210 --> <20>
|
||||
0x05, 0x27, 0x24, 0x12, 0xf9, 0x03, // 211 --> <20>
|
||||
0x05, 0x1c, 0xd1, 0x5f, 0xc4, 0x01, // 212 --> <20>
|
||||
0x05, 0x63, 0x1a, 0x82, 0x32, 0x06, // 213 --> <20>
|
||||
0x05, 0x3f, 0x10, 0xe8, 0x07, 0x06, // 214 --> <20>
|
||||
0x05, 0x07, 0x04, 0x02, 0xf1, 0x07, // 215 --> <20>
|
||||
0x05, 0x7f, 0xe0, 0x1f, 0xf8, 0x07, // 216 --> <20>
|
||||
0x05, 0x3f, 0xd0, 0x0f, 0xf4, 0x07, // 217 --> <20>
|
||||
0x05, 0x81, 0x3f, 0x12, 0x09, 0x03, // 218 --> <20>
|
||||
0x05, 0x7f, 0x24, 0x12, 0xf6, 0x07, // 219 --> <20>
|
||||
0x05, 0x7f, 0x24, 0x12, 0x09, 0x03, // 220 --> <20>
|
||||
0x05, 0xa2, 0x60, 0x32, 0xe9, 0x03, // 221 --> <20>
|
||||
0x05, 0x7f, 0x84, 0x2f, 0xe8, 0x03, // 222 --> <20>
|
||||
0x05, 0xc6, 0x54, 0x26, 0xf1, 0x07, // 223 --> <20>
|
||||
0x04, 0x20, 0x2a, 0x15, 0x0f, // 224 --> <20>
|
||||
0x04, 0xbe, 0x62, 0x11, 0x07, // 225 --> <20>
|
||||
0x04, 0x7c, 0x2a, 0x16, 0x04, // 226 --> <20>
|
||||
0x03, 0x7c, 0x02, 0x01, // 227 --> <20>
|
||||
0x05, 0x60, 0x1c, 0x89, 0x07, 0x06, // 228 --> <20>
|
||||
0x04, 0x38, 0x2a, 0x15, 0x03, // 229 --> <20>
|
||||
0x05, 0x6c, 0x08, 0x1f, 0xc2, 0x06, // 230 --> <20>
|
||||
0x04, 0x44, 0x2a, 0x15, 0x05, // 231 --> <20>
|
||||
0x04, 0x7c, 0x10, 0x84, 0x0f, // 232 --> <20>
|
||||
0x04, 0x7c, 0x90, 0xa4, 0x0f, // 233 --> <20>
|
||||
0x04, 0x7c, 0x08, 0x8a, 0x08, // 234 --> <20>
|
||||
0x04, 0x40, 0x1c, 0x81, 0x0f, // 235 --> <20>
|
||||
0x05, 0x7c, 0x04, 0x04, 0xc1, 0x07, // 236 --> <20>
|
||||
0x04, 0x7c, 0x08, 0x84, 0x0f, // 237 --> <20>
|
||||
0x04, 0x38, 0x22, 0x11, 0x07, // 238 --> <20>
|
||||
0x04, 0x7c, 0x02, 0x81, 0x0f, // 239 --> <20>
|
||||
0x04, 0x7c, 0x0a, 0x05, 0x01, // 240 --> <20>
|
||||
0x04, 0x38, 0x22, 0x11, 0x04, // 241 --> <20>
|
||||
0x03, 0x04, 0x3e, 0x01, // 242 --> <20>
|
||||
0x04, 0x0c, 0x28, 0x94, 0x07, // 243 --> <20>
|
||||
0x05, 0x10, 0x14, 0x1f, 0x05, 0x01, // 244 --> <20>
|
||||
0x04, 0x6c, 0x08, 0x84, 0x0d, // 245 --> <20>
|
||||
0x04, 0x3c, 0x10, 0x0f, 0x0c, // 246 --> <20>
|
||||
0x04, 0x0c, 0x08, 0x84, 0x0f, // 247 --> <20>
|
||||
0x05, 0x7c, 0x20, 0x1f, 0xc8, 0x07, // 248 --> <20>
|
||||
0x05, 0x3c, 0x10, 0x0f, 0xc4, 0x07, // 249 --> <20>
|
||||
0x04, 0x04, 0x3e, 0x14, 0x04, // 250 --> <20>
|
||||
0x05, 0x7c, 0x28, 0x14, 0xc4, 0x07, // 251 --> <20>
|
||||
0x04, 0x7c, 0x28, 0x14, 0x04, // 252 --> <20>
|
||||
0x04, 0x44, 0x2a, 0x15, 0x07, // 253 --> <20>
|
||||
0x05, 0x7c, 0x08, 0x8e, 0x88, 0x03, // 254 --> <20>
|
||||
0x04, 0x48, 0x1a, 0x85, 0x0f // 255 --> <20>
|
||||
};
|
||||
|
||||
|
27
STM32_HAL_Lib/fonts.h
Normal file
@@ -0,0 +1,27 @@
|
||||
/*
|
||||
ST7565 LCD Font library
|
||||
|
||||
Anton Mukhin, 2023
|
||||
*/
|
||||
|
||||
#ifndef INC_FONTS_H_
|
||||
#define INC_FONTS_H_
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#define FONT_HEADER 6
|
||||
|
||||
/* Font header map:
|
||||
uint8_t packed; // Is it a packed font?
|
||||
uint8_t width; // Font width in pixels
|
||||
uint8_t height; // Font height in pixels
|
||||
uint8_t space; // Space between characters
|
||||
uint8_t first; // First character code
|
||||
uint8_t last; // Last character code
|
||||
*/
|
||||
|
||||
extern const uint8_t font_5x7_vw[];
|
||||
|
||||
|
||||
|
||||
#endif /* INC_FONTS_H_ */
|
141
STM32_HAL_Lib/mctext.c
Normal file
@@ -0,0 +1,141 @@
|
||||
/*
|
||||
* mctext.c
|
||||
*
|
||||
* Created on: May 16, 2025
|
||||
* Author: Anton Mukhin
|
||||
*/
|
||||
|
||||
|
||||
#include "mctext.h"
|
||||
#include "ST7565.h"
|
||||
|
||||
//=========================== SET A FUNCTION NAME HERE! ===========================//
|
||||
// A function from display driver to set a pixel (x, y, color)
|
||||
void (*mct_SetPixel)(uint8_t, uint8_t, uint8_t) = ST7565_SetPixel;
|
||||
//=================================================================================//
|
||||
|
||||
|
||||
|
||||
|
||||
// Draw a single character. Returns width of drawn character
|
||||
uint8_t mct_CharTS(uint8_t x, uint8_t y, unsigned char c, uint8_t color, const uint8_t *font, uint8_t transp, uint8_t scale) {
|
||||
uint8_t pk = font[0]; // Is it a packed font?
|
||||
uint8_t w = font[1]; // Font char width
|
||||
uint8_t h = font[2]; // Font char height
|
||||
uint8_t fc = font[4]; // First char code in the font
|
||||
uint8_t lc = font[5]; // Last char code in the font
|
||||
uint8_t i, j, p, s, b, seg; // i-cur.column, j-cur.row of 8, p-rows of 8, s-height in cur.row of 8, b-cur.bit in cur.row, seg-byte.segment
|
||||
uint8_t bps; // Bytes per symbol for packed fonts
|
||||
uint16_t o; // Current offset
|
||||
uint8_t sx, sy; // To paint scaled pixel
|
||||
|
||||
if (c < fc || c > lc) return 0;
|
||||
if (x > LCDWIDTH) return 0;
|
||||
if (y + h * scale > LCDHEIGHT) return 0;
|
||||
|
||||
// Calc the offset for desired symbol
|
||||
if (pk) { // The font is packed
|
||||
if (w) { // The font is monospaced
|
||||
bps = w*h/8; // Bytes per symbol
|
||||
if ((w*h)%8 > 0) bps++; // Correction for the last byte
|
||||
o = FONT_HEADER+(c-fc)*bps; // Offset for desired symbol
|
||||
} else { // The font is not monospaced
|
||||
o = FONT_HEADER; // Starting offset
|
||||
for (i=0; i<c-fc; i++) { // Going through every symbol
|
||||
bps = font[o]*h/8; // Bytes per current symbol
|
||||
if ((font[o]*h)%8 > 0) bps++; // Correction for the last byte
|
||||
o += bps + 1; // Adding symbol's width to the offset (+ width byte)
|
||||
}
|
||||
w = font[o]; // Desired symbol's width
|
||||
o++; // Offset for desired symbol's data
|
||||
}
|
||||
|
||||
// Draw the packed symbol!
|
||||
bps = w*h/8; // Bytes per current symbol
|
||||
if ((w*h)%8 > 0) bps++; // Correction for the last byte
|
||||
b = 0; // bit indexer in "current" byte
|
||||
for (i=0; i<w*scale; i+=scale) { // Going through columns
|
||||
if (x+i > LCDWIDTH) return i-1; // Check if we're out of display size
|
||||
for (j=0; j<h*scale; j+=scale) { // Going through rows in column [i]
|
||||
if (b == 0) seg = font[o];
|
||||
if ((seg>>b) & 1) {
|
||||
for (sx = 0; sx < scale; sx++)
|
||||
for (sy = 0; sy < scale; sy++)
|
||||
mct_SetPixel(x+i+sx, y+j+sy, color); // Paint the pixel
|
||||
} else if (!transp) {
|
||||
for (sx = 0; sx < scale; sx++)
|
||||
for (sy = 0; sy < scale; sy++)
|
||||
mct_SetPixel(x+i+sx, y+j+sy, !color); // Paint the background pixel
|
||||
}
|
||||
if (b < 7) b++; else {b = 0; o++;} // Track bits and bytes
|
||||
}
|
||||
}
|
||||
|
||||
} else { // The font is not packed
|
||||
p = (h%8 > 0) ? h/8 + 1 : h/8; // Bytes in one column
|
||||
if (w) { // The font is monospaced
|
||||
o = FONT_HEADER+(c-fc)*w*p; // Offset for desired symbol
|
||||
} else { // The font is not monospaced
|
||||
o = FONT_HEADER; // Starting offset
|
||||
for (i=0; i<c-fc; i++) { // Going through every symbol
|
||||
o += font[o]*p + 1; // Adding symbol's width to the offset
|
||||
}
|
||||
w = font[o]; // Desired symbol's width
|
||||
o++; // Offset for desired symbol's data
|
||||
}
|
||||
|
||||
// Draw the symbol
|
||||
for (i=0; i<w*scale; i+=scale) { // Going through columns
|
||||
if (x+i > LCDWIDTH) return i-1; // Check if we're out of display size
|
||||
for (j=0; j<p; j++) { // Going through bytes in single column
|
||||
s = (h - j*8 >= 8) ? 8 : (h - j*8) % 8; // Clac the amount of pixels in current byte
|
||||
|
||||
seg = font[o];
|
||||
for (b=0; b<s; b++) { // Going through the byte and paint the pixel if the bit is 1
|
||||
if ((seg>>b) & 1) {
|
||||
for (sx = 0; sx < scale; sx++)
|
||||
for (sy = 0; sy < scale; sy++)
|
||||
mct_SetPixel(x+i+sx, y+j*8*scale+b*scale+sy, color);
|
||||
} else if (!transp) {
|
||||
for (sx = 0; sx < scale; sx++)
|
||||
for (sy = 0; sy < scale; sy++)
|
||||
mct_SetPixel(x+i+sx, y+j*8*scale+b*scale+sy, !color);
|
||||
}
|
||||
}
|
||||
o++;
|
||||
}
|
||||
//mct_SetPixel(x+i, y, color); // For testing purposes
|
||||
}
|
||||
}
|
||||
return w*scale;
|
||||
}
|
||||
|
||||
// Draw a single character. Not scaled
|
||||
uint8_t mct_CharT(uint8_t x, uint8_t y, unsigned char c, uint8_t color, const uint8_t *font, uint8_t transp) {
|
||||
return mct_CharTS(x, y, c, color, font, transp, 1);
|
||||
}
|
||||
|
||||
// Draw a single character. Transparent background. Returns width of drawn character
|
||||
uint8_t mct_Char(uint8_t x, uint8_t y, unsigned char c, uint8_t color, const uint8_t *font) {
|
||||
return mct_CharT(x, y, c, color, font, 1);
|
||||
}
|
||||
|
||||
// Draw a string of characters. Transparency, Scale
|
||||
void mct_StringTS(uint8_t x, uint8_t y, const char *c, uint8_t color, const uint8_t *font, uint8_t transp, uint8_t scale) {
|
||||
uint8_t w = font[1]; // Font char width
|
||||
uint8_t h = font[2]; // Font char height
|
||||
uint8_t s = font[3]; // Font space between characters
|
||||
|
||||
if (y+h*scale > LCDHEIGHT) return;
|
||||
while (c[0] != 0) {
|
||||
//if (x+w > LCDWIDTH) return;
|
||||
w = mct_CharTS(x, y, (unsigned char)*c, color, font, transp, scale);
|
||||
c++;
|
||||
x += w + s*scale;
|
||||
}
|
||||
}
|
||||
|
||||
// Draw a string of characters
|
||||
void mct_String(uint8_t x, uint8_t y, const char *c, uint8_t color, const uint8_t *font) {
|
||||
mct_StringTS(x, y, c, color, font, 1, 1);
|
||||
}
|
29
STM32_HAL_Lib/mctext.h
Normal file
@@ -0,0 +1,29 @@
|
||||
/*
|
||||
* mctext.h
|
||||
*
|
||||
* Created on: May 16, 2025
|
||||
* Author: Anton Mukhin
|
||||
*/
|
||||
|
||||
#ifndef INC_MCTEXT_H_
|
||||
#define INC_MCTEXT_H_
|
||||
|
||||
#include "stm32g0xx_hal.h"
|
||||
|
||||
|
||||
// Draw a single character. Returns width of drawn character
|
||||
uint8_t mct_CharTS(uint8_t x, uint8_t y, unsigned char c, uint8_t color, const uint8_t *font, uint8_t transp, uint8_t scale);
|
||||
|
||||
// Draw a single character. Not scaled
|
||||
uint8_t mct_CharT(uint8_t x, uint8_t y, unsigned char c, uint8_t color, const uint8_t *font, uint8_t transp);
|
||||
|
||||
// Draw a single character. Transparent background. Returns width of drawn character
|
||||
uint8_t mct_Char(uint8_t x, uint8_t y, unsigned char c, uint8_t color, const uint8_t *font);
|
||||
|
||||
// Draw a string of characters. Transparency, Scale
|
||||
void mct_StringTS(uint8_t x, uint8_t y, const char *c, uint8_t color, const uint8_t *font, uint8_t transp, uint8_t scale);
|
||||
|
||||
// Draw a string of characters
|
||||
void mct_String(uint8_t x, uint8_t y, const char *c, uint8_t color, const uint8_t *font);
|
||||
|
||||
#endif /* INC_MCTEXT_H_ */
|
8
TODO.txt
@@ -1,7 +1,11 @@
|
||||
Application:
|
||||
- Consider migrating to WPF in order to make DPI aware UI
|
||||
V Export comments now respects "Code in Hex" checkbox on the main form
|
||||
|
||||
Functionality:
|
||||
|
||||
|
||||
Bugs:
|
||||
V EncodingProvider hotfix
|
||||
V Check if frame changed before exit application
|
||||
V Frame modified flag persists when switching to another frame after rejected to save previous frame
|
||||
V Ctrl-C, Ctrl-V doesn't work in the Note editbox because it tries to copy/paste the frame!
|
||||
V Post "Backslash" instead of \ in comments
|
BIN
examples/46PixVN3_vw_cyr.mbfont
Normal file
BIN
examples/Cursors.mbfont
Normal file
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_cyr.mbfont
Normal file
BIN
examples/Font_5x7_vw_narrow.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/Logo - Anton Mukhin_19x19.mbfont
Normal file
BIN
examples/Logo - Anton Mukhin_40x40.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/icons_14x14.mbfont
Normal file
BIN
examples/pixel_3x5_Cyr.mbfont
Normal file
BIN
examples/tests/flipper.mbfont
Normal file
BIN
examples/tests/flipper_1.mbfont
Normal file
BIN
examples/tests/flipper_3.mbfont
Normal file
BIN
icons/famfamfam/arrow_out.png
Normal file
After Width: | Height: | Size: 594 B |
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/fam_lines.png
Normal file
After Width: | Height: | Size: 174 B |
BIN
icons/famfamfam/fam_mid.png
Normal file
After Width: | Height: | Size: 137 B |
BIN
icons/famfamfam/fam_top.png
Normal file
After Width: | Height: | Size: 136 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/picture_save.png
Normal file
After Width: | Height: | Size: 755 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 |
BIN
images/Screenshot_Frame-screenshot.png
Normal file
After Width: | Height: | Size: 8.7 KiB |
Before Width: | Height: | Size: 49 KiB After Width: | Height: | Size: 52 KiB |