Back to Contents Previous Next
11. Text
FNwimp_getfont(font$,sizex,sizey)
Obtains a font handle for a particular outline font at a particular point size.
font$ = name of font, period separated. eg: “Trinity.Medium”.
sizex = point size in horizontal direction.
sizey = point size in vertical direction.
Returns 0 if the font cannot be found.
PROCwimp_losefont(font%)
‘Forgets’ about a font i.e. closes its handle, like closing a file.
Should be called when you have finished with the font, eg. when the
application is quitting.
font% = handle of font to lose.
FNwimp_gettextsize(text$,font$,sizex,sizey,side%,scalex,scaley)
Returns the size (in OS units) of a text string as if it had been plotted in a particular outline font, using a string-specified font at specified point sizes and scaling. Returns 0 if the font cannot be found.
text$ = string to measure.
font$ = name of font, period separated, eg: “Trinity.Medium”.
sizex = point size in horizontal direction.
sizey = point size in vertical direction.
If side%=0 then the plotted width (length) of the text is returned.
If side%=1 then the plotted height of the text is returned.
scalex,scaley = respectively, required scaling factors in x and y directions. Values <1 reduce displayed size; values >1 increase size.
(1 meaning no change in size).
FNwimp_gettextsizeh(text$,font%,side%,scalex,scaley)
Returns the size (in OS units) of a text string as if it had been plotted in a particular outline font, using a font handle and scaling.
text$ = string to measure.
font% = handle of font.
If side%=0 then the plotted width (length) of the text is returned.
If side%=1 then the plotted height of the text is returned.
scalex,scaley = respectively, required scaling factors in x and y directions. Values <1 reduce displayed size; values >1 increase size.
(1 meaning no change in size).
PROCwimp_plottext(t$,f$,sizex,sizey,align%,x%,y%,fr%,fg%,fb%,br%,bg-%,bb%,scalex,scaley,blending%)
Plots text directly to screen, using string-specified font at specified x/y point sizes, scaled and with choice of colours and alignment.
t$ = string to plot.
f$ = name of font to use, period separated e.g. “Trinity.Medium”. (If font cannot be found then “Trinity.Medium” is automatically substituted.)
sizex = point size in horizontal direction.
sizey = point size in vertical direction.
align% = if 0, text is left-aligned at x%/y%; if 1, text is centred on x%/y%: if 2, text is right aligned to x%/y%.
x%,y% = screen coordinates (OS units) to plot the text at (y% value is bottom of text)
fr%,fg%,fb% = foreground colour red, green and blue amounts in range 0-255.
br%,bg%,bb% = background colour red, green and blue amounts in range 0-255.
scalex,scaley = respectively, required scaling factors in x and y directions. Values <1 reduce displayed size; values >1 increase size.
(1 meaning no change in size).
blending% - if any value except 0, ‘font blending’ will be implemented (if Font Manager version supports this).
PROCwimp_plottexth(t$,font%,align%,x%,y%,fr%,fg%,fb%,br%,bg%,bb-%,scalex,scaley,blending%)
Plots text directly to screen, using font specified by font handle, with choices of colour, alignment and scaling.
t$ = string to plot.
font% = handle of font.
align% = if 0, text is left-aligned at x%/y%; if 1, text is centred on x%/y%: if 2, text is right aligned to x%/y%.
x%,y% = screen coordinates (OS units) to plot the text at (y% value is bottom of text)
fr%,fg%,fb% = foreground colour red, green and blue amounts in range 0-255.
br%,bg%,bb% = background colour red, green and blue amounts in range 0-255.
scalex,scaley = respectively, required scaling factors in x and y directions. Values <1 reduce displayed size; values >1 increase size.
(1 meaning no change in size).
blending% - if any value except 0, ‘font blending’ will be implemented (if Font Manager version supports this).
PROCwimp_plotwindowtext(window%,t$,f$,sizex,sizey,align%,x%,y%,fr-%,fg%,fb%,br%,bg%,bb%,minx%,miny%,maxx%,maxy%,scalex,scaley,bl-ending%)
Plots text in a window, using string-specified font at specified x/y point sizes, scaled and with choice of colours and alignment.
window% = handle of window to plot in.
t$ = string to plot.
f$ = name of font to use, period separated e.g. “Trinity.Medium”. (If font cannot be found then “Trinity.Medium” is automatically substituted.)
sizex = point size in horizontal direction.
sizey = point size in vertical direction.
align% = if 0, text is left-aligned at x%/y%; if 1, text is centred on x%/y%: if 2, text is right aligned to x%/y%.
x%,y% = work area coordinates (OS units) to plot text at. (y% value is bottom of text)
fr%,fg%,fb% = foreground colour red, green and blue amounts in the range 0-255.
br%,bg%,bb% = background colour red, green and blue amounts in the range 0-255.
minx%,miny% = coordinates (OS units) of bottom left corner of clipping rectangle.
maxx%,maxy% = coordinates (OS units) of top right corner of clipping
rectangle.
(Clipping rectangle is the same as that passed to PROCuser_redraw.)
scalex,scaley = respectively, required scaling factors in x and y directions. Values <1 reduce displayed size; values >1 increase size.
(1 meaning no change in size).
blending% - if any value except 0, ‘font blending’ will be implemented (if Font Manager version supports this).
PROCwimp_plotwindowtexth(window%,t$,font%,align%,x%,y%,fr%,fg%,-fb%,br%,bg%,bb%,minx%,miny%,maxx%,maxy%,scalex,scaley,blending-%)
Plots text in a window, using font specified by font handle.
window% = handle of window to plot in.
t$ = string to plot.
font% = handle of font to use.
align% = if 0, text is left-aligned at x%/y%; if 1, text is centred on x%/y%: if 2, text is right aligned to x%/y%.
x%,y% = work area coordinates (OS units) to plot text at. (y% value is bottom of text)
fr%,fg%,fb% = foreground colour red, green and blue amounts in the range 0-255.
br%,bg%,bb% = background colour red, green and blue amounts in the range 0-255.
minx%,miny% = coordinates (OS units) of bottom left corner of clipping rectangle.
maxx%,maxy% = coordinates (OS units) of top right corner of clipping
rectangle.
(Clipping rectangle is the same as that passed to PROCuser_redraw.)
scalex,scaley = respectively, required scaling factors in x and y directions. Values <1 reduce displayed size; values >1 increase size.
(1 meaning no change in size).
blending% - if any value except 0, ‘font blending’ will be implemented (if Font Manager version supports this).
PROCwimp_deskplottext(t$,align%,x%,y%,fr%,fg%,fb%,br%,bg%,bb%)
Plots text directly to screen, using the current desktop font. Requires RISC OS 3.50 or higher.
t$ = string to plot.
align% = if 0, text is left-aligned at x%/y%; if 1, text is centred on x%/y%: if 2, text is right aligned to x%/y%.
x%,y% = screen coordinates (OS units) to plot the text at. (y% value is bottom of text)
fr%,fg%,fb% = foreground colour red, green and blue amounts in range 0-255.
br%,bg%,bb% = background colour red, green and blue amounts in range 0-255.
PROCwimp_deskplotwindowtext(window%,t$,align%,x%,y%,fr%,fg%,fb-%,br%,bg%,bb%,minx%,miny%,maxx%,maxy%)
Plots text in a window, using the current desktop font. Requires RISC OS 3.50 or higher.
window% = handle of window to plot in.
t$ = string to plot.
align% = if 0, text is left-aligned at x%/y%; if 1, text is centred on x%/y%: if 2, text is right aligned to x%/y%.
x%,y% = work coordinates (OS units) to plot the text at. (y% value is bottom of text)
fr%,fg%,fb% = foreground colour red, green and blue amounts in range 0-255.
br%,bg%,bb% = background colour red, green and blue amounts in range 0-255.
minx%,miny% = coordinates (OS units) of bottom left corner of clipping rectangle in screen coordinates.
maxx%,maxy% = coordinates (OS units) of top right corner of clipping
rectangle in screen coordinates.
(Clipping rectangle is the same as that passed to PROCuser_redraw.)
FNwimp_fontcolour(fr%,fg%,fb%,br%,bg%,bb%)
Returns control codes in a string to change the current outline font colour. Useful for using in the middle of a string of outline font text being plotted.
fr%,fg%,fb% = red, green and blue components respectively of the foreground colour, in the range 0-255.
br%,bg%,bb% = red, green and blue components respectively of the background (anti-alias) colour, in the range 0-255.
FNwimp_fontunderline(on%)
Returns control codes in a string to turn underlining on or off.
Useful for using in the middle of a string of outline font text being plotted.
If on%=0 turns underlining off.
If on%=1 turns underlining on.
FNwimp_fontchangeh(font%)
Returns control codes in a string to change the current outline font.
Useful for using in the middle of a string of outline font text being plotted.
font% = handle of font to change to.
PROCwimp_calcredrawlines()
NOT IN DrWimp LIBRARY.
ONLY USED AS PART OF ‘Elixir_01’ for fast scrolling of long text lists - see Manual Section 2.36 and 3.16.
Needs to be used with PROCuser_redrawtextline()
Top of page Back to Contents Previous Next