Some small UI changes and TODO feature: Export image with All characers table

This commit is contained in:
Anton Mukhin
2025-05-29 16:49:25 +03:00
parent 92027a0ee3
commit 8d34e34326
13 changed files with 194 additions and 26 deletions

1
.gitignore vendored
View File

@@ -5,6 +5,7 @@
## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore ## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore
examples/tests/32x32/ examples/tests/32x32/
examples/tests/PNGout/
# User-specific files # User-specific files
*.rsuser *.rsuser

View File

@@ -134,6 +134,12 @@
toolTip1.SetToolTip(cbZoom, "Zoom level"); toolTip1.SetToolTip(cbZoom, "Zoom level");
cbZoom.SelectedIndexChanged += ZoomChanged; cbZoom.SelectedIndexChanged += ZoomChanged;
// //
// toolTip1
//
toolTip1.AutoPopDelay = 10000;
toolTip1.InitialDelay = 500;
toolTip1.ReshowDelay = 100;
//
// chkBaseline // chkBaseline
// //
chkBaseline.AutoSize = true; chkBaseline.AutoSize = true;

View File

@@ -67,6 +67,7 @@
importTextToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem(); importTextToolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
importImageToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); importImageToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
exportToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); exportToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
exportFontLayoutPNGToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
exitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); exitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
editToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); editToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
undoToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); undoToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
@@ -83,6 +84,7 @@
removeBeforeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); removeBeforeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
removeAfterToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); removeAfterToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
CodeShiftToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); CodeShiftToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
testFontToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
canvasToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); canvasToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
ClearToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); ClearToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
FillToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); FillToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
@@ -107,7 +109,10 @@
lblSelectionLabel = new System.Windows.Forms.Label(); lblSelectionLabel = new System.Windows.Forms.Label();
lblSelection = new System.Windows.Forms.Label(); lblSelection = new System.Windows.Forms.Label();
lblModified = new System.Windows.Forms.Label(); lblModified = new System.Windows.Forms.Label();
testFontToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); dlgSavePNG = new System.Windows.Forms.SaveFileDialog();
toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator();
toolStripSeparator3 = new System.Windows.Forms.ToolStripSeparator();
((System.ComponentModel.ISupportInitialize)nudX).BeginInit(); ((System.ComponentModel.ISupportInitialize)nudX).BeginInit();
((System.ComponentModel.ISupportInitialize)nudY).BeginInit(); ((System.ComponentModel.ISupportInitialize)nudY).BeginInit();
panel1.SuspendLayout(); panel1.SuspendLayout();
@@ -528,9 +533,9 @@
// //
// fileToolStripMenuItem // fileToolStripMenuItem
// //
fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { newToolStripMenuItem, openToolStripMenuItem, saveToolStripMenuItem, saveAsToolStripMenuItem, importTextToolStripMenuItem1, importImageToolStripMenuItem, exportToolStripMenuItem, exitToolStripMenuItem }); fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { newToolStripMenuItem, openToolStripMenuItem, saveToolStripMenuItem, saveAsToolStripMenuItem, toolStripSeparator1, importTextToolStripMenuItem1, importImageToolStripMenuItem, exportToolStripMenuItem, exportFontLayoutPNGToolStripMenuItem, toolStripSeparator2, exitToolStripMenuItem });
fileToolStripMenuItem.Name = "fileToolStripMenuItem"; fileToolStripMenuItem.Name = "fileToolStripMenuItem";
fileToolStripMenuItem.Size = new System.Drawing.Size(37, 20); fileToolStripMenuItem.Size = new System.Drawing.Size(122, 20);
fileToolStripMenuItem.Text = "File"; fileToolStripMenuItem.Text = "File";
// //
// newToolStripMenuItem // newToolStripMenuItem
@@ -583,6 +588,7 @@
importTextToolStripMenuItem1.Name = "importTextToolStripMenuItem1"; importTextToolStripMenuItem1.Name = "importTextToolStripMenuItem1";
importTextToolStripMenuItem1.Size = new System.Drawing.Size(224, 22); importTextToolStripMenuItem1.Size = new System.Drawing.Size(224, 22);
importTextToolStripMenuItem1.Text = "Import text file (very limited)"; importTextToolStripMenuItem1.Text = "Import text file (very limited)";
importTextToolStripMenuItem1.ToolTipText = "Import a font from a C array in a file";
importTextToolStripMenuItem1.Click += importTextToolStripMenuItem1_Click; importTextToolStripMenuItem1.Click += importTextToolStripMenuItem1_Click;
// //
// importImageToolStripMenuItem // importImageToolStripMenuItem
@@ -605,6 +611,15 @@
exportToolStripMenuItem.ToolTipText = "Configure and export data"; exportToolStripMenuItem.ToolTipText = "Configure and export data";
exportToolStripMenuItem.Click += button1_Click; exportToolStripMenuItem.Click += button1_Click;
// //
// exportFontLayoutPNGToolStripMenuItem
//
exportFontLayoutPNGToolStripMenuItem.Image = Properties.Resources.picture_go;
exportFontLayoutPNGToolStripMenuItem.Name = "exportFontLayoutPNGToolStripMenuItem";
exportFontLayoutPNGToolStripMenuItem.Size = new System.Drawing.Size(224, 22);
exportFontLayoutPNGToolStripMenuItem.Text = "Export font layout PNG";
exportFontLayoutPNGToolStripMenuItem.ToolTipText = "Create an image with all a table showing all 256 symbols";
exportFontLayoutPNGToolStripMenuItem.Click += ExportPNG;
//
// exitToolStripMenuItem // exitToolStripMenuItem
// //
exitToolStripMenuItem.Image = Properties.Resources.Famfamfam_Silk_Door_out_16; exitToolStripMenuItem.Image = Properties.Resources.Famfamfam_Silk_Door_out_16;
@@ -629,7 +644,7 @@
undoToolStripMenuItem.Image = Properties.Resources.arrow_undo; undoToolStripMenuItem.Image = Properties.Resources.arrow_undo;
undoToolStripMenuItem.Name = "undoToolStripMenuItem"; undoToolStripMenuItem.Name = "undoToolStripMenuItem";
undoToolStripMenuItem.ShortcutKeys = System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Z; undoToolStripMenuItem.ShortcutKeys = System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Z;
undoToolStripMenuItem.Size = new System.Drawing.Size(164, 22); undoToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
undoToolStripMenuItem.Text = "Undo"; undoToolStripMenuItem.Text = "Undo";
undoToolStripMenuItem.ToolTipText = "Undo last canvas change"; undoToolStripMenuItem.ToolTipText = "Undo last canvas change";
undoToolStripMenuItem.Click += undoToolStripMenuItem_Click; undoToolStripMenuItem.Click += undoToolStripMenuItem_Click;
@@ -639,7 +654,7 @@
redoToolStripMenuItem.Image = Properties.Resources.arrow_redo; redoToolStripMenuItem.Image = Properties.Resources.arrow_redo;
redoToolStripMenuItem.Name = "redoToolStripMenuItem"; redoToolStripMenuItem.Name = "redoToolStripMenuItem";
redoToolStripMenuItem.ShortcutKeys = System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Y; redoToolStripMenuItem.ShortcutKeys = System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Y;
redoToolStripMenuItem.Size = new System.Drawing.Size(164, 22); redoToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
redoToolStripMenuItem.Text = "Redo"; redoToolStripMenuItem.Text = "Redo";
redoToolStripMenuItem.ToolTipText = "Redo canvas change"; redoToolStripMenuItem.ToolTipText = "Redo canvas change";
redoToolStripMenuItem.Click += redoToolStripMenuItem_Click; redoToolStripMenuItem.Click += redoToolStripMenuItem_Click;
@@ -650,7 +665,7 @@
copyToolStripMenuItem.Name = "copyToolStripMenuItem"; copyToolStripMenuItem.Name = "copyToolStripMenuItem";
copyToolStripMenuItem.ShortcutKeyDisplayString = ""; copyToolStripMenuItem.ShortcutKeyDisplayString = "";
copyToolStripMenuItem.ShortcutKeys = System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.C; copyToolStripMenuItem.ShortcutKeys = System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.C;
copyToolStripMenuItem.Size = new System.Drawing.Size(164, 22); copyToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
copyToolStripMenuItem.Text = "Copy"; copyToolStripMenuItem.Text = "Copy";
copyToolStripMenuItem.ToolTipText = "Copy current symbol to clipboard"; copyToolStripMenuItem.ToolTipText = "Copy current symbol to clipboard";
copyToolStripMenuItem.Click += copyToolStripMenuItem_Click; copyToolStripMenuItem.Click += copyToolStripMenuItem_Click;
@@ -662,7 +677,7 @@
pasteToolStripMenuItem.Name = "pasteToolStripMenuItem"; pasteToolStripMenuItem.Name = "pasteToolStripMenuItem";
pasteToolStripMenuItem.ShortcutKeyDisplayString = ""; pasteToolStripMenuItem.ShortcutKeyDisplayString = "";
pasteToolStripMenuItem.ShortcutKeys = System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.V; pasteToolStripMenuItem.ShortcutKeys = System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.V;
pasteToolStripMenuItem.Size = new System.Drawing.Size(164, 22); pasteToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
pasteToolStripMenuItem.Text = "Paste"; pasteToolStripMenuItem.Text = "Paste";
pasteToolStripMenuItem.ToolTipText = "Paste from clipboard to current symbol"; pasteToolStripMenuItem.ToolTipText = "Paste from clipboard to current symbol";
pasteToolStripMenuItem.Click += pasteToolStripMenuItem_Click; pasteToolStripMenuItem.Click += pasteToolStripMenuItem_Click;
@@ -672,8 +687,9 @@
selectToolStripMenuItem.Image = Properties.Resources.fam_rectt; selectToolStripMenuItem.Image = Properties.Resources.fam_rectt;
selectToolStripMenuItem.Name = "selectToolStripMenuItem"; selectToolStripMenuItem.Name = "selectToolStripMenuItem";
selectToolStripMenuItem.ShortcutKeys = System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.R; selectToolStripMenuItem.ShortcutKeys = System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.R;
selectToolStripMenuItem.Size = new System.Drawing.Size(164, 22); selectToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
selectToolStripMenuItem.Text = "Select"; selectToolStripMenuItem.Text = "Select";
selectToolStripMenuItem.ToolTipText = "Toggle Rectangle selection tool";
selectToolStripMenuItem.Click += selectToolStripMenuItem_Click; selectToolStripMenuItem.Click += selectToolStripMenuItem_Click;
// //
// selectAllToolStripMenuItem // selectAllToolStripMenuItem
@@ -682,13 +698,14 @@
selectAllToolStripMenuItem.Image = Properties.Resources.arrow_out; selectAllToolStripMenuItem.Image = Properties.Resources.arrow_out;
selectAllToolStripMenuItem.Name = "selectAllToolStripMenuItem"; selectAllToolStripMenuItem.Name = "selectAllToolStripMenuItem";
selectAllToolStripMenuItem.ShortcutKeys = System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.A; selectAllToolStripMenuItem.ShortcutKeys = System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.A;
selectAllToolStripMenuItem.Size = new System.Drawing.Size(164, 22); selectAllToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
selectAllToolStripMenuItem.Text = "Select All"; selectAllToolStripMenuItem.Text = "Select All";
selectAllToolStripMenuItem.ToolTipText = "Select entire canvas";
selectAllToolStripMenuItem.Click += selectAllToolStripMenuItem_Click; selectAllToolStripMenuItem.Click += selectAllToolStripMenuItem_Click;
// //
// fontToolStripMenuItem // fontToolStripMenuItem
// //
fontToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { makeVarWidthToolStripMenuItem, prependSymbolToolStripMenuItem, appendSymbolToolStripMenuItem, removeSymbolToolStripMenuItem, removeBeforeToolStripMenuItem, removeAfterToolStripMenuItem, CodeShiftToolStripMenuItem, testFontToolStripMenuItem }); fontToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { makeVarWidthToolStripMenuItem, prependSymbolToolStripMenuItem, appendSymbolToolStripMenuItem, removeSymbolToolStripMenuItem, removeBeforeToolStripMenuItem, removeAfterToolStripMenuItem, CodeShiftToolStripMenuItem, toolStripSeparator3, testFontToolStripMenuItem });
fontToolStripMenuItem.Name = "fontToolStripMenuItem"; fontToolStripMenuItem.Name = "fontToolStripMenuItem";
fontToolStripMenuItem.Size = new System.Drawing.Size(43, 20); fontToolStripMenuItem.Size = new System.Drawing.Size(43, 20);
fontToolStripMenuItem.Text = "Font"; fontToolStripMenuItem.Text = "Font";
@@ -768,6 +785,15 @@
CodeShiftToolStripMenuItem.ToolTipText = "Shift the font on the code line"; CodeShiftToolStripMenuItem.ToolTipText = "Shift the font on the code line";
CodeShiftToolStripMenuItem.Click += CodeShiftToolStripMenuItem_Click; CodeShiftToolStripMenuItem.Click += CodeShiftToolStripMenuItem_Click;
// //
// testFontToolStripMenuItem
//
testFontToolStripMenuItem.Image = Properties.Resources.font;
testFontToolStripMenuItem.Name = "testFontToolStripMenuItem";
testFontToolStripMenuItem.Size = new System.Drawing.Size(215, 22);
testFontToolStripMenuItem.Text = "Test font";
testFontToolStripMenuItem.ToolTipText = "Open dialog where you can test the font with any text you type";
testFontToolStripMenuItem.Click += TestFont_Click;
//
// canvasToolStripMenuItem // canvasToolStripMenuItem
// //
canvasToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { ClearToolStripMenuItem, FillToolStripMenuItem, shiftUpToolStripMenuItem, shiftDownToolStripMenuItem, shiftLeftToolStripMenuItem, shiftRightToolStripMenuItem, invertToolStripMenuItem, mirrorXToolStripMenuItem, mirrorYToolStripMenuItem, applyToolStripMenuItem }); canvasToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { ClearToolStripMenuItem, FillToolStripMenuItem, shiftUpToolStripMenuItem, shiftDownToolStripMenuItem, shiftLeftToolStripMenuItem, shiftRightToolStripMenuItem, invertToolStripMenuItem, mirrorXToolStripMenuItem, mirrorYToolStripMenuItem, applyToolStripMenuItem });
@@ -1024,13 +1050,25 @@
lblModified.Text = "Frame modified"; lblModified.Text = "Frame modified";
lblModified.Visible = false; lblModified.Visible = false;
// //
// testFontToolStripMenuItem // dlgSavePNG
// //
testFontToolStripMenuItem.Image = Properties.Resources.font; dlgSavePNG.DefaultExt = "png";
testFontToolStripMenuItem.Name = "testFontToolStripMenuItem"; dlgSavePNG.Filter = "PNG Image|*.png;*.PNG";
testFontToolStripMenuItem.Size = new System.Drawing.Size(215, 22); //
testFontToolStripMenuItem.Text = "Test font"; // toolStripSeparator1
testFontToolStripMenuItem.Click += TestFont_Click; //
toolStripSeparator1.Name = "toolStripSeparator1";
toolStripSeparator1.Size = new System.Drawing.Size(221, 6);
//
// toolStripSeparator2
//
toolStripSeparator2.Name = "toolStripSeparator2";
toolStripSeparator2.Size = new System.Drawing.Size(221, 6);
//
// toolStripSeparator3
//
toolStripSeparator3.Name = "toolStripSeparator3";
toolStripSeparator3.Size = new System.Drawing.Size(212, 6);
// //
// MainForm // MainForm
// //
@@ -1167,6 +1205,11 @@
private System.Windows.Forms.ToolStripMenuItem selectAllToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem selectAllToolStripMenuItem;
private System.Windows.Forms.Label lblModified; private System.Windows.Forms.Label lblModified;
private System.Windows.Forms.ToolStripMenuItem testFontToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem testFontToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem exportFontLayoutPNGToolStripMenuItem;
private System.Windows.Forms.SaveFileDialog dlgSavePNG;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator1;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator2;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator3;
} }
} }

