Mittens 2018 will be in Boston this September. There are three spaces left, so check out the thread for details!

Author Topic: EDITOR PLUGIN: WFN-FontEditor  (Read 11181 times)

EDITOR PLUGIN: WFN-FontEditor
« on: 27 Jun 2013, 19:19 »
Hi,

here is the brand new WFN-FontEditor.

It comes in two versions:
1. A standalone version like Radiants FontEditor
2. As a plugin to AGS

Now it is available the Version 1.2.1.0

Download Version 1.2.0.0
Download Version 1.2.0.0 sources
Download Version 1.2.0.1
Download: Download Version 1.2.1.0

A bugfix release is out.

Additional features:

Since 1.2.0.1:
- save the selection field background color                                (p/s)
- save the state of the grid option                                             (p/s)
- save the render text                                                                (p/s)
- render the font in an example text                                          (p/s)
- change the color of the selection field with right click on it      (p/s)
- extend the font to 256 character                                             (p/s)
- show, if a font is 128 or 256 characters                                   (p/s)

Since 1.2.1.0:
- correct a mistake, that saves a corrupted file



By the way, it was a nice practice to code.
Rulaman


PS: I updated this post to reflect the new changes
« Last Edit: 26 Sep 2014, 18:40 by Rulaman »
Zak: Komm mit mir Sushi.
Zak: Come with me Sushi.

Crimson Wizard

  • AGS Project Tracker Admins
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    •  
    • Lifetime Achievement Award Winner
    •  
    • Crimson Wizard worked on a game that was nominated for an AGS Award!
      Crimson Wizard worked on a game that won an AGS Award!
Re: EDITOR PLUGIN: WFN-FontEditor
« Reply #1 on: 27 Jun 2013, 19:33 »
Very nice.
Does it allow 256 characters? Alan v.Drake's Draconian Edition supports 256-chars WFN, also he added this support into development branch of AGS.
Will a source code be released? Simply being curious.

I'll be trying it out for certain.

E: It works in the new editor version with floating panels, but obviously not really fit for resizable window. I don't know if it will be easy to add size constraints to a floating panel. Currently font editor looks tad ugly on it.
« Last Edit: 27 Jun 2013, 19:42 by Crimson Wizard »

