4D v16

WP Is font style supported

Home

 
4D v16
WP Is font style supported

WP Is font style supported 


 

WP Is font style supported ( rangeObj ; wpFontStyle ) -> Function result 
Parameter Type   Description
rangeObj  Object in Range object to parse
wpFontStyle  Longint in Font style constant: wk font bold, wk font italic, wk text underline style, wk text linethrough style
Function result  Boolean in True if any part of range supports wpFontStyle; False otherwise

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

In rangeObj, pass a valid 4D Write Pro range object. A rangeObj is a part of a 4D Write Pro document; it can be created by the or WP Get range command, or WP Get paragraphs / WP Get pictures.

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

Constant Type Value Comment
wk font bold String fontBold Specifies 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 italic String fontItalic Specifies 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 style String textLinethroughStyle Specifies style of text linethrough (if any). Possible values:
  • wk none (default): no linethrough effect
  • wk solid: draw a solid line on the selected text
  • wk dotted: draw a dotted line on the selected text
  • wk dashed: draw a dashed line on the selected text
  • wk double: draw a double line on the selected text
  • wk 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 style String textUnderlineStyle Specifies style of text underline (if any). Possible values:
  • wk none (default): no underline
  • wk solid: draw a solid underline
  • wk dotted: draw a dotted underline
  • wk dashed: draw a dashed underline
  • wk double: draw a double underline
  • wk 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.

 
PROPERTIES 

Product: 4D
Theme: 4D Write Pro Language

This command can be run in preemptive processes

 
HISTORY 

Created: 4D v15 R4

 
ARTICLE USAGE

4D Write Pro Reference ( 4D v16)