Omnimaga

Calculator Community => Other Calc-Related Projects and Ideas => TI Z80 => Topic started by: DrDnar on June 25, 2013, 08:16:04 pm

Title: Monochrome Font Editor
Post by: DrDnar on June 25, 2013, 08:16:04 pm
For years I've been generating my own fonts for various projects using a font editor I made as one of my first desktop applications. Recently I decided to rewrite it from scratch, cleaning up its code significantly. This new version lets you generate fonts for zStart and Omnicalc. It can also generate .asm files matching the font format used by MicrOS for the TI-84+CSE, and I threw in three custom formats Zeda uses. It's easy to add new formats, and I'd like to add .FON support sometime. However, because this program is also the final project for a class assignment, the source will not be available until later this summer.

Due to .NET reflection abuse, this requires .NET 4.5 or above and therefore Windows Vista or above.

EDIT: After 13 downloads, I've created an updated version; see post below (http://ourl.ca/19132;msg=298432).
Title: Re: Monochrome Font Editor
Post by: DJ Omnimaga on June 25, 2013, 08:19:38 pm
Nice DrDnar. I have been using Yuki's font editor for a while (I think it was on-calc), but it was for Omnicalc and I wondered when there would be one for ZStart fonts. Does it edit Batlib fonts too?
Title: Re: Monochrome Font Editor
Post by: DrDnar on June 25, 2013, 09:01:51 pm
I forgot to upload screen shots.

Also, here are the basic features:
Title: Re: Monochrome Font Editor
Post by: DJ Omnimaga on June 25, 2013, 09:10:10 pm
This looks very nice. As mentionned on IRC, though, the Exports window throws the following Unhandled exception error under Windows 7 64 bits:


Code: [Select]
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.TypeInitializationException: The type initializer for 'Mfe.Exports.FontExporter' threw an exception. ---> System.MissingMethodException: Method not found: 'System.Collections.Generic.IEnumerable`1<System.Reflection.CustomAttributeData> System.Reflection.MemberInfo.get_CustomAttributes()'.
   at Mfe.Exports.FontExporter.Export..ctor(MethodInfo method)
   at Mfe.Exports.FontExporter.GetExportsList()
   at Mfe.Exports.FontExporter..cctor()
   --- End of inner exception stack trace ---
   at Mfe.ExportsWindow..ctor(MasterWindow master)
   at Mfe.MasterWindow.exportCodeToolStripMenuItem_Click(Object sender, EventArgs e)
   at System.Windows.Forms.ToolStripMenuItem.OnClick(EventArgs e)
   at System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)
   at System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e)
   at System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea)
   at System.Windows.Forms.ToolStripDropDown.OnMouseUp(MouseEventArgs mea)
   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ToolStrip.WndProc(Message& m)
   at System.Windows.Forms.ToolStripDropDown.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


************** Loaded Assemblies **************
mscorlib
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.296 (RTMGDR.030319-2900)
    CodeBase: file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/mscorlib.dll
----------------------------------------
Mfe
    Assembly Version: 1.0.0.0
    Win32 Version: 1.0.0.0
    CodeBase: file:///C:/Users/DJOmnimaga/AppData/Local/Opera/Opera/temporary_downloads/Mfe%20(3).exe
----------------------------------------
System.Windows.Forms
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.1002 built by: RTMGDR
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System.Drawing
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.1001 built by: RTMGDR
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
System
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.1001 built by: RTMGDR
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Core
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.233 built by: RTMGDR
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll
----------------------------------------
System.Xml
    Assembly Version: 4.0.0.0
    Win32 Version: 4.0.30319.233 built by: RTMGDR
    CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------

************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.

For example:

<configuration>
    <system.windows.forms jitDebugging="true" />
</configuration>

When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.



EDIT: Nevermind, it appears that I was one or two .NET versions behind.
Title: Re: Monochrome Font Editor
Post by: TIfanx1999 on June 25, 2013, 09:22:55 pm
This looks quite nice. I've made a few custom fonts in my time, but I've just used MS Paint or worked on them on calc. I'll give it a look when I have some time. :)
Title: Re: Monochrome Font Editor
Post by: DrDnar on June 26, 2013, 04:08:01 am
You asked for a readme, so I've embedded one within the application. Hopefully, it also clarifies the difference between Width and Data Width.