View File

@@ -3,6 +3,7 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Drawing; using System.Drawing;
using System.Drawing.Drawing2D; using System.Drawing.Drawing2D;
using System.Drawing.Imaging;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
@@ -57,7 +58,7 @@ namespace McBitFont {
public bool monospaced = false; public bool monospaced = false;
private bool modified = false; private bool modified = false;
private bool prjModified = false; private bool prjModified = false;
public const string version = "2.2"; public const string version = "2.3";
public string prjName = "Untitled"; public string prjName = "Untitled";
public string prjFileName = ""; public string prjFileName = "";
public int codepage = 1251; public int codepage = 1251;
@@ -932,6 +933,8 @@ namespace McBitFont {
prjFileName = filename; prjFileName = filename;
prjName = Path.GetFileNameWithoutExtension(filename); prjName = Path.GetFileNameWithoutExtension(filename);
dlgSavePNG.FileName = prjName + ".png";
dlgSave.FileName = prjName + ".mbfont";
SetWindowCap(); SetWindowCap();
miniList.Items[0].Selected = true; miniList.Items[0].Selected = true;
@@ -1429,5 +1432,100 @@ namespace McBitFont {
var tester = new FontTester(codepage, dotHeight, baseline, frames); var tester = new FontTester(codepage, dotHeight, baseline, frames);
tester.ShowDialog(); tester.ShowDialog();
} }
private void ExportPNG(object sender, EventArgs e) {
CheckModifiedFrame();
CheckModifiedProject();
if (dlgSavePNG.ShowDialog() == DialogResult.OK) {
int pixelSize = 3;
int symbolMargin = 2 * pixelSize;
int headerHeight = 100;
int maxWidth = 0;
int i, j, v, h, x, y;
string s;
foreach (FrameMiniature f in frames) {
if (f.width > maxWidth) maxWidth = f.width;
}
int cellWidth = (pixelSize * maxWidth + 2 * symbolMargin);
int cellHeight = (pixelSize * dotHeight + 2 * symbolMargin);
if (cellWidth < 10) cellWidth = 10;
if (cellHeight < 10) cellHeight = 10;
int width = cellWidth * 16 + 17 + 50;
int height = cellHeight * 16 + 17 + 25 + headerHeight;
Bitmap bmp = new(width > 450 ? width : 450, height);
Graphics g = Graphics.FromImage(bmp);
g.TextRenderingHint = System.Drawing.Text.TextRenderingHint.AntiAliasGridFit;
Font font = new("Consolas", 14, FontStyle.Bold);
Brush tb = Brushes.Black;
// Draw basic information
g.DrawString("Font project name: " + prjName, font, tb, 10, 10);
g.DrawString("Font height: " + dotHeight, font, tb, 10, 38);
g.DrawString("Font max width: " + maxWidth, font, tb, 10, 62);
g.DrawString("Symbols count: " + frames.Count, font, tb, 10, 86);
g.DrawString("First code: " + frames.First().code.ToString(), font, tb, 250, 38);
g.DrawString("Last code: " + frames.Last().code.ToString(), font, tb, 250, 62);
g.DrawString("Codepage: " + codepage.ToString(), font, tb, 250, 86);
// Draw grid
Pen p = new(Color.FromArgb(64, 0, 0, 0), 1);
SolidBrush b = new SolidBrush(Color.FromArgb(160, Color.Black));
//Brush b = Brushes.Black;
int xCapOffset = cellWidth / 2 - 8;
int yCapOffset = cellHeight / 2 - 10;
for (i = 0; i < 17; i++) {
x = 50 + 17 + i * cellWidth - 1;
y = headerHeight + 17 + 25 + i * cellHeight - 1;
g.DrawLine(p, 1, y, width - 1, y);
g.DrawLine(p, x, headerHeight + 20, x, headerHeight + height - 20);
if (i != 16) {
s = Convert.ToString(i, 16).ToUpper();
g.DrawString(s, font, b, x + xCapOffset, headerHeight + 20);
s = "0x" + Convert.ToString(i * 16, 16).PadLeft(2, '0').ToUpper();
g.DrawString(s, font, b, 10, y + yCapOffset);
}
}
// Draw symbols
int code;
List<FrameMiniature> ff;
Rectangle rect;
// Cycle through grid cells
for (v = 0; v < 16; v++) {
for (h = 0; h < 16; h++) {
// Check if the font has a symbol with the code
code = 16 * v + h;
ff = frames.FindAll(x => x.code == code);
if (ff.Count == 1) {
x = 50 + 17 + h * cellWidth + symbolMargin;
y = headerHeight + 17 + 25 + v * cellHeight + symbolMargin;
// Cycly through symbol's pixels and draw the black ones
for (i = 0; i < ff[0].width; i++) {
for (j = 0; j < ff[0].height; j++) {
if (ff[0].data[i, j]) {
rect = new Rectangle(x + i * pixelSize, y + j * pixelSize, pixelSize, pixelSize);
g.FillRectangle(tb, rect);
}
}
}
}
}
}
bmp.Save(dlgSavePNG.FileName, ImageFormat.Png);
}
}
} }
} }