Re: EDITOR PLUGIN: WFN-FontEditor
« Reply #2 on: 27 Jun 2013, 20:46 »
At the moment only 128 charachters. I can add the rest. (Didn't know there are more chars to support.)
About the floating-problem: I have to download the newest version and check against ist. (tested it with 3.2.1)

The sourcecode will be released, after the first tests will be made. At the moment i have a mercurial repository on my hard disk. Maybe I uploaded it to bitbucket. (But beware. The revision-comments are all in German. The comment in the program are english, because I plan to release the source.)


Edit: Can you explain me, what is ugly?
« Last Edit: 27 Jun 2013, 21:10 by Rulaman »
Zak: Komm mit mir Sushi.
Zak: Come with me Sushi.

Crimson Wizard

  • AGS Project Tracker Admins
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    •  
    • Lifetime Achievement Award Winner
    •  
    • Crimson Wizard worked on a game that was nominated for an AGS Award!
      Crimson Wizard worked on a game that won an AGS Award!
Re: EDITOR PLUGIN: WFN-FontEditor
« Reply #3 on: 28 Jun 2013, 21:09 »
Edit: Can you explain me, what is ugly?
In the new editor the panes could be docked to any place and also made into floating windows, which means they could be resized.
This does not look good with panes that do not set any contraint on their size (like minimal window size) or do not re-arrange controls to better fit the resized client area.

Well, to illustrate what's going on:
http://img18.imageshack.us/img18/2222/0r9r.png

That's a problem of editor rather than your plugin; some other panes behave the same. Or maybe it is not a problem at all, because people may minimize those windows on purpose.
So, on second thought, do not mind this.


Regarding testing, I found two serious problems:
1. When I open font editor in either stand-alone or plugin form, and the font list is empty, interacting with almost any control results in "NullReferenceException".
2. When in the AGS, I can't figure out how to populate font list, or load any font, at all. Therefore, I can't select a font to edit. :-\.
« Last Edit: 28 Jun 2013, 21:11 by Crimson Wizard »

Re: EDITOR PLUGIN: WFN-FontEditor
« Reply #4 on: 29 Jun 2013, 12:14 »
First, I think it's a good idea to have this and it does the basic functionality it is supposed to do.
The plugin does need work
  • The font list should be in the tree view, probably similar to AGS font viewer
  • Consequently, each font should have its own editing window
  • If a font changed, it should indicate that with an asterisk at the title
  • It's better to be consistent and save when the user saves the project, even scripts which are separate files act this way and don't have a save button

As CW wrote, there are other more general improvements that should be done aside from some bugs like the exception thing.
Zoom in and out would be also helpful since the text is extremely small on any reasonable resolution, I think the size displayed now is not that useful, should be similar to AGS own font view.
I would also consider here usability features like copy-paste, undo, create new font, duplicate font and view original compared to the one being edited.

Other minor details, it's not trivial to know that left click draws and right click erases, so at least some text should say this. Also, could be useful to change the mouse cursor to pencil when the cursor is over the edit region. In addition, try to see if placing the editable region on the right would be more aesthetic, at the very least I would place it and the size editing in a group box. You'll need to play around with it, unfortunately, these things take time and trial and error.

Re: EDITOR PLUGIN: WFN-FontEditor (Version 1.0.7.0)
« Reply #5 on: 07 Jul 2013, 14:54 »
Hi,

I have modified my plugin. Now with tabs and better integration in AGS.

WFN-FontEditor V1.0.7.0

Features:

- Character overview has zoomfactor 2 (fixed); editable char has now zoomfactor 15 (1 to 40)
- show tabs in stand alone mode when click on the font in the loaded selection
- load font in plugin only when selected
- stand-alone version shows asterisk, when font is modified (plugin-variant ??? how to do)
- Right click option in Menu Fonts added (only for wfn-fonts)
- undo/redo actions per character (right click on character; not on the edit field)
- supports 256-character wfn-fonts (font not yet available, since not all chars are designed)

What’s left:

- fill character with white or black
- move character position (one or all)
- copy and paste
- (request a feature)

Edit: Images removed
« Last Edit: 18 Sep 2013, 14:08 by Rulaman »
Zak: Komm mit mir Sushi.
Zak: Come with me Sushi.

Re: EDITOR PLUGIN: WFN-FontEditor
« Reply #6 on: 09 Aug 2013, 18:32 »
A new version of the WFN-FontEditor is in BETA state.

additional features to 1.0.7.0:
- character move up, down, left, right
- clear or fill the entire character
- copy and paste of characters (over clipboard; so you can invert your char in another picture editing program)
- Show Grid-option for better editing
- swap the colors (left-black, right-white or vice versa)
- swap the character (horizontally or vertically)
- invert the character

If you wanna test, please let me know.

Edit: Image deleted
« Last Edit: 20 Aug 2013, 20:00 by Rulaman »
Zak: Komm mit mir Sushi.
Zak: Come with me Sushi.

Re: EDITOR PLUGIN: WFN-FontEditor
« Reply #7 on: 14 Aug 2013, 03:36 »
It would be so cool if this has icelandic fonts too. I can then finally make icelandic AGS games in future.

That's why I want to try this out.

Re: EDITOR PLUGIN: WFN-FontEditor
« Reply #8 on: 15 Aug 2013, 03:38 »
Is it possible to convert wfn fonts into sci fonts? How can I use wfn fonts into my game? It can only use sci fonts.

Re: EDITOR PLUGIN: WFN-FontEditor
« Reply #9 on: 19 Aug 2013, 16:46 »
I had a quick look over an sci-font and the spec. I think it is possible. But there are several tool for editing sci-fonts like SCI Studio.
Zak: Komm mit mir Sushi.
Zak: Come with me Sushi.

Re: EDITOR PLUGIN: WFN-FontEditor
« Reply #10 on: 20 Aug 2013, 20:02 »
Now it is available the Version 1.1.0.0

Download Version 1.0.9.0
Download Version 1.1.0.0

additional features to 1.0.7.0:
- character move up, down, left, right
- clear or fill the entire character
- copy and paste of characters (over clipboard; so you can invert your char in another picture editing program)
- Show Grid-option for better editing
- swap the colors (left-black, right-white or vice versa)
- swap the character (horizontally or vertically)
- invert the character
« Last Edit: 24 Aug 2013, 13:28 by Rulaman »
Zak: Komm mit mir Sushi.
Zak: Come with me Sushi.

Re: EDITOR PLUGIN: WFN-FontEditor
« Reply #11 on: 23 Aug 2013, 09:20 »
Hi Rulaman!

May you re-upload the Version 1.1.0.0, please?

The download does not work...

Ciao :wink:

Re: EDITOR PLUGIN: WFN-FontEditor
« Reply #12 on: 24 Aug 2013, 13:29 »
Link in the posts corrected.
Zak: Komm mit mir Sushi.
Zak: Come with me Sushi.

Re: EDITOR PLUGIN: WFN-FontEditor
« Reply #13 on: 28 Aug 2013, 07:07 »
So, it comes to an end.
I have the version 1.2.0.0 at the start and I will include a readme.
Please tell me, if it is ok so and correct my spelling mistakes. (Will you?)

----------------------------------------------

Manual
======


1. Explaination
---------------
This is an editor for wfn fonts, as well ad for sci fonts.
The functions depends on the usage as a plugin for AGS (AdventureGameStudio)
or as a stand alone version.


2. Terms and Definitions
------------------------
p = plugin
s = stand alone


3. Features
-----------
- Edit wfn fonts                                                                (p/s)
- Edit sci fonts                                                                (  s)
- The fonts can outlined [Button 'Outline']                                     (p/s)
- Convert between sci and wfn fonts [Button 'Convert selected']                 (  s)
  the field text height is only for sci fonts interesting.
  It set the space between two text lines and not
  the textheight itself
- Shift the characters to up, down, left, right [Buttons 'U', 'L', 'D', 'R']    (p/s)
- Invert an character [Button 'Invert']                                         (p/s)
- Clear an character (with black) [Button 'Clear']                              (p/s)
- Fill an character (with white) [Button 'Fill']                                (p/s)
- Swap an character horizontally or vertically [Buttons 'Swap H', 'Swap V']     (p/s)
- Outline the complete font [Button 'Outline Font']                             (p/s)
- Show a grid for better font designing                                         (p/s)
- Multiple Redo/Undo [Right click on the character selection field]             (p/s)
- Copy to and paste from the clipboard                                          (p/s)
  [Right click on the character selection field]
- Zoomable edit field (2–40)                                                    (p/s)
- Swap the left color and the right color (click on the connected arrows)       (p/s)

4. Start
--------
Start the program, or copy the plugin to your AGS path and start AGS.

4.1 Stand alone
---------------
After you have started the program stand alone, you have to click open and select a path.
In the list on the left side, it shows you all the fonts, you can edit
(wfn and sci [version 1.2.0.0 and higher]).

4.2 Plugin
----------
Start AGS and load a game. On the pane you found an entry named 'FontEditor'. Open it and
it will show all editable fonts. Under 'Fonts' you found all fonts, used by your game.
It is possible, that you find more than just the ones under 'FontEditor', because AGS is able
to handle ttf fonts as well, but not this editor.
Double click on an entry under 'FontEditor' to edit the selected wfn font, or right click under 'Fonts'
and select 'Edit font (with WFN-FontEditor)'.

5. Workflow (usage)
-------------------
After you have selected a font, you have to click on an character on the left side (selection field) to show it
zoomed. You can select the check box 'Show grid' for a better editing feeling. Now yo can click in the (zoomed)
field to edit the selected character. It updates the character in the left selection field. By dragging your mouse
while holding the mouse button down, you can edit more pixel in a row.

6. Tips
-------
If you want to make a font and a outline font too, it yould be good you have a border around your characters. That
means, one pixel on every side of the character is black. After you designed your font (or converted it from ttf
by using the TtfToWfnSci converter), save it and make a copy (with a file manager). Name the copy correct (file convention)
with a number higher and reopen the WFN-FontEditor. Than select the correct font and click 'Outline Font'.
Check the characters an you will be done.


Greetings
Rulaman
Zak: Komm mit mir Sushi.
Zak: Come with me Sushi.

Crimson Wizard

  • AGS Project Tracker Admins
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    •  
    • Lifetime Achievement Award Winner
    •  
    • Crimson Wizard worked on a game that was nominated for an AGS Award!
      Crimson Wizard worked on a game that won an AGS Award!
Re: EDITOR PLUGIN: WFN-FontEditor
« Reply #14 on: 28 Aug 2013, 08:41 »
Explaination => Explanation

Re: EDITOR PLUGIN: WFN-FontEditor
« Reply #15 on: 02 Sep 2013, 19:21 »
So it's out, the new version

Download Version 1.2.0.0
Download Version 1.2.0.0 sources

I will no more work on this software, unless a feature is requested for good reason.

Greetings
Rulaman
Zak: Komm mit mir Sushi.
Zak: Come with me Sushi.

Re: EDITOR PLUGIN: WFN-FontEditor
« Reply #16 on: 06 Sep 2013, 05:53 »
You did a great work. Thanks to you I can do icelandic games with AGS. :)

