Topics   All   MacOS (Only)   Windows (Only)   Linux (Only, Not)   iOS (Only, Not)  
Components   Crossplatform Mac & Win   Server   Client   Old   Deprecated   Guides   Examples   Videos
New in version: 10.5   11.0   11.1   11.2   11.3   11.4   11.5   12.0   12.1   12.2    Statistic    FMM    Blog  

Text.Styles

Queries style information as JSON.

Component Version macOS Windows Linux Server iOS SDK License
Text 9.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes ✅ Yes Paid
MBS( "Text.Styles"; Text )   More

Parameters

Parameter Description Example
Text The styled text to check. "Hello World"

Result

Returns JSON or error.

Description

Queries style information as JSON.
Returns a JSON array with objects containing details.
Includes booleans hasColor, hasFont, hasSize and hasFace to inform you which features are available for text block.

If hasColor is true, you can get color (numeric), colorHex (string) and values in range 0 to 255 for red, blue, green and alpha.
If hasFont is true, you can get fontID, fontScript and font with the name.
If hasSize is true, the size field contains the size of the font in points.
If hasFace is true, you get the face as integer. We also provide bold, italic, underline, outline, shadow, condense, extend, strikethrough, smallCaps, superscript, subscript, wordUnderline and doubleUnderline as booleans.

See also Text.FromStyles function to do the reverse.

Examples

Check some text:

MBS("Text.Styles"; TextColor ( "Hello" ; RGB ( 255 ; 0 ; 0 ) ))

Example result:
[{
    "hasColor":   true,
    "color":   16711680,
    "colorHex":   "FF0000",
    "red":   255,
    "green":   0,
    "blue":   0,
    "alpha":   255,
    "hasFont":   false,
    "hasSize":   false,
    "hasFace":   false
  }]

See also

Release notes

Example Databases

Blog Entries

Created 9th July 2019, last changed 22nd June 2021


Text.SoundExGerman - Text.TextToHTML

Feedback: Report problem or ask question.


Start Chat