Showing changes from revision #4 to #5:
Added | Removed | Changed
Font background blending works by blending the font foreground colour with the colour of the screen, on a per-pixel basis.
To use background blending you must ensure the following:
As blending is slow, it should be avoided on known uniform backgrounds.
An extension to the regular background blending functionality is alpha/supremacy blending. This blending mode takes into account the alpha/supremacy value of the screen pixels, allowing text to be overlaid on top of images that are to be displayed in an alpha-blended manner. The opacity of the text can also be adjusted by specifying a supremacy value when setting the font foreground colour (e.g. by ColourTrans_SetFontColours or Font_SetFontColours).
Before attempting to use alpha/supremacy blending you must:
For screen modes with an alpha channel (bit 15 of Mode Flags set), the top byte (in 16M colour, 32bpp modes) or nibble (in 4K colour, 16bpp modes) is used to store the alpha, with 0 treated as fully transparent and 255 (or 15) as fully opaque.
For screen modes without an alpha channel, the top byte/nibble is treated as supremacy, with 0 treated as fully opaque and 255 (or 15) as fully transparent. Note that only a handful of RISC OS APIs deal with supremacy correctly, so using an alpha format screen mode is recommended where possible.
Note that alpha/supremacy font blending is significantly slower than standard background blending, and so should be avoided where possible (i.e. background is known to be fully opaque, and font foreground colour doesn’t specify any transparency).