Edit: After four downloads, I noticed a serious bug. See this new post (http://ourl.ca/19132;msg=298566) for the fix.
Title: Re: Monochrome Font Editor
Post by: DJ Omnimaga on June 26, 2013, 04:20:42 am
Good to hear. I'll check it out the next time I try this app. :)

By the way would it be possible to have a font template, for example if someone doesn't want to redraw every font from scratch? It might be handy if he only plans to change a few characters or do some minor edits. It doesn't really have to be the official TI fonts, though.
Title: Re: Monochrome Font Editor
Post by: DrDnar on June 26, 2013, 04:47:34 am
It would be possible, but I'm not going to do so. I will, however, post these two files. You can use them as templates, if you really want. The first is a 5x7 font, and the other is the MicrOS CSE 9x14 font.
Title: Re: Monochrome Font Editor
Post by: Keoni29 on June 26, 2013, 09:26:20 am
I'd be cool if you could make actual .otf fonts with this tool.
Title: Re: Monochrome Font Editor
Post by: Xeda112358 on June 26, 2013, 10:34:57 am
I plan to work with this later, thanks! I really need a prettier font :P
Title: Re: Monochrome Font Editor
Post by: DJ Omnimaga on June 27, 2013, 03:49:03 am
Ok thanks DrDnar. I don't mind what font it is, if I have at least something to start with. :P

The typical Omnicalc font-based game in 2002-04 basically used standard fonts, but some characters that are rarely used in the game would be replaced with sprites, so the game looked like a graph screen game, but with a small gap between each sprite. IIRC End of Forever/Shattered Oasis on MaxCoderz used such technique in its final days.
Title: Re: Monochrome Font Editor
Post by: Sorunome on June 27, 2013, 07:53:39 am
This project sounds pretty useful, nice work!
Having each game using its own font would indeed make it more unique :)
Title: Re: Monochrome Font Editor
Post by: DJ Omnimaga on June 27, 2013, 09:42:35 am
To be honest, if I was gonna make a font for Illusiat series, for example, I would probably try to re-use the same font set for every game to make things easier, unless I really ran out of chars.
Title: Re: Monochrome Font Editor
Post by: DrDnar on June 27, 2013, 03:02:59 pm
Clearly, nobody has used this very much or they would have noticed that the last update breaks font loading. (The bug is actually in font saving. If you do happen to have saved a font using the broken version, you can fix it with a hex editor by changing offset 0x31 (49 in decimal) from 04 to 01.)

This update also adds support for the TI-84+CSE's 160x240 mode. ("Double Width" in font properties.)
Title: Re: Monochrome Font Editor
Post by: DJ Omnimaga on June 30, 2013, 05:35:45 pm
Yeah I was busy with other stuff (such as sleeping) so I didn't have much time yet >.<
Title: Re: Monochrome Font Editor
Post by: Xeda112358 on July 26, 2013, 08:37:01 am
Bug : The current version has "Magnificatio", missing an 'n' at the end.

I like that I can use the arrows to move the cursor and 'enter' to toggle the bit :)
Title: Re: Monochrome Font Editor
Post by: DrDnar on August 09, 2013, 03:55:23 pm
Bug : The current version has "Magnificatio", missing an 'n' at the end.
Where? Can you show me a screen shot? It may simply be that the 'n' got cut off because your computer is using a slightly larger font than mine.

I like that I can use the arrows to move the cursor and 'enter' to toggle the bit :)
Space works too, and there are keyboard shortcuts for navigating (Ctrl+W, Ctrl+P, Ctrl+N, Ctrl+F). The first font editor I made was keyboard-only. I've found that there are strengths and weaknesses to the keyboard and mouse, so I decided to implement both.

Also, this project isn't dead. I'm working on adding support for importing BDF fonts. I'll release the source soon.
Title: Re: Monochrome Font Editor
Post by: Xeda112358 on August 10, 2013, 12:38:40 am
It was the font size. I don't know why it was so big before, but I recently switched to an old theme and that font makes it fit. Thanks!
Title: Re: Monochrome Font Editor
Post by: DrDnar on August 23, 2013, 11:24:42 pm
New update! I've added support for importing BDF fonts and including a package of the 77 BDF fonts from the RockBox project. I'm publishing source code, too, so you can add your own exporters if you want. You'll need 7zip to extract the BDF package because compressing it with ZIP resulted in a file too big to upload.
Title: Re: Monochrome Font Editor
Post by: DrDnar on September 24, 2013, 01:22:39 pm
Update: Help now has topics, text preview has word wrap, and it now runs on .NET 3.5 Client Profile, so it should work on Vista out-of-the-box.
Title: Re: Monochrome Font Editor
Post by: DJ Omnimaga on September 24, 2013, 02:32:12 pm
I didn't have time to check the last two versions, but is it now possible to instantly import 8xp fonts into MFE or vice-versa? If I recall correctly, Yuki's on-calc Font Editor let us do that, but it only supported Omnicalc. Or is there some limitation that prevents this from being easily doable on a computer?

EDIT: Nvm it does for Omnicalc and ZStart now. Good