Reads the current font parameters returned by GetFont Command.
RFont name var [, name var, …]
name:font attribute name
var:variable
This command is the opposite of the Font Command. It allows the current font parameters or the ones returned by GetFont to be read. The following alternatives are allowed:
RFont CharSet c|
RFont ClipPrecision c|
RFont Escapement c%
RFont Family c|
RFont Height c%
RFont Italic c|
RFont Name c$
RFont Orientation c%
RFont OutPrecision c|
RFont Pitch c|
RFont Quality c|
RFont StrikeOut c|
RFont Underline c|
RFont Weight c%
RFont Width c%
c|:Byte variable
c%:Integer variable
c$:String variable
For example, RFont Italic a| returns the Italic value for the font. You can use the same parameters as for the Font command, of course, followed by a variable after the keyword e.g. ITALIC. Instead of specifying a string variable for the name you can also use addr%. Char{addr%} will then read the name.
The preferred way to handle fonts in Forms and Ocx controls is by using the Font property of the objects.
OpenW 1
Local a%, fnt_b%, fnt_i%, fnt_s%
Local fnt_u%, h&, org%, p$, p%, w&
org% = OEM_FIXED_FONT
'org% = SYSTEM_FONT
SetFont org%
GetFont org%
RFont Name p$ //Font Name
Font Italic 1
Font To fnt_i%
Font Underline 1, Italic 0
Font To fnt_u%
Font Underline 0
RFont Height h&, Width w&
Font Height h& / 4, Width w& / 4
Font To fnt_s%
Font Height h& * 7, Width w& * 7
Font To fnt_b%
Print p$; " font"; //Print example
SetFont fnt_i%
Print p$; " font italic ";
SetFont fnt_u%
Print p$; " font underline";
SetFont fnt_s%
Print p$; " font small"
SetFont fnt_b%
Print p$; " font big";
SetFont SYSTEM_FONT
FreeFont fnt_i%
FreeFont fnt_u%
FreeFont fnt_s%
FreeFont fnt_b%
Internally, GFA-BASIC 32 maintains a LOGFONT structure which is filled using the Font command and read with RFont. The internal LOGFONT contains the values for the font of the current Form. The members of the LOGFONT reflect the settings of the Font object of the Form. After changing a Font property (FontItalic = True), the LOGFONT is updated to reflect the new settings.
The current LOGFONT settings can be saved using logfont$ = _font$ and later reselected using _font$ = logfont$. The Font object of the Form is then updated with the saved font settings.
Font, Font To, SetFont, GetFont, RFont, Dlg Font, _hFont, _font$, _font$=, FreeFont, DelFont
{Created by Sjouke Hamstra; Last updated: 22/10/2014 by James Gaite}