adios

  • Cavefish
Re: EDITOR PLUGIN: WFN-FontEditor
« Reply #17 on: 07 Sep 2013, 13:55 »
Great Job, Rulaman! Finally, the latest font editing program. Radiant's program has gotten 9 years old 8-0!

I can't download it :(. No matter how many times, I click the download button. Counter increases, new page is loaded saying "Not Allowed" and then it redirects to the link you provided :(.

I'll be sure to give it a try to create a new font for my game, once you sort out the link's problem. Needless to say, you'll credit too. :)

I took the time to proofread your manual. I may not not be the best proofread although I've picked and corrected some mistakes. I've highlighted them so that you may compare my version to yours and notice what I did.

----------------------------------------------

Manual
======


1. Explanation (fixed by CW)
---------------
This is an editor for wfn fonts, as well as for sci fonts.
The functions depends on the usage as a plugin for AGS (AdventureGameStudio)
or as a stand alone version.


2. Terms and Definitions
------------------------
p = Plugin
s = Stand Alone


3. Features
-----------
- Edit wfn fonts                                                                (p/s)
- Edit sci fonts                                                                (  s)
- The fonts can be outlined [Button 'Outline']                                     (p/s)
- Convert between sci and wfn fonts [Button 'Convert selected']                 (  s)
  the field text height is only for sci fonts interesting.
  It set the space between two text lines and not
  the textheight itself
- Shift the characters to up, down, left, right [Buttons 'U', 'L', 'D', 'R']    (p/s)
- Invert a character [Button 'Invert']                                         (p/s)
- Clear a character (with black) [Button 'Clear']                              (p/s)
- Fill a character (with white) [Button 'Fill']                                (p/s)
- Swap a character horizontally or vertically [Buttons 'Swap H', 'Swap V']     (p/s)
- Outline the complete font [Button 'Outline Font']                             (p/s)
- Show a grid for better font designing                                         (p/s)
- Multiple Redo/Undo [Right click on the character selection field]             (p/s)
- Copy to and Paste from the clipboard                                          (p/s)
  [Right click on the character selection field]
- Zoomable edit field (2–40)                                                    (p/s)
- Swap the left color and the right color (click on the connected arrows)       (p/s)

4. Start
--------
Start the program, or copy the plugin to your AGS path and start AGS.

4.1 Stand alone
---------------
After you have started the program stand alone, you have to click open and select a path.
In the list on the left side, it shows you all the fonts, you can edit
(wfn and sci [version 1.2.0.0 and higher]).

4.2 Plugin
----------
Start AGS and load a game. On the pane you found an entry named 'FontEditor'. Open it and
it will show all editable fonts. Under 'Fonts' you found all fonts, used by your game.
It is possible, that you find more than just the ones under 'FontEditor', because AGS is able
to handle .ttf fonts as well, but not this editor.
Double click on an entry under 'FontEditor' to edit the selected .wfn font, or right click under 'Fonts'
and select 'Edit font (with WFN-FontEditor)'.

5. Workflow (usage)
-------------------
After you have selected a font, you have to click on an character on the left side (selection field) to show it
zoomed. You can select the check box 'Show grid' for a better editing feel. Now you can click in the (zoomed)
field to edit the selected character. It updates the character in the left selection field. By dragging your mouse,
while holding the mouse button down, you can edit more pixels in a row.

6. Tips
-------
If you want to make a font as well as an outline font too, it would be better if you have a border around your characters. That
means, one pixel on every side of the character is black. After you've designed your font (or converted it from ttf
by using the TtfToWfnSci converter), save it and make a copy (with a file manager). Name the copy correct (file convention)
with a number higher and reopen the WFN-FontEditor. Than select the correct font and click 'Outline Font'.
Check the characters and you will be done.


Greetings
Rulaman
-

Re: EDITOR PLUGIN: WFN-FontEditor
« Reply #18 on: 08 Sep 2013, 09:51 »
Curious!
Did you block any Scripts?
It works for me.

Thanks for the corrections.
Zak: Komm mit mir Sushi.
Zak: Come with me Sushi.

adios

  • Cavefish
Re: EDITOR PLUGIN: WFN-FontEditor
« Reply #19 on: 15 Sep 2013, 08:20 »
Curious!
Did you block any Scripts?
It works for me. [...]

Sorry for the late reply. I had missed it.

No, I didn't block any script. No matter how many times I download it, I'm always redirected to the link you sent to me (without any file) but the counter increases!

[...] Thanks for the corrections.

You're welcome. :)

