When writing PUSH instructions, obey requested opcode

Previously fonttools was choosing between the optimal opcode
from PUSHB, NPUSHB, PUSHW, and NPUSHW.  We now respect
whatever was requested and err if the format doesn't support
the data.

Morevoer, if the number of numbers to push is more than 255,
we add multiple push instructions to push all the numbers.

Finally, add a new pseudo-opcode "PUSH" that automatically
chooses the best format.

This, by itself, reduces roundtrip noise by not optimizing
the bytecode as it was before.  In a followup commit I'll
change the bytecode disassembler to always produce PUSH
in the textual instructions instead of the four variants.
That way, we get both the optimization during assembling,
and reduced noise in XML.

Part of https://github.com/behdad/fonttools/issues/73
1 file changed
tree: 8394f2521732378d191b0bfc46abb488afb4e224
  1. Doc/
  2. Lib/
  3. MetaTools/
  4. Tools/
  5. Windows/
  6. LICENSE.txt
  7. MANIFEST.in
  8. README.md
  9. setup.py
README.md

What it is ?

Quoting from TTX/FontTools Sourceforge Project

a tool to convert OpenType and TrueType fonts to and from XML. FontTools is a library for manipulating fonts, written in Python. It supports TrueType, OpenType, AFM and to an extent Type 1 and some Mac-specific formats.

Quick start

python setup.py install

From your command line type the above command to get fontools installed on your system.

Installation

See install.txt in the 'Doc' subdirectory for instructions on how to build and install TTX/FontTools from the sources.

Documentation

What is TTX ?

See documentation.html in the "Doc" subdirectory for TTX usage instructions and information about the TTX file format.

Community

License

See "LICENSE.txt" for licensing information.

Have fun!

Just van Rossum just@letterror.com