View File

@@ -135,6 +135,9 @@
<metadata name="dlgOpen.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <metadata name="dlgOpen.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>336, 17</value> <value>336, 17</value>
</metadata> </metadata>
<metadata name="dlgSavePNG.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>644, 17</value>
</metadata>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> <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"> <data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value> <value>

View File

@@ -20,9 +20,9 @@
<UseWindowsForms>true</UseWindowsForms> <UseWindowsForms>true</UseWindowsForms>
<ImportWindowsDesktopTargets>true</ImportWindowsDesktopTargets> <ImportWindowsDesktopTargets>true</ImportWindowsDesktopTargets>
<ApplicationIcon>icon_64.ico</ApplicationIcon> <ApplicationIcon>icon_64.ico</ApplicationIcon>
<AssemblyVersion>2.2.0.0</AssemblyVersion> <AssemblyVersion>2.3.0.0</AssemblyVersion>
<FileVersion>2.2.0.0</FileVersion> <FileVersion>2.3.0.0</FileVersion>
<Version>$(VersionPrefix)2.2.0</Version> <Version>$(VersionPrefix)2.3.0</Version>
<Copyright>Anton Mukhin</Copyright> <Copyright>Anton Mukhin</Copyright>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">

View File

@@ -310,6 +310,16 @@ 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> /// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap. /// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary> /// </summary>

