TTX 2.3 installer?

Arno Enslin's picture

http://sourceforge.net/projects/fonttools/files/

Would anybody explain, how to build WinTTX2.3.exe? I have produced a total chaos in the last two hours. I don’t know, if I have damaged anything now. Adam Twardoch’s (?) instructions, contained in fonttools-2.3.tar.gz instructions don’t seem to be up to date.

If anybody has prebuilt installers, I am likewise interested. Independent from the question, if anybody can help me to build installers by myself.

Why don’t the developers provide installers for each version?

I have installed the following now:
Python 2.3
Python 2.3 Numeric-24.2 (I was asked for that during my attempts to build the installer. A version was not specified, but I had on my harddisc, because I needed it already for anything before.)
Python 2.3 py2exe-0.6.9
Inno Setup Compiler 5.3.7 (u)

And these are the instructions:

Pre-compiled versions are hosted at http://www.font.org/software/ttx/

APPROACH I: Using py2exe and InnoSetup

1. Install Python 2.3 for Windows: http://www.python.org/
2. Install py2exe: http://starship.python.net/crew/theller/py2exe/
3. Install InnoSetup 4: http://www.jrsoftware.org/
4. Download the latest released source code of TTX/FontTools at
http://sourceforge.net/projects/fonttools/
Or alternatively grab the sources from SVN:
http://fonttools.sourceforge.net/
5. Unzip the source code of TTX/FontTools into a folder.
6. In the folder where you unzipped TTX/FontTools, type:
python setup.py py2exe -f --icon Windows\ttx.ico --packages encodings
7. Run Inno Setup and open Windows\fonttools-win-setup.iss
8. In Inno Setup, select File/Compile, then Run/Run.

APPROACH II: Using McMillan Installer and InnoSetup

1. Install Python 2.3 for Windows: http://www.python.org/
2. Download and unpack McMillan installer:
http://py.vaults.ca/apyllo2.py/22208368
and put the Installer folder into your Python folder,
e.g. C:\Python23\Installer
3. Install InnoSetup 4: http://www.jrsoftware.org/
4. Install Microsoft Visual C++ Toolkit 2003:
http://msdn.microsoft.com/visualc/vctoolkit2003/
5. Put UPX somewhere within your PATH: http://upx.sourceforge.net/
6. Download the latest released source code of TTX/FontTools at
http://sourceforge.net/projects/fonttools/
Or alternatively grab the sources from SVN:
http://fonttools.sourceforge.net/
7. Unzip the source code of TTX/FontTools into a folder.
8. In the folder where you unzipped TTX/FontTools, type:
python setup.py install -f
9. Edit mcmillan.bat so the paths in the file correspond to the paths in your system,
and run it.
10.Run Inno Setup and open Windows\fonttools-win-setup.iss
11.In Inno Setup, select File/Compile, then Run/Run.

The distributable TTX Windows setup executable has been saved
in the Output subfolder of the FontTools\Windows folder.

Arno Enslin's picture

It’s this command, that does not work:
python setup.py py2exe -f --icon Windows\ttx.ico --packages encodings

error: -f not recognized

Spire's picture

Adam's instructions are out of date, and won't work anymore without substantial modifications.

Several years ago I built a TTX executable for Windows and created an installer for it; even then, I needed to deviate significantly from Adam's instructions. Adam still has my build available for download here.

It so happens that I recently got a request from Adam to help create an updated Windows build from the latest SVN sources, so I've been working on this in my very limited spare time in the past week or so.

I've successfully built a working Windows TTX executable using the latest versions of Python 2.x, Numeric, and py2exe. As soon as time permits, I'll be packaging it up into an installer, similar to the one that I built several years ago.

Arno Enslin's picture

@ Spire

Thanks in advance! If you find the time I also would be interested in how to build an installer by myself, because otherwise I had to ask again, when the next version of FontTools is released. I have spent four or five hours with that today and I was wondering, why I was not able to find any informations with regard to how to make use of the FontTools package on Windows. I mean, who the hell is using this tool. Most people interested in building fonts, are not programmers. (I don’t necessarily need the drag and drop function, because I am using all versions of TTX [up till 2.2 contained in the AFDK] with batch files. On the other side I am mainly interested in TTX but not in the rest of the FontTools package. So an installer would be more practical, because I don’t want to install dozens of different Python versions, py2exes, numpies et cetera, especially not, if I even don’t know, which versions are required. Python 2.3 was already installed here because of FontLab.) Sorry, but I felt like an total idiot.

