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;​210)

2

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

3

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

4

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

5

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

6

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

7

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

8

AddText(10;​140;​"नमस्ते दुनिया (Hindi)";​;​12;​plain;​40 40 40)

9

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

10

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

11

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

12

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

\uxxxx ....... Single Unicode character formed by 4 hexadecimal digits.

\Uxxxxxxxx ... Single Unicode character formed by 8 hexadecimal digits.

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 */

A Unicode escape sequence represents the single Unicode character formed by the hexadecimal number following the \u or \U character. The lowercase \u escape sequence is followed by 4 hex digits, the uppercase \U escape sequence is similar, but expects 8 hex digits, not 4.

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. See EXAMPLE_03 below.
 
Examples
EXAMPLE_02
1

OpenDrawing(220;​60)

2

AddText(10;​40;​

3

"\u270D \u2030 \u266C \u2318 \u267B \u2718 \u2714";​

4

Arial;​24;​plain;​86 111 145)

5

CloseDrawing()

EXAMPLE_02
EXAMPLE_03
1

OpenDrawing(290;​60)

2

AddText(10;​40;​

3

"\u2109 \u27F2 \U0001F50E \U0001F512 \U0001F4CE \U0001F4BB \U0001F464 \U0001F4AC \U0001F557";​

4

Arial;​24;​bold;​86 111 145)

5

CloseDrawing()

EXAMPLE_03
 

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:

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

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

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

 
Example
EXAMPLE_04
1

OpenDrawing(300;​30)

2

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

3

CloseDrawing()

EXAMPLE_04

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

Please note that attribute values containing white space must be placed in single quotes. 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>...")

 
Example
EXAMPLE_05
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_05
 

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_06
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_06
 

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 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
Your browser is out-of-date!

Update your browser to view this website correctly. Update my browser now

×