EDIT:
Whilst typing, I tried to download the files again. This time I enable Send Referrer Information. To my surprise, the download worked ;-D! I'm curious why this website requires referrer information even though other websites work perfectly fine with it being disabled. :

Thanks for the program once again. :)
-

Monsieur OUXX

  • Cavefish
  • Mittens Vassal
  • Mittens Half Initiate
    • I can help with proof reading
    •  
    • I can help with translating
    •  
    • I can help with voice acting
    •  
Re: EDITOR PLUGIN: WFN-FontEditor
« Reply #20 on: 28 Oct 2013, 12:22 »
It's a bit cheeky but I have a few requests, I'll just post the list, from easier to harder:
- Bounding box : that each character has a rectangle around it. So that the end-user is sure if there is an actual character to click at that location (possibly entirely black) or if there is nothing
- Click detection: that the click on the characters is not pixel-perfect, but instead the whole rectangle can be clicked anywhere.
- Unsupported formats: that there is a clearer error message when one tries to open an unsupported font format (e.g. 256-characters SCI format)
- Silent "save": that the software's visual feedback is better when the user clicks on "save". For example, when no font is open, if you click on "save", nothing happens. Other example: As it is now, you can open one format, edit it, and then save it (in the same format). You can't save cross-format. When you click on "Save" you'd hope there would be something happening. For example, a popup telling you that you overwrote the actual file. Or an asterisk that was in front of the currently modified file's name (like in any text editor), and the asterisk would disappear. Any visual feedback.
- Non-obvious conversion options : The usual practice in other apps, when one wants to convert, is to "save as". Here, there's a "convert selected" button. ...Selected what? font or character? When I click on that button, nothing happens, but all the open fonts get closed.
- Non-English languages: That it supports 256 characters (possibly in ISO-xxxxx), rather than just 128.




« Last Edit: 28 Oct 2013, 14:08 by Monsieur OUXX »
 

Re: EDITOR PLUGIN: WFN-FontEditor
« Reply #21 on: 28 Oct 2013, 19:26 »
Bounding box : The character has a black background, the field itself is dark gray. Look closer. (But the background can't changed at the moment. I must implement it.)

Click detection: You can click the whole character. I didn't see the spot.


Unsupported formats: You can only open FONT.* (SCI), or *.WFN. It isn't important, if the font contain 128 or 256 characters .

Silent "save": What should happen, when you click on save, and nothing is open? You know, that nothing is open. But okay, that's a point. You can save cross format, Use the stand alone variant and click convert. (Description in the manual.)

Non-obvious conversion options : I can't reproduce this bevahiour. Why should all fonts close? (Convert selected character doesn't make any sense. So what?) What did you expect, when you click on the "Convert selected" button? It saves the WFN font in SCI format, when highlighted in the list, or saves a WFN font in SCI format.

Non-English languages: You din't read the manual. It supports 256-character.

Here is a font with 256 character: http://www.adventuregamestudio.co.uk/forums/index.php?topic=48798.msg636465473#msg636465473


80 percent of your request don't make any sense in my opinion, or I didn't understand them.
Zak: Komm mit mir Sushi.
Zak: Come with me Sushi.

Daniel Eakins

  • Time Traveller
Re: EDITOR PLUGIN: WFN-FontEditor
« Reply #22 on: 28 Oct 2013, 23:43 »
- Unsupported formats: that there is a clearer error message when one tries to open an unsupported font format (e.g. 256-characters SCI format)
Hi Monsieur OUXX. Font management in the various versions of AGS and related tools is very diverse and there are lots of compatibility issues to consider.

There is something very important to know concerning the "Import over this font" button in AGS. This button can be used to import fonts that are in the TTF format or in the SCI format (whether 128-character or 256-character). What's important to know is that when you import an SCI font in the editor, the editor actually modifies the file slightly, for the purpose of game development. The modified file is not an "original" SCI format anymore; it's a "custom AGS format".

The catch is that the "Import over this font" button can import "original" SCI fonts, but it cannot import "custom AGS format" fonts. Yeah, AGS cannot import its own format; this is a bug in the editor. The fonts that Rulaman linked to in his last post are actually instances of this "custom AGS format", which means that they cannot be imported in AGS using the "Import over this font" button -- this is an issue totally unrelated to the fact that they are 256-character.

The only way to import "custom AGS format" fonts in AGS is to directly replace one of the font files in your game's directory with your new font (renamed) in the Windows explorer. Close and reload your editor to see the change.

What I said above allows you to import any font in AGS. But of course, if you are using AGS 3.2.1 or lower, you will only be able to use the first 128 characters of the font. If you want to use all 256 characters, one way is to use the Draconian split branch of AGS, or the AGS 3.4.0 alpha version (or wait for the stable version of AGS 3.4.0).


EDIT: Another way to have 256-character fonts is to use Calin Leafshade's SpriteFont Renderer plugin. It's probably the best option if you don't want to change your AGS version.
« Last Edit: 29 Oct 2013, 18:03 by Daniel Eakins »
We all have our time machines, don't we?

Monsieur OUXX

  • Cavefish
  • Mittens Vassal
  • Mittens Half Initiate
    • I can help with proof reading
    •  
    • I can help with translating
    •  
    • I can help with voice acting
    •  
Re: EDITOR PLUGIN: WFN-FontEditor
« Reply #23 on: 14 Nov 2013, 10:01 »
The fonts that Rulaman linked to in his last post are actually instances of this "custom AGS format", which means that they cannot be imported in AGS

Thank god there are guys who make sense of that gigantic mess! :D
Thanks a lot.

@Rulaman: don't get me wrong, your tool is awesome. Most of the confusion came from the bug I encountered (that was causing all the open fonts to close, and nothing to get converted). I cannot seem to reproduce that bug either. I would suspect it happens when the app cannot write the converted font to disk, for any permission reason.

Here are the answers to the other points:







Also, for all those interested in multilingual fonts, this page could come handy : http://www.adventuregamestudio.co.uk/wiki/Fonts
« Last Edit: 14 Nov 2013, 20:57 by Monsieur OUXX »
 

