Texts

Texts are to be placed in double quotes and may contain any Unicode characters. Entering Unicode font names is also supported. Furthermore, it is possible to specify non-integer font sizes. For example:

AddText(100;​100;​"国字";​ヒラギノ明朝Pro W6;​12.5)

 
Example
EXAMPLE_01
1

OpenDrawing(200;​230)

2

AddText(10;​ 20;​"Hello World (English)";​Arial;​14;​plain;​40 40 40)

3

AddText(10;​ 45;​"مرحبا العالم (Arabic)";​Tahoma;​14;​plain;​40 40 40)

4

AddText(10;​ 70;​"你好世界 (Chinese)";​黑體-繁;​14;​plain;​40 40 40)

5

AddText(10;​ 95;​"Γεια σας κόσμο (Greek)";​Arial;​14;​plain;​40 40 40)

6

AddText(10;​120;​"안녕하세요 세계 (Hangul)";​애플명조;​14;​plain;​40 40 40)

7

AddText(10;​145;​"שלום עולם (Hebrew)";​Microsoft Sans Serif;​14;​plain;​40 40 40)

8

AddText(10;​170;​"こんにちは世界 (Japanese)";​ヒラギノ角ゴ Pro W3;​14;​plain;​40 40 40)

9

AddText(10;​195;​"Привет мир (Russian)";​Verdana;​14;​plain;​40 40 40)

10

AddText(10;​220;​"สวัสดีชาวโลก (Thai)";​Tahoma;​14;​plain;​40 40 40)

11

CloseDrawing()

EXAMPLE_01

Special Characters

The backslash (\) can be used to insert new lines, double quotes, and other special characters into a string. Character combinations consisting of a backslash followed by a letter or by a combination of digits are called escape sequences. xmCHART supports the following escape sequences:

\n ........... Newline

\r ........... Carriage return

\t ........... Horizontal tab

\\ ........... Backslash

\" ........... Double quote

\x<hh> ........UTF-8 encoded escape sequence (hexadecimal).

For example, to output double quotes you must place a backslash before each double quote. Example:

TitleText("Company \"Universal Exports\"") /* Output: Company "Universal Exports" */

Texts may also have several lines. For example:

TitleText("Chart 1\nOverview\nLine 3") /* \n...line break */

Unicode code points can be entered as an UTF-8 encoded escape sequence formed by a series of two hexadecimal digits prefixed by the \x character. For example, the Unicode character 'Thin Space' (U+2009) can be represented in xmCHART with the following sequence: \xE2\x80\x89

AddText(15;40;"Some text\xE2\x80\x89some text";​Arial;​12;​plain)

For Unicode code points and their UTF-8 encoding please refer, for example, to:

https://www.fileformat.info/info/unicode/index.htm

Not all fonts have all Unicode characters; in fact most have only a small fraction. Also — the unofficial but widely used — private-use characters may not be available on all operating systems or are displayed differently.
 
Examples
EXAMPLE_02
1

OpenDrawing(380;​60)

2

AddText(10;​40;​"✍ ‰ ♬ ⌘ ♻ ✘ ✔ g̈";​Arial;​25;​;​steelBlue)

3

CloseDrawing()

EXAMPLE_02
EXAMPLE_03
1

OpenDrawing(380;​60)

2

AddText(10;​40;​"हैलो 🔎 🔒 📎 🇨🇷 👤 💬 🕗";​Arial;​25;​;​steelBlue)

3

CloseDrawing()

EXAMPLE_03
EXAMPLE_04
1

OpenDrawing(380;​60)

2

AddText(10;​40;​"🌏 🎓 🎶 🖥 📒 📌 🛒 🚫 🈸";​Arial;​25;​;​steelBlue)

3

CloseDrawing()

EXAMPLE_04
EXAMPLE_05
1

OpenDrawing(380;​60)

2

AddText(10;​40;​"🇪🇺 🇨🇦 🏴󠁧󠁢󠁳󠁣󠁴󠁿 🎨 🙂 👨‍👩‍👧‍👦 👩🏽‍💻";​Arial;​25;​;​steelBlue)

3

CloseDrawing()

EXAMPLE_05
 

Styled Texts

In xmCHART 5 the style of any portion of text inside a text element can be changed by embedding that portion inside a <span> tag or other simple HTML tag from the following list:

"...<span key/value list of attributes> styled text </span>..."

"...<b> text in bold style </b>..."

"...<i> text in italic style </i>..."

"...<u> text in underline style </u>..."

 
Example
EXAMPLE_06
1

OpenDrawing(300;​30)

2

AddText(10;​20;​"Plain text <b><i>text bold+italic</i></b> plain text.";​Arial;​12)

3

CloseDrawing()

EXAMPLE_06

The following five <span> tag attributes are available: font, size, shiftY, color, backgroundColor. For example:

AddText(10;​10;​"...<span font='Times New Roman'>Some text</span>...")

