<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://c4engine.com/wiki/index.php?action=history&amp;feed=atom&amp;title=Text_Formatting</id>
	<title>Text Formatting - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://c4engine.com/wiki/index.php?action=history&amp;feed=atom&amp;title=Text_Formatting"/>
	<link rel="alternate" type="text/html" href="https://c4engine.com/wiki/index.php?title=Text_Formatting&amp;action=history"/>
	<updated>2026-04-28T21:42:58Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.40.0</generator>
	<entry>
		<id>https://c4engine.com/wiki/index.php?title=Text_Formatting&amp;diff=444&amp;oldid=prev</id>
		<title>Eric Lengyel: Created page with &quot;Strings displayed by text widgets may contain the embedded formatting directives supported by Slug. A list of formatting directives begins with the two-character sequence '''{#''' and ends with the closing brace '''}'''. Each directive has the form '''directive(''params'')''', where ''params'' can be empty or consist of one or more parameters that apply to the directive. Multiple directives can be included in one list by separating them with semicolons.  The followin...&quot;</title>
		<link rel="alternate" type="text/html" href="https://c4engine.com/wiki/index.php?title=Text_Formatting&amp;diff=444&amp;oldid=prev"/>
		<updated>2023-07-15T12:08:34Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;Strings displayed by text widgets may contain the embedded formatting directives supported by &lt;a href=&quot;/wiki/index.php?title=Slug&quot; class=&quot;mw-redirect&quot; title=&quot;Slug&quot;&gt;Slug&lt;/a&gt;. A list of formatting directives begins with the two-character sequence &amp;#039;&amp;#039;&amp;#039;{#&amp;#039;&amp;#039;&amp;#039; and ends with the closing brace &amp;#039;&amp;#039;&amp;#039;}&amp;#039;&amp;#039;&amp;#039;. Each directive has the form &amp;#039;&amp;#039;&amp;#039;directive(&amp;#039;&amp;#039;params&amp;#039;&amp;#039;)&amp;#039;&amp;#039;&amp;#039;, where &amp;#039;&amp;#039;params&amp;#039;&amp;#039; can be empty or consist of one or more parameters that apply to the directive. Multiple directives can be included in one list by separating them with semicolons.  The followin...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Strings displayed by text widgets may contain the embedded formatting directives supported by [[Slug]]. A list of formatting directives begins with the two-character sequence '''{#''' and ends with the closing brace '''}'''. Each directive has the form '''directive(''params'')''', where ''params'' can be empty or consist of one or more parameters that apply to the directive. Multiple directives can be included in one list by separating them with semicolons.&lt;br /&gt;
