Database Reference
In-Depth Information
TextSize()
The TextSize() function is simple in every case. Just pass some text and the point size
you'd like (just like the sizes in the Format→Size menu in Browse mode). FileMaker returns
the resized text.
Textstyleadd() and Textstyleremove()
Changing text styles (bold, italic, and so on) is a little more complicated. After all, a piece of
text can have only one color, one font, or one size, but it can be bold, italic, and underlined
all at the same time. With text styles, you don't just swap one style for another; you need to
do things like take italic text and add bold formatting or even take bold-titlecase-
strikethrough text and un-strikethrough it, leaving everything else in place.
To solve these problems, FileMaker gives you two functions for dealing with style: Tex-
tStyleAdd() and TextStyleRemove() . You use the first to add a style to a piece of text:
"Do it with " & TextStyleAdd ( "style" ; Italic )
Likewise, the TextStyleRemove() function removes the specified style from the text.
TextStyleRemove ( My Text Field ; Italic )
The text style parameter goes in the calculation without quotes, just like the examples above.
You can use any and every text style in FileMaker: P lain, Bold, Italic, Underline,
Condense, Extend, Strikethrough, SmallCaps, Superscript, Subscript, Upper-
case, Lowercase, Titlecase, WordUnderline , and DoubleUnderline . And then there's
AllStyles . When you use the AllStyles parameter, it adds (or removes) all existing styles.
With these two functions and all these style options, you can do any kind of fancy formatting
footwork imaginable. Here are some guidelines:
▪ When you add a style to some text by using TextStyleAdd() , it doesn't change any
style that you've already applied. The new style is simply layered over the existing
styles.
Plain style is the notable exception to the above point. Adding Plain style effectively
removes any other styling. This style comes in handy when you need to remove a mess
of styling and apply something simpler. Say your fields contain the words “Past Due,”
styled in uppercase, bold, italic, and double underlined, and you decide that modest italic
would work just fine. Nesting the TextStyleAdd() function with the Plain parameter
does the trick:
TextStyleAdd ( TextStyleAdd ( "past due" ; Plain ) ; Italic )
Search WWH ::




Custom Search