By the way, the search function of Typophile does likewise not work as it should. I always have to google for keywords in combination with "site:typophile.com".

Thanks again!

Arno Enslin's picture

I was not able today to build an TTX installer, but at least I am able to use TTX 2.3 now.

I have installed the following packages:
numpy-1.3.0-win32-superpack-python2.6.exe
py2exe-0.6.9.win32-py2.6.exe
python-2.6.4.msi

And used this command from the fonttools-directory (in my case C:\fonttools-2.3):
C:\Python26\python.exe setup.py install

And then I have deleted the fonttools directory, because I could start ttx either with ttx.py from a subfolder of the fonttools directory or from a subfolder of the Python directory, in which the fonttools (partly?) were copied during the install command.

ttx.py -h is the help command of TTX (if the Python extension is registered). Just for the case, that someone is less competent than me and needs three days instead of two for something, that would need a few minutes only, if developers would be more interested in users (which are potential developers and bug-reporters).

Spire's picture

I didn't realize that you hadn't even been able to run TTX via an installed copy of Python. If you had mentioned that, I could have given you quick instructions on how to set that up.

Arno Enslin's picture

I wanted to avoid installing another version of Python because of FontLab. And I prefer standalone versions of TTX, because I want to have all of them installed. I doubt, that I could install another version of FontTools parallel in the Python directory.

So I have TTX 2.0b1 from the only actually available installer version, TTX 2.0b2 from the AFDKO 2.0_26, TTX 2.2 from the AFDKO 2.5_21898 and TTX 2.3 from FontTools 2.3.

And I am using the same batch files (in different directories) for all versions except from one, in which the paths are set and that is called by the other batch files (because in the past I had to change the paths in all batch files.)

For version 2.3:

@echo off
set "FDK=C:\Python26\Lib\site-packages\FontTools\fontTools"
set "TTXcom=call %FDK%\ttx.py"
set "TTXhelpCom=%FDK%\ttx.py -h"

For version 2.2:
@echo off
set "FDK=C:\FDK_25_21898\Tools\win"
set "TTXcom=call %FDK%\ttx"
set "TTXhelpCom=%FDK%\Python\Current\python.exe %FDK%\Python\Current\Scripts\ttx -h"

twardoch's picture

Arno,

please consider that opensource efforts such as TTX/FontTools are made by volunteers in their spare time. The concept of opensource is that any developer can, and is encouraged, to contribute. The software comes free of charge, as is. There is nobody who collects license fees, and there is nobody who gets paid for their work on the software.

When I produced the build instructions for TTX/FontTools for Windows five or so years ago, I worked on Windows, so I had the time and possibility to research it, put it together and document it. The reason for me doing it was pretty much so that I can make a working build myself, for my own needs. And needless to say, I did it on a fully voluntary basis -- just like Just van Rossum put enormous time and effort to develop TTX/FontTools in the first place.

Adobe's Read Roberts contributed some code to TTX/FontTools, and fortunately enough, Adobe FDK for OpenType includes a compiled version of TTX for Windows (as you point out, currently, it's the TTX 2.2 version).

More than two years ago, I completely switched to Mac OS X, and unfortunately, I can no longer maintain build instructions for Windows. I simply don't have the necessary up-to-date software, nor a working Windows machine where I could do it. And I don't have the time. Plus, yes, the motivation of creating a working build MYSELF no longer applies. This is why I contacted Spire, asking him to contribute, since he did make a more updated build more recently.

Anyone willing to contribute updated build instructions for TTX/FontTools for Windows is welcome to do so (or is welcome to find a Python for Windows developer who is willing to do it, and pay him). This is the key concept of opensource.

Milton Friedman used to say "There is no such thing as a free lunch". If the lunch is said to be free, it may mean that you need to participate in cooking it.

Though I can say, if someone writes a simple-to-follow set of instructions for building an executable version of TTX 2.3 for Windows under today's conditions, I can make sure that it gets incorporated into the official distributive. And I'll be happy to continue hosting the executable versions on font.org/software/ttx/ -- this is as much as I can do today.

Best,
Adam

Spire's picture

I do intend to provide updated simple-to-follow build instructions for Windows at around the time I finish up the installer.

Michel Boyer's picture