Crimson Wizard

  • AGS Project Tracker Admins
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    •  
    • Lifetime Achievement Award Winner
    •  
    • Crimson Wizard worked on a game that was nominated for an AGS Award!
      Crimson Wizard worked on a game that won an AGS Award!
Re: EDITOR PLUGIN: WFN-FontEditor
« Reply #24 on: 14 Nov 2013, 21:00 »
@Monsieur OUXX, I can see the difference between "light grey" and "dark grey" even on your picture, so that might be difference in monitor gamma level.

I agree that the constrast between character background and main background is way too low. Different colors and/or grid lines will improve the look greatly.

Monsieur OUXX

  • Cavefish
  • Mittens Vassal
  • Mittens Half Initiate
    • I can help with proof reading
    •  
    • I can help with translating
    •  
    • I can help with voice acting
    •  
Re: EDITOR PLUGIN: WFN-FontEditor
« Reply #25 on: 14 Nov 2013, 21:14 »
that might be difference in monitor gamma level

In order to make sure it wasn't the reason, I zoomed in using Photoshop! And I used the "magic wand" tool to see if it would select something I didn't see. I believe you guys, but I'm wondering: what kind of wizardry is this? :D
 

Re: EDITOR PLUGIN: WFN-FontEditor
« Reply #26 on: 15 Nov 2013, 16:46 »
Hi Monsieur OUXX,

About your problem with the O, you have to click on the white part: I can't reproduce this.

The other "problem" with the black and dark gray parts, I call this a hidden feature  :grin:.
But you are right, if it is a problem, I could make it clearer (other color) or selectable.

The good part about this tool is, that I delivered the sources, so every one could modify it (If I stopped the support).
Zak: Komm mit mir Sushi.
Zak: Come with me Sushi.

Scavenger

  • Cavefish
  • In Four Glorious Colours!
    • I can help with animation
    •  
    • I can help with backgrounds
    •  
    • I can help with characters
    •  
    • I can help with scripting
    •  
    • Scavenger worked on a game that was nominated for an AGS Award!
      Scavenger worked on a game that won an AGS Award!
Re: EDITOR PLUGIN: WFN-FontEditor
« Reply #27 on: 15 Nov 2013, 17:00 »
I really like this tool, I didn't find any outstanding bugs, but I did find it kind of hard to use. Apart from the clearer selection as stated before, would it be possible to be able to select characters by typing in the letters in a text box? I find it kind of hard to crossreference the ASCII table and figure out which box I'm clicking on when I have an empty font (which usually have 1x1 hitboxes) and select them for editing. I'd like to know which character I'm on in case two characters are alike. If this function was in there already I'm not sure I was able to find it.

Also, would it be possible to add a test render of the font to see if the font reads correctly without having to run a test game in AGS? Something with pangrams, like
The Quick Brown Fox Jumped Over The Lazy Dog
Falsches Üben von Xylophonmusik quält jeden größeren Zwerg
El pingüino Wenceslao hizo kilómetros bajo exhaustiva lluvia y frío, añoraba a su querido cachorro.

Those contain most of the extended ASCII characters, I believe. Though just being able to type a word would be awesome.

This program is amazing, though, a real lifesaver for doing >128 characters!

Monsieur OUXX

  • Cavefish
  • Mittens Vassal
  • Mittens Half Initiate
    • I can help with proof reading
    •  
    • I can help with translating
    •  
    • I can help with voice acting
    •  
Re: EDITOR PLUGIN: WFN-FontEditor
« Reply #28 on: 16 Nov 2013, 00:50 »
The good part about this tool is, that I delivered the sources, so every one could modify it (If I stopped the support).

That's cool.
Could I be as cheeky as to do two more enhancement requests? and those are really important, I believe, in the prduction flow of anyone manipulaitng fonts:
1) to be able to open a 128-chars font and click somewhere to extend it to a 256-characters font (with the 128 extra slots being empty at first).
2) to be able to entirely copy a selected character, to some "clipboard", and then paste it into another character.

That's because most people working with extended Latin characters have to work with commn characters (e.g. "n") and turn them into special ones (e.g. "ñ").

If you did those two things, your tool would become the ultimate tool for AGS fonts.
 

Re: EDITOR PLUGIN: WFN-FontEditor
« Reply #29 on: 16 Nov 2013, 20:11 »
Hi you two (Scavenger and Monsieur OUXX),

first the easier requests.

Monsieur OUXX: 2) You can already copy and paste a character by clicking in the character field on the letter with the right mouse. (Did I mention it in the manual?) You can even paste it in an graphic tool and paste it back, after edited.
Monsieur OUXX: 1) Yeah, I think it could be possible.

Scavenger: You find the underlaying character by stay a while on the character.
Scavenger: The test rendering font is possible. I think about it. (Fixed implemented and freely selectable)

I think I implement a littel change in the background color and the ability to save the few values (color, grid, …) as well.

Greetings

PS: Any futher requests?
Zak: Komm mit mir Sushi.
Zak: Come with me Sushi.

Monsieur OUXX

  • Cavefish
  • Mittens Vassal
  • Mittens Half Initiate
    • I can help with proof reading
    •  
    • I can help with translating
    •  
    • I can help with voice acting
    •  
Re: EDITOR PLUGIN: WFN-FontEditor
« Reply #30 on: 17 Nov 2013, 14:33 »
PS: Any futher requests?

Yes, since you ask! :) Starting editing a WFN/SCI font from a TTF font. I suppose (it's only a guess) it shouldn't be too hard, since AGS is able to open them and to render them as bitmaps.

Monsieur OUXX: 1) Yeah, I think it could be possible.

If you implement that: could you add a little label somewhere (anywhere!) saying: "you're currently working with a genuine 128-char SCI file", or "you're currently working with an AGS-only 256-characters SCI file" ? (or something similar). Once you know thet 256-char format is custom to AGS, it seems obvious, but before that it sounds like a puzzle to solve.
« Last Edit: 17 Nov 2013, 14:39 by Monsieur OUXX »
 