&lt;br /&gt;
The following table lists the formatting directives recognized by the [[Text Widget]].&lt;br /&gt;
&lt;br /&gt;
{| {{Table}}&lt;br /&gt;
{{Tablehead|Directive|Description}}&lt;br /&gt;
|-&lt;br /&gt;
{{Setting|'''size(''value'')'''|Set the font size to ''value'' in pixels, where ''value'' is a floating-point number. This directive is ignored if ''value'' is not greater than zero.}}&lt;br /&gt;
|-&lt;br /&gt;
{{Setting|'''stretch(''value'')'''|Set the text stretch to ''value'', where ''value'' is a floating-point number. Ignored if ''value'' is not greater than zero.}}&lt;br /&gt;
|-&lt;br /&gt;
{{Setting|'''track(''value'')'''|Set the text tracking to ''value'' in em units, where ''value'' is a floating-point number.}}&lt;br /&gt;
|-&lt;br /&gt;
{{Setting|'''skew(''value'')'''|Set the text skew to ''value'', where ''value'' is a floating-point number. Positive values skew to the right, and negative values skew to the left.}}&lt;br /&gt;
|-&lt;br /&gt;
{{Setting|'''scale(''x'', ''y'')'''|Set the text scale to (''x'', ''y''), where ''x'' and ''y'' are floating-point numbers. The ''y'' component may be omitted, in which case it is set equal to the ''x'' component. Ignored if either ''x'' or ''y'' is not greater than zero.}}&lt;br /&gt;
|-&lt;br /&gt;
{{Setting|'''offset(''x'', ''y'')'''|Set the text offset to (''x'', ''y'') in em units, where ''x'' and ''y'' are floating-point numbers. Positive values offset right and upward, and negative values offset left and downward.}}&lt;br /&gt;
|-&lt;br /&gt;
{{Setting|'''under(''value'')'''|Set the underline state to ''value'', where ''value'' is either '''true''' or '''false'''.}}&lt;br /&gt;
|-&lt;br /&gt;
{{Setting|'''strike(''value'')'''|Set the strikethrough state to ''value'', where ''value'' is either '''true''' or '''false'''.}}&lt;br /&gt;
|-&lt;br /&gt;
{{Setting|'''script(''value'')'''|Set the transform-based script state to ''value'', where ''value'' is an integer in the range [âˆ’3,&amp;amp;nbsp;3]. If ''value'' is 0, then the text scale and text offset states are set to the identity transform. If ''value'' is positive, then the superscript scale and offset are applied ''value'' times. If ''value'' is negative, then the subscript scale and offset are applied ''value'' times. Ignored if ''value'' is out of range or the font does not contain transform-based script information.}}&lt;br /&gt;
|-&lt;br /&gt;
{{Setting|'''left()'''|Set the text alignment to left. The new alignment takes effect at the beginning of the next line.}}&lt;br /&gt;
|-&lt;br /&gt;
{{Setting|'''right()'''|Set the text alignment to right. The new alignment takes effect at the beginning of the next line.}}&lt;br /&gt;
|-&lt;br /&gt;
{{Setting|'''center()'''|Set the text alignment to center. The new alignment takes effect at the beginning of the next line.}}&lt;br /&gt;
|-&lt;br /&gt;
{{Setting|'''lead(''value'')'''|Set the leading to ''value'' in em units, where ''value'' is a floating-point number. The new leading takes effect at the beginning of the next line.}}&lt;br /&gt;
|-&lt;br /&gt;
{{Setting|'''pspace(''value'')'''|Set the paragraph spacing to ''value'' in em units, where ''value'' is a floating-point number.}}&lt;br /&gt;
|-&lt;br /&gt;
{{Setting|'''margin(''left'',''right'')'''|Set the left and right paragraph margins to ''left'' and ''right'' in absolute units. The right margin may be omitted, in which case it is set to the same value as the left margin.}}&lt;br /&gt;
|-&lt;br /&gt;
{{Setting|'''indent(''value'')'''|Set the paragraph first-line indent to ''value'' in absolute units, where ''value'' is a floating-point number.}}&lt;br /&gt;
|-&lt;br /&gt;
{{Setting|'''kern(''value'')'''|Set the glyph kerning state to ''value'', where ''value'' is either '''true''' or '''false'''.}}&lt;br /&gt;
|-&lt;br /&gt;
{{Setting|'''mark(''value'')'''|Set the combining mark positioning state to ''value'', where ''value'' is either '''true''' or '''false'''.}}&lt;br /&gt;
|-&lt;br /&gt;
{{Setting|'''seq(''value'')'''|Set the sequence replacement state to ''value'', where ''value'' is either '''true''' or '''false'''.}}&lt;br /&gt;
|-&lt;br /&gt;
{{Setting|'''alt(''value'')'''|Set the alternate substitution state to ''value'', where ''value'' is either '''true''' or '''false'''.}}&lt;br /&gt;
|-&lt;br /&gt;
{{Setting|'''grid(''value'')'''|Set the grid positioning state to ''value'', where value is either '''true''' or '''false'''.}}&lt;br /&gt;
|-&lt;br /&gt;
{{Setting|'''color(''red'',''green'',''blue'',''alpha'')'''|Set the primary text color to (&amp;lt;i&amp;gt;red&amp;lt;/i&amp;gt;, &amp;lt;i&amp;gt;green&amp;lt;/i&amp;gt;, &amp;lt;i&amp;gt;blue&amp;lt;/i&amp;gt;, &amp;lt;i&amp;gt;alpha&amp;lt;/i&amp;gt;), where each component is an integer in the range [0,&amp;amp;#x202F;255]. The &amp;lt;i&amp;gt;alpha&amp;lt;/i&amp;gt; component may be omitted, in which case it is 255. This directive is ignored if any component is out of range.}}&lt;br /&gt;
|-&lt;br /&gt;
{{Setting|'''color2(''red'',''green'',''blue'',''alpha'')'''|Set the secondary text color to (&amp;lt;i&amp;gt;red&amp;lt;/i&amp;gt;, &amp;lt;i&amp;gt;green&amp;lt;/i&amp;gt;, &amp;lt;i&amp;gt;blue&amp;lt;/i&amp;gt;, &amp;lt;i&amp;gt;alpha&amp;lt;/i&amp;gt;) using the same format as the primary color. The secondary text color is used only when gradients are enabled.}}&lt;br /&gt;
|-&lt;br /&gt;
{{Setting|'''gcoord(''y1'',''y2'')'''|Set the gradient coordinates to ''y1'' and ''y2''. These are the distances above the baseline at which the gradient is equal to the primary and secondary color, respectively. Negative values are allowed.}}&lt;br /&gt;
|-&lt;br /&gt;
{{Setting|'''grad(''value'')'''|Set the gradient state to ''value'', where ''value'' is either '''true''' or '''false'''.}}&lt;br /&gt;
|-&lt;br /&gt;
{{Setting|'''effect_color(''red'',''green'',''blue'',''alpha'')'''|Set the primary effect color to (&amp;lt;i&amp;gt;red&amp;lt;/i&amp;gt;, &amp;lt;i&amp;gt;green&amp;lt;/i&amp;gt;, &amp;lt;i&amp;gt;blue&amp;lt;/i&amp;gt;, &amp;lt;i&amp;gt;alpha&amp;lt;/i&amp;gt;), where each component is an integer in the range [0,&amp;amp;#x202F;255]. The &amp;lt;i&amp;gt;alpha&amp;lt;/i&amp;gt; component may be omitted, in which case it is 255. This directive is ignored if any component is out of range.}}&lt;br /&gt;
|-&lt;br /&gt;
{{Setting|'''effect_color2(''red'',''green'',''blue'',''alpha'')'''|Set the secondary effect color to (&amp;lt;i&amp;gt;red&amp;lt;/i&amp;gt;, &amp;lt;i&amp;gt;green&amp;lt;/i&amp;gt;, &amp;lt;i&amp;gt;blue&amp;lt;/i&amp;gt;, &amp;lt;i&amp;gt;alpha&amp;lt;/i&amp;gt;) using the same format as the primary color. The secondary effect color is used only when effect gradients are enabled.}}&lt;br /&gt;
|-&lt;br /&gt;
{{Setting|'''effect_gcoord(''y1'',''y2'')'''|Set the effect gradient coordinates to ''y1'' and ''y2''. These are the distances above the baseline at which the gradient is equal to the primary and secondary color, respectively. Negative values are allowed.}}&lt;br /&gt;
|-&lt;br /&gt;
{{Setting|'''effect_grad(''value'')'''|Set the effect gradient state to ''value'', where ''value'' is either '''true''' or '''false'''.}}&lt;br /&gt;
|-&lt;br /&gt;
{{Setting|'''reset()'''|Reset all formatting state to the initial values given by the text widget. This directive always turns subscript and superscript modes off and resets their parameters to the default values.}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
When sequence replacement is enabled, the following directives can be used to control what types of sequences are recognized.&lt;br /&gt;
&lt;br /&gt;
{| {{Table}}&lt;br /&gt;
{{Tablehead|Directive|Description}}&lt;br /&gt;
|-&lt;br /&gt;
{{Setting|'''comp(''value'')'''|Set the glyph composition state to ''value'', where ''value'' is either '''true''' or '''false'''.}}&lt;br /&gt;
|-&lt;br /&gt;
{{Setting|'''slig(''value'')'''|Set the standard ligatures state to ''value'', where ''value'' is either '''true''' or '''false'''.}}&lt;br /&gt;
|-&lt;br /&gt;
{{Setting|'''rlig(''value'')'''|Set the required ligatures state to ''value'', where ''value'' is either '''true''' or '''false'''.}}&lt;br /&gt;
|-&lt;br /&gt;
{{Setting|'''dlig(''value'')'''|Set the discretionary ligatures state to ''value'', where ''value'' is either '''true''' or '''false'''.}}&lt;br /&gt;
|-&lt;br /&gt;
{{Setting|'''hlig(''value'')'''|Set the historical ligatures state to ''value'', where ''value'' is either '''true''' or '''false'''.}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
When alternate substitution is enabled, the following directives can be used to control what types of alternates are applied.&lt;br /&gt;
&lt;br /&gt;
{| {{Table}}&lt;br /&gt;
{{Tablehead|Directive|Description}}&lt;br /&gt;
|-&lt;br /&gt;
{{Setting|'''style(''value'')'''|Set the stylistic alternates state to ''value'', where ''value'' is an integer in the range 0&amp;amp;ndash;20. If ''value'' is nonzero, stylistic alternates are enabled, and they use the set specified by ''value''. If ''value'' is zero, stylistic alternates are disabled. Ignored if ''value'' is out of range.}}&lt;br /&gt;
|-&lt;br /&gt;
{{Setting|'''historical(''value'')'''|Set the historical alternates state to ''value'', where ''value'' is either '''true''' or '''false'''.}}&lt;br /&gt;
|-&lt;br /&gt;
{{Setting|'''smallcap(''value'')'''|Set the lowercase small caps state to ''value'', where ''value'' is either '''true''' or '''false'''.}}&lt;br /&gt;
|-&lt;br /&gt;
{{Setting|'''capsmall(''value'')'''|Set the uppercase small caps state to ''value'', where ''value'' is either '''true''' or '''false'''.}}&lt;br /&gt;
|-&lt;br /&gt;
{{Setting|'''titling(''value'')'''|Set the titling caps state to ''value'', where ''value'' is either '''true''' or '''false'''.}}&lt;br /&gt;
|-&lt;br /&gt;
{{Setting|'''unicase(''value'')'''|Set the unicase state to ''value'', where ''value'' is either '''true''' or '''false'''.}}&lt;br /&gt;
|-&lt;br /&gt;
{{Setting|'''caseform(''value'')'''|Set the case-sensitive forms state to ''value'', where ''value'' is either '''true''' or '''false'''.}}&lt;br /&gt;
|-&lt;br /&gt;
{{Setting|'''slashzero(''value'')'''|Set the slashed zero state to ''value'', where ''value'' is either '''true''' or '''false'''.}}&lt;br /&gt;
|-&lt;br /&gt;
{{Setting|'''hyphenminus(''value'')'''|Set the hyphen minus state to ''value'', where ''value'' is either '''true''' or '''false'''.}}&lt;br /&gt;
|-&lt;br /&gt;
{{Setting|'''frac(''value'')'''|Set the fraction state to ''value'', where ''value'' is either '''true''' or '''false'''.}}&lt;br /&gt;
|-&lt;br /&gt;
{{Setting|'''lining(''value'')'''|Set the lining figures state to ''value'', where ''value'' is either '''true''' or '''false'''. If ''value'' is '''true''', then the oldstyle figures state is disabled.}}&lt;br /&gt;
|-&lt;br /&gt;
{{Setting|'''oldstyle(''value'')'''|Set the oldstyle figures state to ''value'', where ''value'' is either '''true''' or '''false'''. If ''value'' is '''true''', then the lining figures state is disabled.}}&lt;br /&gt;
|-&lt;br /&gt;
{{Setting|'''tabfig(''value'')'''|Set the tabular figures state to ''value'', where ''value'' is either '''true''' or '''false'''. If ''value'' is '''true''', then the proportional figures state is disabled.}}&lt;br /&gt;
|-&lt;br /&gt;
{{Setting|'''propfig(''value'')'''|Set the proportional figures state to ''value'', where ''value'' is either '''true''' or '''false'''. If ''value'' is '''true''', then the tabular figures state is disabled.}}&lt;br /&gt;
|-&lt;br /&gt;
{{Setting|'''sub(''value'')'''|Set the subscript state to ''value'', where ''value'' is either '''true''' or '''false'''.  If ''value'' is '''true''', then the superscript, scientific inferiors, and ordinals states are disabled.}}&lt;br /&gt;
|-&lt;br /&gt;
{{Setting|'''sup(''value'')'''|Set the superscript state to ''value'', where ''value'' is either '''true''' or '''false'''.  If ''value'' is '''true''', then the subscript, scientific inferiors, and ordinals states are disabled.}}&lt;br /&gt;
|-&lt;br /&gt;
{{Setting|'''inf(''value'')'''|Set the scientific inferiors state to ''value'', where ''value'' is either '''true''' or '''false'''.  If ''value'' is '''true''', then the subscript, superscript, and ordinals states are disabled.}}&lt;br /&gt;
|-&lt;br /&gt;
{{Setting|'''ord(''value'')'''|Set the ordinals state to ''value'', where ''value'' is either '''true''' or '''false'''.  If ''value'' is '''true''', then the subscript, superscript, and scientific inferiors states are disabled.}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
&lt;br /&gt;
The chemical formula for water would be displayed using the following string.&lt;br /&gt;
&lt;br /&gt;
 H{#sub(true)}2{#sub(false)}O&lt;br /&gt;
&lt;br /&gt;
Words can be displayed in different colors with the following string.&lt;br /&gt;
&lt;br /&gt;
 {#color(255,0,0)}RED {#color(0,255,0)}GREEN {#color(0,0,255)}BLUE&lt;br /&gt;
&lt;br /&gt;
Text can be displayed at different sizes and with different tracking with the following string.&lt;br /&gt;
&lt;br /&gt;
 Normal size {#size(30);track(0.2)} Big and wide&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&lt;br /&gt;
* [[Text Widget]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Interface]]&lt;/div&gt;</summary>
		<author><name>Eric Lengyel</name></author>
	</entry>
</feed>