> Ideas.New

Font_CacheAddr        => version no, cache used, cache size
Font_FindFont         name,size,res => handle
Font_LoseFont         handle
Font_ReadDefn         handle => name,size,res,age,usage
Font_ReadInfo         handle => font bbox (pixels)
Font_StringWidth      string,maxx,maxy,split,index => string,x,y,nsplit,index
Font_Paint            string,flags,x,y
Font_Caret            colour,height,flags,x,y
Font_ConverttoOS      x,y (1/72000") => x,y (OS units)
Font_Converttopoints  x,y (OS units) => x,y (1/72000")
Font_SetFont          handle
Font_CurrentFont      => handle,bg,fg,offset
Font_FutureFont       => handle,bg,fg,offset
Font_FindCaret        string,x,y => string,x,y,index
Font_CharBBox         handle,charcode,flags => x0,y0,x1,y1 (OS units/1/72000")
Font_ReadScaleFactors => x-scale, y-scale
Font_SetScaleFactors  x-scale, y-scale
Font_ListFonts        buffer,count,prefix => font name,count
Font_SetFontColours   handle,bg,fg,offset
Font_SetPalette       bg,fg,offset,RGB bg,RGB fg
Font_ReadThresholds   buffer => thresholds
Font_SetThresholds    thresholds
Font_FindCaretJ       string,x,y,x-offset,y-offset => string,x,y,index
Font_StringBBox       string => x0,y0,x1,y1 (1/72000")
Font_ReadColourTable  buffer => 16 pixel values
Font_MakeBitmap       name/handle,size,res,flags
Font_UnCacheFont      name/handle,size,res,flags


Control characters:

 9, x0, x1, x2
11, y0, y1, y2
17, fg
17, &80+bg
18, bg, fg, offset
21, comment, ctrl-char
25, underline posn, underline height
26, font handle


Cacheing algorithm
    load most appropriate form (1-bpp, 4-bpp, outlines)
    use thresholds to make hard decisions
    draw characters directly if necessary
    pack bitmaps after computation from outlines
    pack/unpack 4-bpp as well
    allow transformation of fonts (Font_FindFontT)
        - such rotated fonts can't be pre-computed - file names?
    provide new call to allow stringwidth in negative directions

StringBBox in pixels
Ctrl-sequence to set exact RGB fg/bg/maxoffset in a string
Make underlining go to the next character position (-1 pixel)