AddText(10;​10;​"...<span font=Verdana>Some text</span>...")

AddText(10;​10;​"...<span color='rgb255 (100,150,0)'>Some text</span>...")

AddText(10;​10;​"...<span color=rgba255(100,150,0,200)>Some text</span>...")

AddText(10;​10;​"...<span color=#080>Some text</span>...")

AddText(10;​10;​"...<span color=#4682B477>Some text</span>...")

Please note that attribute values containing white space, e.g. "...<span font='Times New Roman'>..." must be placed in single quotes.

 
Example
EXAMPLE_07
1

OpenDrawing(300;​155)

2

AddText(10;​20;​"<span size=18>P</span>lain text <b><i><u>text bold+italic</u></i></b> plain text.";​Arial;​12)

3

AddText(10;​45;​"Mixing <span font=Verdana><i>sans serif</i></span> with <span font='Times New Roman' size=15><i>serif</i></span> style.";​Arial;​12)

4

AddText(10;​70;​"H<span size=8 shiftY=4>2</span>O";​Arial;​12) /* H₂O */

5

AddText(10;​95;​"x<span size=8 shiftY=-4>3</span>";​Arial;​12) /* x³ */

6

AddText(10;​120;​"Plain text <span color=red><b><i>text in red bold+italic</i></b></span> plain text.";​Arial;​12)

7

AddText(10;​145;​"Plain text <span backgroundColor=rgba255(255,255,0,100)>text with light yellow background</span> plain text.";​Arial;​12)

8

CloseDrawing()

EXAMPLE_07
 

Custom Line Spacing

In xmCHART 5 the line height of a text can be controlled by adding a line increment factor to the argument textHeightMax. The argument textHeightMax is available in all text-related functions such as AddText(), LabelStyle(), TitleStyle(), LegendStyle(), AxisLabelStyle(), TagText() etc. A factor < 0 squeezes the text together, a factor > 0 stretches the lines. The factor can be entered absolute in pixels or relative in % of the line height.

 
Example
EXAMPLE_08
1

OpenDrawing(390;​310)

2

AddText(10;​20;​"On the other hand, we denounce with righteous indignation and dislike men who are so beguiled and demoralized by the charms of pleasure of the moment, so blinded by desire, that they cannot foresee the pain and trouble that are bound to ensue; and equal blame belongs to those who fail in their duty through weakness of will, which is the same as saying through shrinking from toil and pain. These cases are perfectly simple and easy to distinguish.";​

3

Verdana;​10;​plain;​teal;​;​;​0;​110;​-1 -2) /* -2...Line height reduced by 2 pixels. */

4

AddText(140;​20;​"On the other hand, we denounce with righteous indignation and dislike men who are so beguiled and demoralized by the charms of pleasure of the moment, so blinded by desire, that they cannot foresee the pain and trouble that are bound to ensue; and equal blame belongs to those who fail in their duty through weakness of will, which is the same as saying through shrinking from toil and pain. These cases are perfectly simple and easy to distinguish.";​

5

Verdana;​10;​plain;​teal;​;​;​0;​110;​-1 0) /* 0...Regular line height (default). */

6

AddText(270;​20;​"On the other hand, we denounce with righteous indignation and dislike men who are so beguiled and demoralized by the charms of pleasure of the moment, so blinded by desire, that they cannot foresee the pain and trouble that are bound to ensue; and equal blame belongs to those who fail in their duty through weakness of will, which is the same as saying through shrinking from toil and pain. These cases are perfectly simple and easy to distinguish.";​

7

Verdana;​10;​plain;​teal;​left;​;​0;​110;​300 30%) /* 30%...Line height increased by 30%. */

8

CloseDrawing()

EXAMPLE_08
 

Text Hyphenation

In xmCHART 5 the hyphenation of text can be controlled by the function HyphenationOptions().

Entering texts in FileMaker’s Specify Calculation dialog box

It is important to note that double quotes should be prefixed (aka escaped) by a backslash (\") when entering texts in FileMaker’s Specify Calculation dialog box. For example:

xmCH_DrawChart(

"OpenDrawing(180;​50)

AddText(20;​30;​\"Company Universal Exports\")

CloseDrawing()")

FileMaker Dialog Box Enter Quotes 1

To place double quotes in a string of text, escape them twice, once for xmCHART (\") and again for FileMaker (\\\"). For example:

xmCH_DrawChart(

"OpenDrawing(180;​50)

AddText(20;​30;​\"Company \\\"Universal Exports\\\"\")

CloseDrawing()")

FileMaker Dialog Box Enter Quotes 2

For more information on entering comments, please refer to section Scripts.

 

Typographical quotes

Double quotes (") are not to be confused with typographical quotes (“”). Typographical quotes, also known as smart quotes or curly quotes can be activated or deactivated under FileMaker Pro menu item: File > File Options… > Text.

FileMaker Dialog Box Text Smart Quotes
Scroll to Top