h6. [[FontManager]] h6(. » [[FontManager Technical Details|Technical Details]] h6((. » Font Background Blending h4. Standard Blending 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: # You have checked with [[Font_CacheAddr]] that [[FontManager]] supports this bit (bit 11), as versions earlier than 3.35 will complain if this bit is set; # Font colours specify one or more anti-aliasing colours, else the Font Manager will use 1bpp (non-aliased) painting. As blending is slow, it should be avoided on known uniform backgrounds. h4. Alpha/Supremacy Blending 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: # Check with [[Font_CacheAddr]] that [[FontManager]] supports this bit (bit 14), as versions earlier than 3.60 will complain if this bit is set; # Both bits 11 and bit 14 of the [[Font_Paint]] flags must be set (the requirements for background blending must also be met); # You are rendering to a 16M colour (32bpp) or 4K colour (16bpp) screen mode (i.e. each screen pixel has 8 or 4 bits of alpha/supremacy available). Attempting to use alpha/supremacy blending in other modes will result in an error. 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). h4. See also * [[Font_Paint]] * [[Font_Paint Special Characters|Control Characters]] * [[Font_Paint Block]] * [[Font_Paint Flags]] * [[Font String Forms]] * [[Font Background Blending]] * [[Font Transformation Matrix]]