Legato
Legato

GoFiler Legato Script Reference

 

Legato v 1.4j

Application v 5.22b

  

 

Chapter ElevenSGML Functions (continued)

HTMLStyleGetProperties Function

Overview

The HTMLStyleGetProperties function returns the style properties for the current buffer or part of the buffer.

Syntax/Parameters

Syntax

string[] = HTMLStyleGetProperties ( handle hStyle, [int start], [int end] );

Parameters

hStyle

A handle to an HTML Style Object.

start

An optional int specifying the zero-based position to start rendering from. If omitted, the default value is -1 (same as zero starting from the beginning).

end

An optional int specifying the zero-based position to start rendering from. If omitted, the default value is -1, indicating to return data to the end of the buffer, or if start is provided, this at the start position.

Return Value

A string array containing the style properties or an empty array on failure. Use the GetLastError function to retrieve a formatted error code.

Remarks

The function looks at each character position within the styled text and returns an aggregate of the style data. Note that the tags that lead to the text being styled are not part of the text buffer and do not count toward the position. For example, the following text is added:

The is <b>bold</b> text.

It is internally as represented as:

The is bold text.

Therefore, the start position of ‘b’ is 7.

The returned string array uses lower case versions of the CSS property names as key names.

  font-family    Font name.  
  font-size   Size as specified.  
  font-weight    Weight, including the <b> tag.  
  font-stretch    Stretch keyword.  
  font-style    Style as normal or italic, including the <i> tag.  
  font-variant    Small caps.  
  text-decoration-line    Type of line on text, including underline including <u> tag.  
  text-decoration-color    Line color.  
  text-decoration-style Line style. Conflicts with text-underline-style.  
  text-transform    Capital, lower and upper case.  
  text-underline-style    Underline style (note, as part of CSS, this conflicts with text-decoration-style but included for compatibility).  
  color    Text color.  
  letter-spacing    Letter spacing.  
  line-height    Line height.  
  vertical-align    Vertical align.  
  word-spacing    Word spacing.  
  background-color    Background color.  

 

If an item is not set, the element’s value is an empty string. If there are conflicting style states with the range of the buffer, the element will have the term, “(mixed)”, in the key array position.

The start and end positions must be range within the end of the text buffer (not the coded area). If only the start position is supplied, then the function will return a snapshot of that x position within the buffer.

Related Functions

Platform Support

Go13, Go16, GoFiler Complete, GoFiler Corporate, GoFiler, GoFiler Lite, GoXBRL

Legato IDE, Legato Basic