FormatText

Navigation:  Appendices > Macro Language > Built-in Functions > All Functions (Alphabetical) >

FormatText

Previous pageReturn to chapter overviewNext page

str = FormatText(sTextIn, sFormat, n32bitColor)

 

This macro function return sTextIn with markers that identify it to be formatted by Q++ during diary generation according to the formatting string sFormat. Some important remarks:

 

sTextIn

This can be any text, even text that is the result of a previous call to the function FormatText (see the section on result, below, for more details). That is to say, formatting can be nested.

sFormat

Each specifier (see list in table below) is separated from the next by a comma (no space). Any value which can be specified in decimal form must use a period as decimal separator, regardless of the workstation's Windows settings. A sample sFormat would be:

 

B+,I+,f Times New Roman

n32bitColor

This is the 32-bit value that uniquely represents any of the colors defined in the current GridTemplate. To find that value for any of the colors of a particular grid, see the Template Properties dialog.

result

The text result of this function will not be formatted text (yet), but rather, plain text with markers that identify it for Q++ processing later. For example, the result of a call to the present function may give:

 

**RICH12**New Year**TEXT12**

 

Note that you can change the text inside the markers (New Year, in the above example) but the markers themselves should not be changed. If you need to get the plain text, without the markers, you can use the PlainTextOf function.

 

The list of the various formats supported by this function, and the codes to use are shown below.

 

Keyword

Example

Description

 

B

 

B+ or B-

 

Add/remove Bold

I

I+ or I-

Add/remove Italic

UL

UL+ or UL-

Add/remove Underline

O

O+ or O-

Add/remove Outline

SHD

SHD+ or SHD-

Add/remove Shadow

SUP

SUP+ or SUP-

Add/remove Superscript

SUB

SUB+ or SUB-

Add/remove Subscript

NONB

NONB+ or NONB-

Add/remove Non Breaking

SPR

SPR+ or SPR-

Add/remove Superior

STRK

STRK+ or STRK-

Add/remove Strike Thru

ALLC

ALLC+ or ALLC-

Add/remove All Caps

SCAP

SCAP+ or SCAP-

Add/remove Small Caps

WUL

WUL+ or WUL-

Add/remove Word Underline

f

f Arial

Font Name

s

s 8.5

Font Size

hs

hs 100

Horizontal Scale

sh

sh 30

Shade (decimal 0 to 100)

k

k -5.0

Kerning

t

t 12.5

Tracking

bs

bs 10.5

Baseline Shift

vs

vs 90

Vertical Scale (0 to 100)

 

Note that this is an advanced function and that error checking is minimal. For example, you will get no warning if sFormat contains the same attributes repeated with a different values (eg. f Arial and f Garamond) or with inherently conflicting different attributes (eg: hs90,vs75).


Topic 177845 updated on 22-Sep-2005.
Topic URL: http://www.qppstudio.net/webhelp/index.html?formattext.htm