Python Forum

Full Version: TTX 3.0 -- From OpenType To XML And Back
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I have used this routine previously with Python 2.7 with Adobe's Font Develpoment Kit (FDK) tools which include the .ttx function which exports a TrueType (.ttf) font file to xml, merges a dummy Digital Signature (DSIG) and compiles to a .ttf file again. The .ttf file only needs to have a DSIG table merged into the font for it to be recognised as a valid font in Windows OS. I have the .ttx file AND the .ttf file stored in the same Folder, which is a requirement.

Now that I have updated Python to version 3.7.0 with Adobe's FDK, the same routine fails to work, giving an error of command not found each time. Any help to get me off the starting blocks would be greatly appreciated.

Adrians-iMac-2:Dsig fldr adrianshome$ adddsig /Users/adrianshome/Desktop/Dsig\ fldr/SassoInfProReg.ttf 
-bash: adddsig: command not found
I have also tried
-m
and get
-bash: -m: command not found
Here is my routine for a drag 'n drop form a Folder. . .

Launch Mac OS Terminal
cd Adrians-iMac:~ adrianshome$
Type
 which ttx
/usr/local/bin/ttx
Drag .ttx app to Terminal.

PASTE CODE
FLDR="${HOME}/Desktop/Dsig fldr"
mkdir -p "$FLDR"
cd "$FLDR"
cat > dsig.ttx<<EOF
<?xml version="1.0" encoding="ISO-8859-1"?>
<ttFont sfntVersion="\x00\x01\x00\x00" ttLibVersion="3.0">
<DSIG>
<hexdata>
00000001 00000000
</hexdata>
</DSIG>
</ttFont>
EOF
open .
RETURN
Adrians-iMac:~ adrianshome$ 
ENTER
adddsig (followed by a space)
DRAG FONT FILE TO TERMINAL:
Adrians-iMac:Dsig fldr adrianshome$ adddsig /Users/adrianshome/Desktop/Dsig\ fldr/SassoInfProReg\ copy.ttf


RETURN
Compiling "/Users/adrianshome/Desktop/Dsig fldr/SassoInfProReg.ttx" to "/Users/adrianshome/Desktop/Dsig fldr/SassoInfProReg.ttf"...
Parsing 'DSIG' table...
MERGES ORIGINAL TTF FILE WITH DSIG(check time difference):
Adrians-iMac:~ adrianshome$
On Mac OS X, in Terminal I'm using Python3 (3.7) with a 'ttx' module from Adobe Font Development Kit

The 'ttx' module merges a Digital Signature table (dsig) into a TrueType (ttf) font by exporting to xml and back again to ttf file.

Adrians-iMac-2:~ adrianshome$ which ttx
/usr/local/bin/ttx
Adrians-iMac-2:~ adrianshome$ /Users/adrianshome/bin/FDK/Tools/osx/ttx -m /Users/adrianshome/Desktop/Dsig\ fldr/SassoInfProReg.ttf 
usage: ttx [options] inputfile1 [... inputfileN]

Error:
ERROR: Must specify at least one input file
Adrians-iMac-2:~ adrianshome$
I have received various error messages and this latest error is the first that makes sense.  Have I put the input file in the wrong order in the code? or is there some other reason for the error?

These instructions worked for me in the past with previous versions of Python and Adobe's ttx module.

Still confused,
Adrian