I'm a font developer. I want to merge a DSIG code into a TrueType format (TTF) font, which makes it compatible with Microsofts applications that use OpenType features. I have had this working before but have now can only produce a zero bytes font.ttf file. I'm using Adobe Font development Kit (AFDKO). as prescribed along with Terminal to make the merge. I would appreciate knowing why I get a zero bytes file?
Here is my step-by-step method, followed by the resulting Terminal window code.
Launch a new Terminal session and enter
which ttx
A path ending in ttx means good to go.
Paste this snippet…
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="2.4"> <DSIG> <hexdata> 00000001 00000000 </hexdata> </DSIG> </ttFont> EOF
then after entering the return key:
open .
This creates a new Folder on the Desktop entitled ‘Dsig fldr’. Inside will be a newly created file entitled ‘dsig.ttx’ for use with this routine:
Drag TTX app to Terminal (since it accepted your Dsig fldr snippet):
/Users/adrianshome/Downloads/fonttools-2.4/Tools/ttx
Type: -m (not forgetting a space after the m).
/Users/adrianshome/Desktop/Dsig\ fldr/SassoBooIta.ttf /Users/adrianshome/Desktop/Dsig\ fldr/dsig.ttx
First remove all of the dsig#.ttf files in the Dsig fldr if there are any.
Then for each font file:
- Drag the ttf font file to terminal (say SassoBoo.ttf)
- Drag dsig.ttx to terminal and hit return
That will compile only dsig.ttx, merge the DSIG into SassoBoo.ttf and produce a file named dsig.ttf in the Dsig fldr, so now…
- Rename dsig.ttf as SassoBoo something.ttf (the original TrueType filename)
There are much better ways to proceed using scripts.
Don't switch steps 3 and 4. You need to put the .ttf file before the .ttx file.
Notes: dsig.ttx and all your .ttf files must reside in the Dsig fldr Folder. TTX app can live anywhere, since the drag of it inserts the path each time.
Here is the resulting Terminal code:
Last login: Thu Mar 31 11:41:06 on ttys001
Adrians-iMac:~ adrianshome$ which ttx
/Users/adrianshome/bin/FDK/Tools/osx/ttx
Adrians-iMac:~ adrianshome$ FLDR="${HOME}/Desktop/Dsig fldr"
Adrians-iMac:~ adrianshome$ mkdir -p "$FLDR"
Adrians-iMac:~ adrianshome$ cd "$FLDR"
Adrians-iMac:Dsig fldr adrianshome$ cat > dsig.ttx<<EOF
> <?xml version="1.0" encoding="ISO-8859-1"?>
> <ttFont sfntVersion="\x00\x01\x00\x00" ttLibVersion="2.4">
> <DSIG>
> <hexdata>
> 00000001 00000000
> </hexdata>
> </DSIG>
> </ttFont>
> EOF
Adrians-iMac:Dsig fldr adrianshome$ open .
Adrians-iMac:Dsig fldr adrianshome$ /Applications/FDK/Tools/osx/ttx -m /Applications/Dsig\ fldr/CUP\ Folder\ alpha/SassPenTra.ttf /Users/adrianshome/Desktop/Dsig\ fldr/dsig.ttx
Compiling "/Users/adrianshome/Desktop/Dsig fldr/dsig.ttx" to "/Users/adrianshome/Desktop/Dsig fldr/dsig.ttf"...
Parsing 'DSIG' table...
Traceback (most recent call last):
File "/Applications/FDK/Tools/osx/../SharedData/FDKScripts/ttx.py", line 329, in <module>
main(sys.argv[1:])
File "/Applications/FDK/Tools/osx/../SharedData/FDKScripts/ttx.py", line 309, in main
process(jobs, options)
File "/Applications/FDK/Tools/osx/../SharedData/FDKScripts/ttx.py", line 294, in process
action(input, output, options)
File "/Applications/FDK/Tools/osx/../SharedData/FDKScripts/ttx.py", line 216, in ttCompile
ttf.save(output)
File "/Applications/FDK/Tools/osx/Python/Current/lib/python2.7/site-packages/FontToo ls/fontTools/ttLib/__init__.py", line 214, in save
self._writeTable(tag, writer, done)
File "/Applications/FDK/Tools/osx/Python/Current/lib/python2.7/site-packages/FontToo ls/fontTools/ttLib/__init__.py", line 629, in _writeTable
tabledata = self.getTableData(tag)
File "/Applications/FDK/Tools/osx/Python/Current/lib/python2.7/site-packages/FontToo ls/fontTools/ttLib/__init__.py", line 642, in getTableData
return self.tables[tag].compile(self)
File "/Applications/FDK/Tools/osx/Python/Current/lib/python2.7/site-packages/FontToo ls/fontTools/ttLib/tables/D_S_I_G_.py", line 60, in compile
packed = sstruct.pack(DSIG_HeaderFormat, self)
File "/Applications/FDK/Tools/osx/Python/Current/lib/python2.7/site-packages/FontToo ls/fontTools/misc/sstruct.py", line 68, in pack
value = obj[name]
KeyError: 'ulVersion'
cat
step. It looks like you have a sequence of digits then a line break before the file ends. You might trynano
for editing that file since it doesn't encode the text and has on-screen help. Also - do you have a working example to check against the one that fails?