[<<Previous Entry]
[^^Up^^]
[Next Entry>>]
[Menu]
[About The Guide]
R_FntStr()
Install an external EGA or VGA font from a string
------------------------------------------------------------------------------
Syntax
nRetCode := R_FntStr ( cFontData [, cFontName] )
Arguments
cFontData String with the font data.
The format is the same as from a font file.
The string length should be :
3584 bytes for EGA fonts
4096 bytes for VGA fonts
cFontName Name of the font
Default : 'Font loaded from string'
The name can be retrieved using
the R_FntName () function.
Returns
nRetCode Return code
0 - FL_OKAY No errors detected
1 - FL_INVALID_PARMS Invalid parameters passed
N.B. the return codes are pre-defined in the header
file RFntLib.CH
Description
With the function R_FntStr () you can load and install an EXTERNAL
font from a font file.
The function is very usefull for building font utility programs.
+----------------------------------------------------------------+
| -+- CAUTION -+- |
| |
| IN THE UN-REGISTERED VERSION OF RFNTLIB THE FOLLOWING |
| REGISTRATION MESSAGE WILL BE DISPLAYED AT RANDOM TIMES |
| (WHILE EXECUTING THE R_FNTSTR FUNCTION) : |
| |
| Unregistered version of RFntLib - Wait for 8 seconds. |
| |
| AFTER A 8 SECONDS DELAY THE PROGRAM WILL CONTINUE. |
+----------------------------------------------------------------+
Example
*-- Convert a VGA font file to EGA format
*-- This is done by deleting the last two scan lines
LOCAL nVGAHandle := FOpen ( 'FONT.RFV' ) && Open VGA font
LOCAL nEGAHandle := FCreate ( 'FONT.RFE' ) && Create EGA font
LOCAL cBuffer := Space ( 4096 ) && Buffer
LOCAL i
FRead ( nVGAHandle, @cBuffer, 4096 )
FOR i := 1 TO 256
*-- Character loop
FWrite ( nEGAHandle, Substr ( cBuffer, (i-1)*16 + 1, 16 ), 14 )
NEXT
FClose ( nVGAHandle )
FClose ( nEGAHandle )
*-- Install the newly created EGA font
R_FntStr ( cBuffer, 'Converted EGA-font' )
See Also:
R_FntFile()
Registration
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson