A great feature of Glyph Designer is GDCL. This is the command line tool that is provided with Glyph Designer. Working with our larger customers it was clear that we needed to provide a command line tool that could be built into the build process for our users. The idea was to allow a single Glyph Designer project file to be created at the largest size needed and then allow GDCL to generate any number of output fronts from that project at any size required.
To install GDCL you first need to install Glyph Designer. Once this has been done open the main Glyph Designer menu and you will see the option to install the command line tool.
Select "Install Command Line Tool" and you will see an installing window appear.
This panel explains how GDCL will be installed and lets you choose from some common locations.
With GDCL installed you should now be able to run it from the command line. If you installed it in /usr/local/bin, simply open terminal and type in GDCL. You should get the standard output from GDCL displayed which provides information on the switches you can use with GDCL.
Toms-MacBook-Pro:home-page tpbradley$ gdcl GDCL - 1.6 - Licensed to: Nobuhiko Sasaki (c)2013 71Squared Limited - http://www.71squared.com Usage: GDCL [-fs fontSize] [-rfs relativeSize] [-fo format] [-v] [-ol] [-su] [-in 'abcd...'] [-inf ] -fs fontSize Specifies the font size to be generated. Must be smaller than the native project font size -rfs relativeSize Specifies the relative font size e.g. 0.5 would generate a font 50 percent the size of the font in the project file -fo format PlainText-fnt | Binary-fnt | PlainText-txt | XML-fnt | XML-xml | LUA-lua | SKNonRetina-skf | SKRetina-skf | SKRetinaIphone-skf | SKRetinaIpad-skf -v Provides verbose output -ol Generates an additional texture file which has an outline defining each of the glyphs bounds -su Causes missing glyphs from the projects font to be substituted automatically -in Characters to be used for included glyphs. This must NOT contain spaces. Space is added by default -inf Path and filename of the file that contains the glphs to be processed
Now you have confirmed GDCL has been installed you can try it out. Place the sample project file attached to this post on your desktop and type in the following command into the terminal
GDCL ~/Desktop/RetroFont ~/Desktop/RetroFont -fo SKNonRetina-skf -rfs 0.5 -v
This command is going to generate files on your desktop called RetroFont. The files are going to be in the format needed to use the output with Sprite Kit. If you wanted to use the output with Cocos2D then the format in the -fo switch would be PlainText-fnt.
The project has the font defined as being 64pts. By using the -rfs switch set to 0.5 you are asking for the output to be half that size which will generate a font at size 32. You could specific any relative size you want to use. The maximum relative font size that can be used is 1.0.
If you have a set of sizes you need for your project, you can not create a project that is the largest size you need and then place a script into your Xcode project build phase to run GDCL generating as many different output sizes as you need. This means that your designer only has to worry about generating assets at full size, with the build process generating the smaller assets automatically.
When using GDCL it does't simply scale the output from Glyph Designer but generates the font using the relative size you have provided. In doing so it also scales the effects you are applying to the font as well giving you the best possible quality without scaling artefacts etc.