
The Blending Font Manager
-------------------------

The Font Manager now has a conditional switch which allows it to be
built with background blending enabled.  This blending causes the
anti-aliased pixel data to be blended with the background colour
rather than using the fixed colour specified in the numerous
colour setting SWIs.

There is an obvious speed hit in applying this blending, especially
when dealing with 8 bit per pixel (which requires a seperate 
module 'ITable' which is responsible for building the inverse
colour tables used by the painting code).

As the speed hit is noticable, and such blending is not required
by all applications the Font_Paint SWI has been extended as follows:

        Font_Paint
        ----------
        In    R0 = font handle (unless R0=0 or R1 bit 8 clear)
              R1 --> string
              R2 bit 0 set => justify up to current graphics point
              R2 bit 1 set => rubout according to previous 2 graphics points
              R2 bits 2,3 unused
              R2 bit 4 set => coords are OS units, else 1/72000"
              R2 bit 5 set => use R5 as indicated below, else use PLOT coords
              R2 bit 6 set => use R6 as indicated below
              R2 bit 7 set => use R7 as indicated below
              R2 bit 8 set => use R0 as indicated above
              R2 bit 9 set => perform kerning on the string
              R2 bit 10 set => paint from right to left, not left to right

              R2 bit 11 set => perform background blending  	    	    | NEW

              R2 bits 12..31 reserved (must be 0)
              R3,R4 = x,y coordinate of start of string (units <= R2 bits 4,5)
              R5 -> coordinate block (if R2 bit 5 set):
                  R5!0,4 = justification coordinates (note R2 bits 0,4)
                  R5!8,12 = letter-spaced justification coords (note R2 bits 0,4)
                  R5!16,20,24,28 = rubout box coordinates (note R2 bits 1,4)
              R6 -> transformation matrix (if R2 bit 6 set)
                  R6!0..R6!12 = fixed point multipliers
                  R6!16,R6!20= translation (units depend on R2 bits 4,5)
                  unit matrix = [1<<16,0,0,1<<16,0,0]
              R7 = length of string (if R2 bit 7 set)

Setting bit 11 will cause the blending code to be enabled, however it is not
quite that simple - you must ensure the following:

1) The font colours specify that there is >= 1 aliasing colours, otherwise the
   Font Manager will attempt to paint from 1 bit per pixel cache data, rather
   than the 4 bit per pixel anti-aliased data.
  
2) The Font Manager you are calling supports this bit - this may sound strange,
   but as the Font Manager forces you to be a good citizen earlier versions
   will fault this new bit being set.
   
   Therefore you code must performing something similar to this:
   
    	BOOL bBlendingAllowed = FALSE;
    	
    	... during initiailsiation
    	
    	{
    	   int iFontVersion;
    	   
    	   if ( swi( Font_CacheAddr, OUT, R0, &iFontVersion, END ) )
    	     iFontVersion = 0;
    	     
    	   if ( iFontVersion >= 335 )
    	      bBlendingAllowed = TRUE;	    	    /* font manager supports blending */  
    	}
    	
    	... at paint time
    	
    	{
    	  unsigned int flgPaint = xxx;
    	  
    	  if ( bBlendingAllowed )
    	    flgPaint |= ( 1 << 11 );
    	    
    	  swi( Font_Paint.... )  
    	}
    	
   So to recap, have a global which indicates if blending is supported.  Call
   Font_CacheAddr which will return the version of the Font Manager being
   used, if this is >= 335 then blending is available.
   
   Therefore if you want blending and the global is TRUE you can then 
   set the background blending flag. 	
   
As mentioned above the Font Manager requires an extra support module to perform
blending in 8 bit per pixel, if this module is not present then the blending
feature will be disabled.


Further note:
------------
Building a blending Font Manager requires a change to the Fonts01 source
(we have been unabled to decide on a suitable change to the build system
to support multiple targets).

Therefore to build a blending version you must change 'blending' in Fonts01
to be 'true'.

-- David De Vorchik