All I can access right now is my MacBook Pro with OS X 10.5; I use python2.5.1 (as /usr/bin/python). I just downloaded ttx 2.3. In a Terminal window, in the folder fonttools-2.3, I typed setup.py --help to get the required help and did what I was told to do.

setup.py build
sudo setup.py install

I had to exit Terminal and start it again so that ttx would give me ttx 2.3 (else it is the FDK ttx, which is ttx 2.2 that was fetched even after installing).

Michel

PS. The message does not say to write "sudo". I however expected ttx to be installed in /usr/local (and there it is) and sudo allows me to do that on a unix based machine.

Michel Boyer's picture

I have a running version of ttx 2.3 on Windows XP.

  1. I downloaded python2.6 from http://www.python.org/download/ and installed in C:\python26
  2. I downloaded numpy from http://sourceforge.net/projects/numpy/files/ (the files were installed in C:\python26 also)
  3. I downloaded fonttools http://sourceforge.net/projects/fonttools/files/ and untared
  4. I added C:\Python26 to my PATH (so that python be C:\python26\python.exe)
  5. In the fonttools-2.3 folder I executed "python setup.py build"
  6. I then executed "python setup.py install"
  7. I added in the folder C:\Python26 a file called ttx23.cmd whose content is

    @echo off
    C:\Python26\python C:\Python26\Scripts\ttx %*

I tried ttx23 on some ttf file (in a command window) and everything seemed to work fine. That way ttx stays the old FDK ttx. I don't know what side effect that may have on FontLab.

Michel

Thomas Phinney's picture

Is there any version of TTX currently available that can handle the latest version of the OS/2 table? I get a lot of failures because of that....

Thanks,

T

twardoch's picture

The current TTX 2.3 supports the OS/2 version 4 table.

Richard Fink's picture

@spire and adam,

Thanks for your efforts.
A Windows installer for 2.3 would be sensational. Free tools like TTX are great for web designers and developers who are looking to experiment with fonts but are not yet quite ready to make an investment in a font editor.
I recommend TTX in the documentation for EOTFAST.
If I can be of any help please don't hesitate to contact me via contact page on my blog, Readable Web.

Richard Fink

Thomas Phinney's picture

It's great that TTX 2.3 supports the latest, but there's no Windows installer. My main machine is running 64-bit Vista. So I installed 64-bit Python 2.6. But I don't see an X86-64-bit NumPy... now what? Uninstall that Python and go with a 32-bit version?

This is the kind of thing that makes me wish TTX were a commercial utility. I'd be happy to spend $50 on it to avoid spending an hour trying to figure out how to install it on my OS version.

Cheers,

T

Thomas Phinney's picture

Upon further reflection, I think the Win-AMD64 version is probably correct... will give it a go.

T

[UPDATE: Now I learn that the Win 64 version of NumPy is "experimental, and only available for testing... CRASHES ARE TO BE EXPECTED" and indeed it crashed ttx. But I think I had everything wired up correctly thanks to Michel's instructions. I guess I'll switch to 32-bit versions of everything and try again. Sigh.]

[UDPATE 2: Now working! Excellent. Next to install the Mac version on my Mac.]

Thomas Phinney's picture

Funny, it looked like the Mac install would be easier than the Windows one.

I'm on OS X 10.5.8, in Terminal. I unpacked the FontTools folder and went in. It looked like the build command worked.

When I type "sudo setup.py install" in Terminal, I got the error "sudo: setup.py: command not found"

At first I thought it was that my Mac doesn't have Python in its path. With a little digging, I realized that the only version of Python I have on this machine is the one in the Adobe AFDKO. I assumed the Mac *came* with Python, and I was wrong. I think I'll install Python 2.6 at the main level rather than make TTX/FontTools dependent on something in an AFDKO directory.

Cheers,

T

Arno Enslin's picture

@ Thomas

This is the kind of thing that makes me wish TTX were a commercial utility.

No. There are many OpenSource projects, that are better than commercial projects. But there is a TTX section on the FontLab forum. If more people would ask their questions there, more people could solve problems with TTX. And if there would be an installer and tutorials, more people would be interested in TTX. Making the start with TTX difficult by not updating installation informations, makes TTX inattractive. And as less interested people there are, as less people contribute to the project. And the consequence is, that many people don’t see, what a great tool TTX is. That’s unprofessional. I would prefer a TTX section on Typophile. Maybe we can open such a section here.

