New fork of UTFT library

I've created a new fork of the UTFT library. My main purpose in forking this library is to support my Ormerod 3D printer control board, which is designed to be compatible with Arduino Leonardo for programming. The changes I have made are:

  1. Support a new 9 bit interface mode. This uses an external 74HC373 chip to latch the high byte of data, so that the same 8 pins can be used for both the low and high bytes when driving a display that has a 16 bit interface. One pin is needed to drive the latch. So this saves 7 pins compared to using 16-bit mode, making it practical to use a 16-bit display with the smaller Arduinos.

  2. The transfer mode is now set via another parameter separate from the display type. This avoids having to use separate names for the same 16-bit display driven with/without the external latch.

  3. I have rewritten the text print functions. The UTFT class now inherits from Print, so all the usual printing functions can be used. A separate call setTextPos(x, y) sets the starting position. Proportionally-spaced fonts and auto kerning are now used. Optionally, a right margin can be defined. This is used to prevent text from spilling beyond the margin, also there is a clear-to-margin command. Both of these features are useful when writing text using proportionally-spaced fonts, as the width of the text is not easy to predict.

  4. I have rewritten the straight line drawing function to use Bresenham's algorithm, to avoid using floating point maths.

  5. I have rewritten the fillCircle function to be much faster.

  6. I have made other speed improvements. In particular, filling or clearing large blocks of pixels is much faster, when using 9- or 16-bit interface mode.

  7. I have added other options in memorysaver.h to allow further memory savings to be made, e.g. by disabling transfer modes that are not required.

You can find it at GitHub - dc42/utft: UTFT Library - TFT controller library for Arduino/Chipkit. I have not yet updated the examples.