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.00 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.
h Height of the print region, in inches.
align

Method of formatting the text, as a decimal integer.

Note:

The align parameter must be a decimal integer, so use the DEC() function for any combination of the values below.

Value Description
$0001$ CENTER: Centers text horizontally.
$0002$ RIGHT: Right-aligns text.
$0004$ VCENTER: Centers text vertically. This value must be combined with SINGLELINE.
$0008$ BOTTOM: Justifies the text to the bottom. This value must be combined with SINGLELINE.
$0010$ WORDBREAK: Breaks lines between words that extend past the edge of the rectangle specified in the x, y, w, and h parameters.
$0020$ SINGLELINE: Displays text on a single line only. Carriage returns and linefeeds do not break the line.
$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.
$xx80$ TABSTOP: Indicates that a custom tabstop is defined in the high order byte. For example, DEC$(0480$) specifies 4 characters per tab.
$0100$ NOCLIP: Draws without clipping. Using this setting reduces processing time. It cannot be used with the TABSTOP value.
$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.
$1000$ NOSCALE: Do not scale embedded fonts specified with the 'FONT' mnemonic (BBj only). Cannot be used with the TABSTOP value.
text$ Text to be formatted. Can include embedded formatting mnemonics (see below)

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'(xy) 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'(rgb) Sets text color to the specified color.
'FONT'("name"[,size]) Sets the specified font. The cpi parameter, if specified, is ignored.

Note:

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

OPEN (1,MODE="PREVIEW")"LP"
PRINT (1)'FONT'("Times New Roman",8,24),
LET TEXT$='BB'+"BASIS International Ltd."+'EB'+'LF'
LET TEXT$=TEXT$+'GREEN'+"5901 Jefferson Street NE"+'LF'
LET TEXT$=TEXT$+"Albuquerque, NM 87109-3432"+'LF'
LET TEXT$=TEXT$+'BLUE'+'CP'+"Telephone: "+'BB'+"+1 505 345-5232"+'EB'+'LF'
LET TEXT$=TEXT$+"Facsimile: "+'BB'+"+1 505 345 5082"+'EB'+'LF'
LET TEXT$=TEXT$+"Email: "+'BB'+"info@basis.cloud"+'EB'+'LF'
LET TEXT$=TEXT$+"WWW: "+'BB'+'BU'+"https://www.basis.cloud"+'EB'+'EU'
PRINT (1)TEXT$
PRINT (1)'FONT'("Times New Roman",8,24),'BLACK',
PRINT (1)'FMTTEXT'(.25,4,5,3,0,TEXT$)
END

See Also

Mnemonics - Alphabetical Listing

Mnemonics - Group Listing