For example it would be very cool, if we could integrate a comment function into TTX. Actually I am using a small search and replace tool, that comments the namerecords, but its extremely slow. It would be much more comfortable to either use a Python search and replace function or to put comments directly into the TTX file during the decompilation.

And another example: TTX can extract the hexdata of all tables. If a table is unknown, it extracts the hexdata. If a table is known, it decompiles it. If you want to extract a known table, you have to rename or to remove the matching table-py- and pyc-files. This is uncomfortable, but probably it can easily be changed. Such hexdata can be merged into other fonts. They only must have the same glyph order. So TTX can be usefull, even if it is unable to decompile a table correctly. (TTX 2.3 trashes information contained in the featureParams tags of the GSUB-table, but don’t posts an error message.)

(If you want to have a commercial tool, why don’t you buy OTMaster? In my opinion the price of OTMaster is much too high. DTL even wants to have 50 Euro for the update, although there was not much time between versions 1 and 2. But you have worked for Adobe and probably you have more money. I don’t need most of its functions, especially not the glyph editor. In case of OTMaster you cannot contribute.)

Do you know, how I have learned CSS? I started to manipulate the skin of Firefox. (You can change almost everything in Firefox. And that is an OpenSource project, that is a thousand times better than the stupid Microsoft Internet Explorer. Microsoft has slowed down the development of websites. We had to live one decade with the MS shit, before Firefox came, because the dominance of MS did not motivate web designers to write clean code for a few users only, that use alternative browsers [or simply, browsers, but not the IE]. LATER I used my knowledge about CSS for websites. If the start with TTX would be easier, probably more people would be willing to learn Python and contribute to the Fonttools project.

Jens Kutilek's picture

I assumed the Mac *came* with Python

It does. Could you have removed it perhaps? The "site packages" are usually in /Library/Python/[version]/site-packages/ and the actual Python frameworks in /System/Library/Frameworks/Python.framework/Versions/[version]. On 10.6 I have three versions there, 2.3 (which FontLab uses), 2.5 (carried over from Mac OS 10.5), and 2.6, which is the version shipped with Snow Leopard.

I currently use ttx version 2.2 with Python 2.5, and I have successfully used it to »upgrade« fonts from OS/2 table version 3 to 4. So Adam's statement

The current TTX 2.3 supports the OS/2 version 4 table.

is probably true, but ttx 2.2 also seems to handle it :)

Michel Boyer's picture

When I type "sudo setup.py install" in Terminal, I got the error "sudo: setup.py: command not found"

To know if python is installed and where, you can just type which python in the terminal window. If you type python -V you will be told the version. I am on OS X 10.5.8 on my PowerBook Pro and the installation was almost immediate. If . (the current directory) is not in your path, then sudo setup.py install will not work and give you exactly the message you got because the exectutable setup.py will not be in your path and thus will not be found. You then need to type

./setup.py build
sudo ./setup.py install

Now, if /usr/local/bin is not in your path and before the FDK path, then when typing ttx in the terminal window, you will still get the old FDK ttx. To see your path, type

echo $PATH

in a terminal window. That gives you a list of folders where executables are to be searched. If /usr/local/bin is not in the : separated list, and before the folder /Users ... /FDK/Tools/osx, then maybe the best thing to do is then to type

open build

which will open the build folder; then double click on the scripts-2.5 folder, rename ttx to ttx2.3 and move that file into your FDK executables folder. After that, typing ttx2.3 in a terminal window will give you the new ttx.

Michel

andyclymer's picture

@Thomas
When I type "sudo setup.py install" in Terminal, I got the error "sudo: setup.py: command not found"

I think the command should be "sudo python setup.py install" instead of "sudo setup.py install"

Michel Boyer's picture

I think the command should be "sudo python setup.py install"

That will also work. The file setup.py is both a python script and a unix script because its first line is "#!/usr/bin/env python" i.e. python is called on it when executed as a shell script.

Thomas Phinney's picture

All good, after I installed Python. My Mac was set up my IT folks at my work, so I can probably blame them for the missing Python.

T

fanatic font addict's picture

Arno Enslin wrote:

"It’s this command, that does not work:
python setup.py py2exe -f --icon Windows\ttx.ico --packages encodings

error: -f not recognized"

remove the -f and --icon option

Then add the following to the setup.py file:

console = ["tools/ttx"],