View File

@@ -136,12 +136,18 @@
<data name="Famfamfam-Silk-Page-copy.16" type="System.Resources.ResXFileRef, System.Windows.Forms"> <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> <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>
<data name="font" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\font.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="arrow_inout" type="System.Resources.ResXFileRef, System.Windows.Forms"> <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> <value>..\Resources\arrow_inout.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data> </data>
<data name="arrow_redo" type="System.Resources.ResXFileRef, System.Windows.Forms"> <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> <value>..\Resources\redo.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data> </data>
<data name="Famfamfam-Silk-Disk.16" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Famfamfam-Silk-Disk.16.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="icon" type="System.Resources.ResXFileRef, System.Windows.Forms"> <data name="icon" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\icon.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> <value>..\Resources\icon.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data> </data>
@@ -202,9 +208,6 @@
<data name="Famfamfam-Silk-Page-white.16" type="System.Resources.ResXFileRef, System.Windows.Forms"> <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> <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>
<data name="Famfamfam-Silk-Disk.16" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Famfamfam-Silk-Disk.16.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="folder_table" type="System.Resources.ResXFileRef, System.Windows.Forms"> <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> <value>..\Resources\folder_table.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data> </data>
@@ -229,7 +232,7 @@
<data name="icon_64" type="System.Resources.ResXFileRef, System.Windows.Forms"> <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> <value>..\Resources\icon_64.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data> </data>
<data name="font" type="System.Resources.ResXFileRef, System.Windows.Forms"> <data name="picture_go" 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> <value>..\Resources\picture_go.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data> </data>
</root> </root>

Binary file not shown.

After

Width:  |  Height:  |  Size: 758 B

View File

@@ -52,3 +52,7 @@ Import Image dialog
Code Shift dialog Code Shift dialog
![Code Shift](/images/Screenshot_Code-shift.png) ![Code Shift](/images/Screenshot_Code-shift.png)
Font PNG export example
![PNG export example](/images/Font_Minecraft_Rus_5x7_vw.png)

View File

@@ -4,7 +4,7 @@ Application:
Functionality: Functionality:
V Allow to add frames to Single-frame "fonts" V Allow to add frames to Single-frame "fonts"
V Type a string to see the result (test the font) V Type a string to see the result (test the font)
- Export image with All characers table V Export image with All characers table
Bugs: Bugs:
- In some cases after switching to a symbol dotPanel mouse move causes "Out of range" exception (history.Pre after width change?) - In some cases after switching to a symbol dotPanel mouse move causes "Out of range" exception (history.Pre after width change?)

Binary file not shown.

After

Width:  |  Height:  |  Size: 758 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB