Skip to main content
Version: 20 R7 BETA

WP Is font style supported

WP Is font style supported ( targetObj ; wpFontStyle ) -> Function result

ParameterTypeDescription
targetObjObjectRange or element
wpFontStyleLongintFont style constant
Function resultBooleanTrue if any part of targetObj supports wpFontStyle; False otherwise

Description

The WP Is font style supported command returns True if the wpFontStyle style is supported by any part of the text in rangeObj.

In targetObj, you can pass:

  • a range, or
  • an element (table / row / paragraph / inline picture / body / header / footer)

In wpFontStyle, pass one of the following style constants from the "4D Write Pro" constant theme:

ConstantTypeValueComment
wk font boldStringfontBoldSpecifies thickness of text (depends on available font styles). Possible values:
wk true to set selected characters to bold font style; with the WP GET ATTRIBUTES command, wk true is returned if at least one selected character supports a bold font style.wk false (default) to remove the bold font style from selected characters if any; with the WP GET ATTRIBUTES command, wk false is returned if none of the selected characters supports a bold font style.
wk font italicStringfontItalicSpecifies italic style of text (depends on available font styles). Possible values:
wk true to set selected characters to italic or oblique font style; with the WP GET ATTRIBUTES command, wk true is returned if at least one selected character supports an italic or oblique font style.wk false (default) to remove the italic or oblique font style from selected characters if any; with the WP GET ATTRIBUTES command, wk false is returned if none of the selected characters supports an italic or oblique font style.
wk text linethrough styleStringtextLinethroughStyleSpecifies style of text linethrough (if any). Possible values:
wk none (default): no linethrough effectwk solid: draw a solid line on the selected textwk dotted: draw a dotted line on the selected textwk dashed: draw a dashed line on the selected textwk double: draw a double line on the selected textwk semi transparent: dimmed line on the selected text. Can be combined with another line style.wk word: draw a line on words only (exclude blank spaces). Can be combined with another line style.
wk text underline styleStringtextUnderlineStyleSpecifies style of text underline (if any). Possible values:
wk none (default): no underlinewk solid: draw a solid underlinewk dotted: draw a dotted underlinewk dashed: draw a dashed underlinewk double: draw a double underlinewk semi transparent: dimmed underline. Can be combined with another line style.wk word: draw an underline for words only (exclude blank spaces). Can be combined with another line style.

Typically, this command is provided to allow developers to implement custom interface objects, such as a pop-up menu offering style options based on the selected text.