you can add it after the existing line that reads

scripts' = ["tools/ttx"],

Without the "console = ..." line it won't create ttx.exe. The console command is a py2exe command. The scripts command is just some python command evidently, not connected to py2exe which is the thing that actually creates a ttx command line executable. You can use the "windows = " command instead of "console = " to create a windows GUI .exe.

Here's a list of option for py2exe:
http://www.py2exe.org/index.cgi/ListOfOptions

There could be a lot of other extraneous things in that existing setup.py, but adding the "console = ..." line will create the executable.

(Didn't really know anything about Python till a couple of hours ago though.)

Arno Enslin's picture

@ fanatic font addict

There could be a lot of other extraneous things in that existing setup.py, but adding the "console = ..." line will create the executable.

So you have not tried to build the installer? The last time I have tried it I produced a totally mess. I am still interested in a tutorial, but not in more experiments.

Arno Enslin's picture

@ Spire

Please, please, provide the installer or – better – instructions, how to build an installer.

ssdesign's picture

Hi,
Can anyone here help me understand how to install TTX on a web server?
I am interested to install it on my web host and try out a few things online.

Any help in this regard is greatly appreciated.

Thanks

twardoch's picture

ssdesign,

if you have Python on your webserver, you just need to do
python setup.py install

(Well, you need to install NumPy first.)

Best,
Adam

Pomax's picture

For those who "just want TTX 2.3" on windows, I compiled a version using the above recipe (setup.py build/install + http://typophile.com/node/67406#comment-407219 instructions) and placed it online at http://pomax.nihongoresources.com/downloads/TTX%202.3%20-%20win32.ZIP (8.2MB).

This version of TTX was build on a windows 7, using the 32 bit versions of python 2.7 and py2exe (there was no real point in compiling a 64 bit version, because nothing TTX does really benefits from 64 bit instructions)

No installer, just unpack to your "Program Files" (on win32) or "Program Files (x86)" (on win64) and done. To then also use it from anywhere and everywhere, simply extend your system's PATH variable (control panel -> system -> advanced system settings -> environment variables -> system variables, "PATH" variable) to include "C:\Program Files (x86)\TTX" (the exact drive and folder depends on where you unpack it to, of course)

brunoimbrizi's picture

Thanks to a lot of the comments here I managed to install TTX 2.3 on Windows.
Here's my suggestion for updated instructions on the README.txt file:

APPROACH I: Using py2exe and InnoSetup

1. Install Python 2.7 for Windows: http://www.python.org/
2. Install py2exe: http://starship.python.net/crew/theller/py2exe/
3. Install NumPy http://numpy.scipy.org/
4. Install InnoSetup 5: http://www.jrsoftware.org/
5. Download the latest released source code of TTX/FontTools at
http://sourceforge.net/projects/fonttools/
Or alternatively grab the sources from SVN:
http://fonttools.sourceforge.net/
5. Unzip the source code of TTX/FontTools into a folder.
6. In the folder where you unzipped TTX/FontTools, edit setup.py and add:
console = ["Tools/ttx"],
right after this line:
scripts = ["Tools/ttx"],
7. In the folder where you unzipped TTX/FontTools, type:
python setup.py build
python setup.py install
python setup.py py2exe --packages encodings
8. Run Inno Setup and open Windows\fonttools-win-setup.iss
9. In Inno Setup:
Edit the line:
Source: ..\dist\ttx\*.*;
to
Source: ..\dist\*.*;
And delete the line:
Source: ..\Doc\bugs.txt; DestDir: {app}; Flags: ignoreversion promptifolder
10. In Inno Setup, hit Build > Compile, then Run > Run.

The distributable TTX Windows setup executable has been saved
in the Output subfolder of the FontTools\Windows folder.

vodek's picture

brunoimbrizi, thanks a lot for you post!

Compiled version of TTX/FontTools 2.4 for Windows:
http://rusfolder.com/37217290

This version of TTX was build on Windows 7, Python 2.7.5 Win32 (http://www.python.org/download/), Py2exe 0.6.9 Win32 for Python 2.7 (http://www.py2exe.org/), NumPy 1.7.1 for Python 2.7 Win32 (http://sourceforge.net/projects/numpy/files/NumPy/), Inno Setup 5.5.3 (non Unicode version) (http://www.jrsoftware.org/isdl.php).

Syndicate content Syndicate content