Re: EDITOR PLUGIN: WFN-FontEditor
« Reply #31 on: 25 Nov 2013, 20:20 »
A bugfix release is out.

Additional features:

Since 1.2.0.1:
- save the selection field background color                                (p/s)
- save the state of the grid option                                             (p/s)
- save the render text                                                                (p/s)
- render the font in an example text                                          (p/s)
- change the color of the selection field with right click on it      (p/s)
- extend the font to 256 character                                             (p/s)
- show, if a font is 128 or 256 characters                                   (p/s)

Download: http://www.file-upload.net/download-8333852/WFN-FontEditor-V1.2.0.1.7z.html
Zak: Komm mit mir Sushi.
Zak: Come with me Sushi.

Crimson Wizard

  • AGS Project Tracker Admins
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    •  
    • Lifetime Achievement Award Winner
    •  
    • Crimson Wizard worked on a game that was nominated for an AGS Award!
      Crimson Wizard worked on a game that won an AGS Award!
Re: EDITOR PLUGIN: WFN-FontEditor
« Reply #32 on: 14 Mar 2014, 11:52 »
Is it possible to add few more things to the plugin?
1. Display the code of current character and total number of characters in font.
2. Next/Prev character commands.
3. Goto character (number) command. Alternatively, an option to display character codes in the main view.
4. (Maybe optionally) arrange characters in the uniform grid (aligned strictly by columns & rows). This will make it much easier to overview the font and find characters.
5. Some way to set same size to all characters in font.

Also, I don't really understand, how saving fonts works in plugin? It looks like font always got saved when pane is closed, which makes it impossible to undo changes; unless I miss something. Also, the pane's title shows asteriks (*) sometimes even though I did no changes, and - opposite - does not show it after I did some.


EDIT: Bug found in plugin code:
Add spoiler tag for Hidden:
Code: C#
  1.                         if ( bmpData.Width <= 8 )
  2.                         {
  3.                                 bytesPerLine = 1;
  4.                         }
  5.                         else if ( bmpData.Width <= 16 )
  6.                         {
  7.                                 bytesPerLine = 2;
  8.                         }
  9.                         else if ( bmpData.Width <= 32 )
  10.                         {
  11.                                 bytesPerLine = 3;
  12.                         }
  13.  
This is incorrect, 3 bytes are for width = 24, and 4 bytes for width 32.
The general formula (used in AGS code) is:
Quote
bytesPerLine = (bmpData.Width - 1) / 8 + 1
« Last Edit: 14 Mar 2014, 21:31 by Crimson Wizard »

Crimson Wizard

  • AGS Project Tracker Admins
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    •  
    • Lifetime Achievement Award Winner
    •  
    • Crimson Wizard worked on a game that was nominated for an AGS Award!
      Crimson Wizard worked on a game that won an AGS Award!
Re: EDITOR PLUGIN: WFN-FontEditor
« Reply #33 on: 14 Mar 2014, 21:55 »
I found two more bugs:
1. If you copy anything to the Windows clipboard (e.g. text), then right click on font character and select "Paste", the plugin will throw an exception:
Quote
System.NullReferenceException:
   в Indexed.Image.CopyToBpp(Bitmap b, Int32 bpp)
   в AGS.Plugin.FontEditor.FontEditorPane.Me nuPasteClicked(Object sender, EventArgs e)

2. There's a bad bug, but it's a strange one, because it occured only on one computer, and did not on another.
If you extend a 128-character font to 256-characters, and edit only several characters in the middle of the second part, then they never be displayed. It appears that as soon as there's a non-edited character in font, the plugin saves all following characters with Width = 0 and Height = 0, even though some of them have contents (I found this detail only by debugging AGS).
« Last Edit: 14 Mar 2014, 22:01 by Crimson Wizard »

Re: EDITOR PLUGIN: WFN-FontEditor
« Reply #34 on: 15 Mar 2014, 17:31 »
Hi Crimson Wizard,

i'll look into it, when I have the time.
Zak: Komm mit mir Sushi.
Zak: Come with me Sushi.

Crimson Wizard

  • AGS Project Tracker Admins
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    •  
    • Lifetime Achievement Award Winner
    •  
    • Crimson Wizard worked on a game that was nominated for an AGS Award!
      Crimson Wizard worked on a game that won an AGS Award!
Re: EDITOR PLUGIN: WFN-FontEditor
« Reply #35 on: 18 Mar 2014, 08:15 »
Another bug: if I create new font, it does not appear under plugin node, so I can't choose it for editing until I reload the project.

UPD I found the bug that breaks font format when there's at least 1 non-edited character, created by extending 128-char font to 256-char. PMed Rulaman about details.
Interesting, the Draconian edition still works well with bad format, because of the way it loads font (it does not parse it, but loads as whole data chunk, same as AGS 3.2.1 did). My reimplementation fails though :).
« Last Edit: 18 Mar 2014, 09:11 by Crimson Wizard »

Re: EDITOR PLUGIN: WFN-FontEditor
« Reply #36 on: 21 Mar 2014, 18:04 »
[...] Interesting, the Draconian edition still works well with bad format, [...]

I guess it is the zero width/height characters that break this plugin and (I assume) your new code.
In fact I had been wondering why it wouldn't load my font, then realized that the empty characters (due to me importing a bitmap from radiant's fontedit) were blowing up the plugin due to trying to make an invalid 0x0 Bitmap.

- Alan

Crimson Wizard

  • AGS Project Tracker Admins
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    •  
    • Lifetime Achievement Award Winner
    •  
    • Crimson Wizard worked on a game that was nominated for an AGS Award!
      Crimson Wizard worked on a game that won an AGS Award!
Re: EDITOR PLUGIN: WFN-FontEditor
« Reply #37 on: 22 Mar 2014, 20:55 »
[...] Interesting, the Draconian edition still works well with bad format, [...]

I guess it is the zero width/height characters that break this plugin and (I assume) your new code.
No, zero size is safely handled.
There was simply an incorrect size of data created for new blank characters in the plugin.

abstauber

  • Cavefish
  • Mittens Knight
  • still mowing the lawn
    • abstauber worked on a game that was nominated for an AGS Award!
      abstauber worked on a game that won an AGS Award!
Re: EDITOR PLUGIN: WFN-FontEditor
« Reply #38 on: 24 Mar 2014, 13:06 »
Unfortunately the stand-alone editor crashes when I try to load anything.
Add spoiler tag for Hidden:
Informationen über das Aufrufen von JIT-Debuggen
anstelle dieses Dialogfelds finden Sie am Ende dieser Meldung.

************** Ausnahmetext **************
System.NullReferenceException: Der Objektverweis wurde nicht auf eine Objektinstanz festgelegt.
   bei AGS.Plugin.FontEditor.FontEditorPane..c tor(String filepath, String filename, String fontname)
   bei WFN_FontEditor.MainWindow.FontListBox_S electedIndexChanged(Object sender, EventArgs e)
   bei System.Windows.Forms.ListBox.OnSelected IndexChanged(EventArgs e)
   bei System.Windows.Forms.ListBox.WmReflectC ommand(Message& m)
   bei System.Windows.Forms.ListBox.WndProc(Message& m)
   bei System.Windows.Forms.Control.ControlNat iveWindow.OnMessage(Message& m)
   bei System.Windows.Forms.Control.ControlNat iveWindow.WndProc(Message& m)
   bei System.Windows.Forms.NativeWindow.Callb ack(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


************** Geladene Assemblys **************
mscorlib
    Assembly-Version: 2.0.0.0.
    Win32-Version: 2.0.50727.3655 (GDR.050727-3600).
    CodeBase: file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll.
----------------------------------------
WFN-FontEditor
    Assembly-Version: 1.2.0.1.
    Win32-Version: 1.2.0.1.
    CodeBase: file:///D:/Eigene%20Dateien/AGS-3.3.0/WFN-FontEditor-V1.2.0.1/standalone/WFN-FontEditor.exe.
----------------------------------------
System.Windows.Forms
    Assembly-Version: 2.0.0.0.
    Win32-Version: 2.0.50727.3645 (GDR.050727-3600).
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll.
----------------------------------------
System
    Assembly-Version: 2.0.0.0.
    Win32-Version: 2.0.50727.3644 (GDR.050727-3600).
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll.
----------------------------------------
System.Drawing
    Assembly-Version: 2.0.0.0.
    Win32-Version: 2.0.50727.3644 (GDR.050727-3600).
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll.
----------------------------------------
AGS.Plugin.FontEditor
    Assembly-Version: 1.2.0.1.
    Win32-Version: 1.2.0.1.
    CodeBase: file:///D:/Eigene%20Dateien/AGS-3.3.0/WFN-FontEditor-V1.2.0.1/standalone/AGS.Plugin.FontEditor.DLL.
----------------------------------------
AGS.Types
    Assembly-Version: 3.2.1.111.
    Win32-Version: 3.2.1.111.
    CodeBase: file:///D:/Eigene%20Dateien/AGS-3.3.0/WFN-FontEditor-V1.2.0.1/standalone/AGS.Types.DLL.
----------------------------------------
System.Xml
    Assembly-Version: 2.0.0.0.
    Win32-Version: 2.0.50727.3654 (GDR.050727-3600).
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll.
----------------------------------------
mscorlib.resources
    Assembly-Version: 2.0.0.0.
    Win32-Version: 2.0.50727.3655 (GDR.050727-3600).
    CodeBase: file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll.
----------------------------------------
System.Windows.Forms.resources
    Assembly-Version: 2.0.0.0.
    Win32-Version: 2.0.50727.3053 (netfxsp.050727-3000).
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms.resources/2.0.0.0_de_b77a5c561934e089/System.Windows.Forms.resources.dll.
----------------------------------------

************** JIT-Debuggen **************
Um das JIT-Debuggen (Just-In-Time) zu aktivieren, muss in der
Konfigurationsdatei der Anwendung oder des Computers
(machine.config) der jitDebugging-Wert im Abschnitt system.windows.forms festgelegt werden.
Die Anwendung muss mit aktiviertem Debuggen kompiliert werden.

Zum Beispiel:

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

Wenn das JIT-Debuggen aktiviert ist, werden alle nicht behandelten
Ausnahmen an den JIT-Debugger gesendet, der auf dem
Computer registriert ist, und nicht in diesem Dialogfeld behandelt.
Apart from the reported bugs, it works fine inside the editor.

Re: EDITOR PLUGIN: WFN-FontEditor
« Reply #39 on: 25 Mar 2014, 19:45 »
Hi @all,

sorry for the delay but my pc crashed and now I haev VS only at work.
So it may take longer than I expected.
Zak: Komm mit mir Sushi.
Zak: Come with me Sushi.

Re: EDITOR PLUGIN: WFN-FontEditor
« Reply #40 on: 05 May 2014, 17:40 »
So, finally the new version with bugfixes and new features is out.

http://www.file-upload.net/download-8888240/WFN-FontEditor-V1.2.1.0.zip.html
(Use the download button with the could and enable scripts if you block these.)
Zak: Komm mit mir Sushi.
Zak: Come with me Sushi.

Scavenger

  • Cavefish
  • In Four Glorious Colours!
    • I can help with animation
    •  
    • I can help with backgrounds
    •  
    • I can help with characters
    •  
    • I can help with scripting
    •  
    • Scavenger worked on a game that was nominated for an AGS Award!
      Scavenger worked on a game that won an AGS Award!
Re: EDITOR PLUGIN: WFN-FontEditor
« Reply #41 on: 05 May 2014, 20:44 »
I just tried this out, it handles much better! I'll be able to do any kind of font now that the index is displayed! Thanks, Rulaman, this is excellent.

Monsieur OUXX

  • Cavefish
  • Mittens Vassal
  • Mittens Half Initiate
    • I can help with proof reading
    •  
    • I can help with translating
    •  
    • I can help with voice acting
    •  
Re: EDITOR PLUGIN: WFN-FontEditor
« Reply #42 on: 07 May 2014, 14:13 »
Excellent.
 

Crimson Wizard

  • AGS Project Tracker Admins
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    •  
    • Lifetime Achievement Award Winner
    •  
    • Crimson Wizard worked on a game that was nominated for an AGS Award!
      Crimson Wizard worked on a game that won an AGS Award!
Re: EDITOR PLUGIN: WFN-FontEditor
« Reply #43 on: 16 Sep 2014, 14:27 »
LATER EDIT: it appears this post was a result of misunderstanding and using older version.
Add spoiler tag for Hidden:
Rulaman, unfortunately your plugin still saves extended fonts in wrong format. This is the error I reported before.
When you click "Extend to 256 characters" button all newly created characters have incorrect length of data. They got fixed only after user edits something. This means that if user leaves at least one symbol unedited (leaves default empty square) the format will be saved in a broken way.
AGS does not tells anything, because older engine simply does not check for such errors - accepting even incorrect format!
This won't cause problems so far as these characters are not displayed, but this is dangerous, because may cause program to access wrong memory address. Please fix this before more people used your plugin to create their fonts!

For the new version of AGS I have specifically added extra checks into font loading code to detect and autocorrect such errors.

How to fix: the mistake is in FontEditorPane.cs
Code: C#
  1. private void BtnExtend256_Click(object sender, EventArgs e)
  2. {
  3. <...>
  4. FontInfo.Character[counter + len] = new CCharInfo();
  5. FontInfo.Character[counter + len].Height = 4;
  6. FontInfo.Character[counter + len].HeightOriginal = 4;
  7. FontInfo.Character[counter + len].Width = 4;
  8. FontInfo.Character[counter + len].WidthOriginal = 4;
  9. FontInfo.Character[counter + len].Index = counter + len;
  10.  
  11. FontInfo.Character[counter + len].ByteLines = new byte[2]; <---------------- INCORRECT
  12. FontInfo.Character[counter + len].ByteLinesOriginal = new byte[2]; <---------------- INCORRECT
  13. <...>
  14. }
  15.  

The lines I marked have a mistake: the WFN format requires at least 1 byte per line (height unit), regardless of width. You are creating 4x4 empty char, but assign only 2 bytes to data buffer. You need to assign 4 bytes.

You may also add these two helper functions to CCharInfo class, so that you won't depend on hard-coded constants:
Code: C#
  1. int GetRowByteCount()
  2. {
  3.     return (Width + 7) / 8;
  4. }
  5.  
  6. int GetRequiredPixelSize()
  7. {
  8.     return GetRowByteCount() * Height;
  9. }
  10.  
« Last Edit: 19 Sep 2014, 22:56 by Crimson Wizard »

Re: EDITOR PLUGIN: WFN-FontEditor
« Reply #44 on: 19 Sep 2014, 22:22 »
AGAIN! This problem is solved with the newest Version 1.2.1.0 as mentioned in a few posts above.
I updated my first post to reflect this change.

I have a look about it in a few days anyway, when I am on my windows pc.

Are you sure you use the latest version? I am sure about the solved problem?
Zak: Komm mit mir Sushi.
Zak: Come with me Sushi.

Crimson Wizard

  • AGS Project Tracker Admins
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    •  
    • Lifetime Achievement Award Winner
    •  
    • Crimson Wizard worked on a game that was nominated for an AGS Award!
      Crimson Wizard worked on a game that won an AGS Award!
Re: EDITOR PLUGIN: WFN-FontEditor
« Reply #45 on: 19 Sep 2014, 22:38 »
Oh. I apologize, I used the link from the first post. I probably did not notice a difference between 1.2.1.0 and 1.2.0.1.

EDIT: Yes, I can confirm, the 1.2.1.0 is saving correctly. Sorry again. :)
« Last Edit: 19 Sep 2014, 22:56 by Crimson Wizard »

