FMTTEXT Mnemonic - Insert Formatted Text into SYSPRINT Device
BBj-Specific Information
For this topic's original documentation, see the FMTTEXT Mnemonic - Insert Formatted Text into SYSPRINT Device.
Syntax
'FMTTEXT'(x,y,w,h,align),text$
'FMTTEXT'(x,y,w,h,align)+text$
'FMTTEXT'(x,y,w,h,align,text$)
Description
In BBj 6.0 and higher, the 'FMTTEXT' mnemonic inserts the formatted contents of text$ in the SYSPRINT device.
Parameter |
Description |
x |
Horizontal location of the upper left corner of the print region, in inches. |
y |
Vertical location of the upper left corner of the print region, in inches. |
w |
Width of the print region, in inches. |
align |
Method of formatting the text. It can be any combination of the values contained in the table below. |
h |
Height of the print region, in inches. |
text$ |
Text to be formatted. Can include embedded formatting mnemonics (see below) |
Settings for the align Parameter
The following table identifies the settings for the align parameter:
Value |
Name |
Description |
DEC($0001$) |
CENTER |
Centers text horizontally. |
DEC($0002$) |
RIGHT |
Right-aligns text. |
DEC($0004$) |
VCENTER |
Centers text vertically. This value must be combined with SINGLELINE. |
DEC($0008$) |
BOTTOM |
Justifies the text to the bottom. This value must be combined with SINGLELINE. |
DEC($0010$) |
WORDBREAK |
Breaks lines between words that extend past the edge of the rectangle specified in the x, y, w, h parameters. |
DEC($0020$) |
SINGLELINE |
Displays text on a single line only. Carriage returns and linefeeds do not break the line. |
DEC($0040$) |
EXPANDTABS |
Expands tab characters (converts any embedded $09$ characters in the text to one or more spaces). The default number of space characters per tab is 8 unless the TABSTOP value is also used. |
DEC($xx80$) |
TABSTOP |
Indicates that a custom tabstop is defined in the high order byte. For example, DEC$(0480$) specifies 4 characters per tab. |
DEC($0100$) |
NOCLIP |
Draws without clipping. Using this setting reduces processing time. It cannot be used with the TABSTOP value. |
DEC($0200$) |
EXTERNALLEADING |
Includes the font external leading in line height. Normally, external leading is not included in the height of a line of text. Cannot be used with the TABSTOP value. |
DEC($1000$) |
NOSCALE |
Do not scale embedded fonts specified with the 'FONT' mnemonic (BBj only). Cannot be used with the TABSTOP value. |
Embedded Formatting Mnemonics
The table below lists the SYSPRINT mnemonics that can be embedded in the text$ parameter for additional control of formatting.
NOTE: Embedded formatting mnemonics are only supported with this version of the 'FMTTEXT' mnemonic: 'FMTTEXT'(x,y,w,h,align,text$)
Mnemonic |
Description |
'BB' |
Adds the BOLD attribute to the current font. |
'EB' |
Clears the BOLD attribute from the current font. |
'BU' |
Begin Underline. |
'EU' |
End Underline. |
'SP' |
Standard print, equivalent to 'SCALE'(1,1). |
'CP' |
Compressed print, equivalent to 'SCALE'(0.5,1). |
'EP' |
Expanded print, equivalent to 'SCALE'(2,2). |
'SCALE'(x,y) |
Scales the current font by the specified x and y values. |
'BLACK' |
Sets text color to black. |
'BLUE' |
Sets text color to blue. |
'GREEN' |
Sets text color to green. |
'CYAN' |
Sets text color to cyan. |
'RED' |
Sets text color to red. |
'MAGENTA' |
Sets text color to magenta. |
'YELLOW' |
Sets text color to yellow. |
'WHITE' |
Sets text color to white. |
'GRAY' |
Sets text color to gray. |
'RGB'(r,g,b) |
Sets text color to the specified color. |
'FONT'("name"[,size]) |
Sets the specified font. The cpi parameter, if specified, is ignored. Note that fonts embedded in 'FMTTEXT' are scaled according to different rules than fonts emitted directly to the SYSPRINT device. |
'LF' |
Inserts a line feed, equivalent to embedded $0a$ in the text. |
Example
0010 OPEN (1,MODE="PREVIEW")"LP"
0020 PRINT (1)'FONT'("Times New Roman",8,24),
0030 LET TEXT$='BB'+"BASIS International Ltd."+'EB'+'LF'
0040 LET TEXT$=TEXT$+'GREEN'+"5901 Jefferson Street NE"+'LF'
0050 LET TEXT$=TEXT$+"Albuquerque, NM 87109-3432"+'LF'
0060 LET TEXT$=TEXT$+'BLUE'+'CP'+"Telephone: "+'BB'+"+1
505 345-5232"+'EB'+'LF'
0070 LET TEXT$=TEXT$+"Facsimile: "+'BB'+"+1 505 345 5082"+'EB'+'LF'
0080 LET TEXT$=TEXT$+"Email: "+'BB'+"info@basis.cloud"+'EB'+'LF'
0090 LET TEXT$=TEXT$+"WWW: "+'BB'+'BU'+"https://www.basis.cloud"+'EB'+'EU'
0100 PRINT (1)TEXT$
0110 PRINT (1)'FONT'("Times New Roman",8,24),'BLACK',
0120 PRINT (1)'FMTTEXT'(.25,4,5,3,0,TEXT$)
0130 END