FOnline Development > Share Your Work

Font Utilities - FOFNT Maker/Text Splitter [PHOTOSHOP]

(1/2) > >>

phatskat:
Hi all. I was referred this way from someone over at the FOnline forums. I've written a couple of ExtendScript scripts for Photoshop that should make creating custom fonts a little easier. I spent the better part of yesterday trying to figure out how FOFNT files were generated (assuming they were binary), and when I figured out they were text and, essentially, sprite sheets, I decided to go about adding some fonts to FOnline. It sucked.

These scripts aim to make generating FOFNT files much easier by way of two utilities: A text splitter script - takes a single text layer in Photoshop and makes a new layer for each individual character. These layers can then be placed in an image and used by the FOFNT Maker, which reads each layer's character and creates a corresponding entry for a FOFNT file.

For more details, you can look on the GitHub page https://github.com/phatsk/FOTools and feel free to ask questions or suggest fixes/enhancements.

JovankaB:
Very nice and useful thing. Actually I needed a tool like that, so thanks for sharing it :)
I tested it in Photoshop CS2 and I managed to run the scripts, although it requires two small changes in order to make it work:

1. For some weird reason this is syntax error according to CS2:


--- Code: ---// @TODO
--- End code ---

Removing "@" in all the lines that start with // @TODO fixes it.

2. This is even more weird, in FoFntMaker.jsx file, the line 352:


--- Code: ---if(f !== null)
--- End code ---

is always false in CS2, resulting in alert("Error opening FOFNT file, nothing saved") even if you choose save.
I suppose there is something wrong with !== operator in CS2 JavaScript engine.
I fixed it by reversing the condition:


--- Code: ---    if(f === null)
    {
        alert("Error opening FOFNT file, nothing saved");
    }
    else
    {
        if(f.open('w', 'TEXT', '???'))
        {
            f.write(o);
            f.close();
        }
        else
            alert("Could not open file for writing");
    }
--- End code ---

alternative solution is to simply change "!==" to "!=".

phatskat:
Thanks for the tips! Does the != work fine in CS2? I'll update the scripts in GitHub now with the other fixes.

JovankaB:
Yup, != seems to work fine.

phatskat:
Fantastic - version 0.2 updated on GitHub - thanks for the fixes! ExtendScript has been a rather un-fun experience so far...can't I get a built-in Array.indexOf, Adobe?  ::)

Navigation

[0] Message Index

[#] Next page

Go to full version