Re: EDITOR PLUGIN: WFN-FontEditor
« Reply #46 on: 22 Sep 2014, 17:45 »
No problem!
Zak: Komm mit mir Sushi.
Zak: Come with me Sushi.

Monsieur OUXX

  • Cavefish
  • Mittens Vassal
  • Mittens Half Initiate
    • I can help with proof reading
    •  
    • I can help with translating
    •  
    • I can help with voice acting
    •  
Re: EDITOR PLUGIN: WFN-FontEditor
« Reply #47 on: 18 Jul 2017, 13:38 »
Sorry for digging up the thread, but I'd like to suggest two rather simple enhancements.
I've thought of them while practically using the tool :

(by order of importance)
1) I suggest that when the user extends an existing font to 256 characters, then the 128 new chars get automatically filled with the missing characters (taken from the default AGS font -- can be found here : topic 48798 ). Because the font being currently open doesn't necessarily have the same size as the default AGS font, then maybe a popup box could ask for the coordinates of the characters base line before filling the characters.
2) Implement Ctrl+S to save
3) There are buttons to move an individual character up/down/left/right but maybe 4 additional buttons to move the whole font up/down/left/right?


Another possibility (variation on suggestion #1) is a button "copy this character from character open in next tab"
 

Re: EDITOR PLUGIN: WFN-FontEditor
« Reply #48 on: 03 Jan 2018, 18:57 »
Mi Monsieur OUXX,

and sorry for the late response.

1b) You can copy a character to another position by using the context menu in the character table. Use 'Copy' and over the second character 'Paste'.
(It copies the image in the clipboard so you can make an bw image in any other paint program.)

1a) I take a look on copying the whole new char set from another font.

2) Do you mean Ctrl+S in the stand alone editor?

3) I implemented this feature today and if you want you can test it. (And the other functions when implemented.)


Greetings and a happy new year
Rulaman
Zak: Komm mit mir Sushi.
Zak: Come with me Sushi.