Ch. 033 HTML Tags for Field Scripting

<H1> to <H6>

These tags are used to mark header sections. Headers are types of paragraphs and so they accept the same attributes as paragraph tags.

<StyleRun>

The stylerun tag is used to change the current style. It accepts the following attributes:

Attribute

Notes

fontsize

The font size for subsequent content, expressed in points. Follow with "pt" to be explicit.

Format/Example
<stylerun fontsize="11pt">Text and/or field name(s) would go here.</stylerun>

The example above would apply 11pt font size to everything between the opening and closing tags.

charspacing 

The character spacing for subsequent content - Each character in a string of text has a width which is used for positioning the next character. The charspacing is added to the width of each character. Unlike the "tracking" value set on the Format tab, the value you enter is not applied to the font size; it is an absolute value no matter what font size you use. Therefore you will see a bigger difference when your charspacing value is applied to a smaller font size. There is not an exact computation you can use here, but larger positive values will stretch the text out more and larger negative values will tighten the text up more.

Format, where n is a positive or negative number:

<stylerun charspacing="n">

                        Examples

See the image below. The top has no charspacing value applied.

The middle is set like this:

<stylerun charspacing="3">Positive CharSpacing</stylerun>

The bottom is set like this:

<stylerun charspacing="-3">Negative CharSpacing</stylerun>

wordspacing

The word spacing for subsequent content. This works in a very similar way to charspacing (above), but the value is added only to space characters. Positive values will increase the size of space characters (thereby pushing words farther apart). Negative values will decrease the size of space characters (thereby pushing words closer together). Like charspacing, this is an absolute value and does not depend on the font size, so the visual effect will be greater with a smaller font size.

Format, where n is a positive or negative number:

<stylerun wordspacing="n">

Examples

Top:

No WordSpacing Applied

Middle:

<stylerun wordspacing="3">Positive WordSpacing Applied</stylerun>

Bottom:

<stylerun ="-3">Negative WordSpacing Applied</stylerun>

justification

Sets the horizontal justification for subsequent content. Typically, you will only want to use values of 0 (no justification) or 1 (full justification). However, you can enter a decimal value between 0 and 1 to partially justify text.

How it's calculated

As each line of text is drawn, the difference between the width of the line and the width of the field is evaluated to determine the amount of free width. This free width is divided by the number of space characters in the line and then multiplied by the justification factor to produce an inter-word spacing for the line. Single lines and short lines at the end of paragraphs are not justified. Please see this article for more details.

Format, where n is a number between and including 0 and 1:

<stylerun justification="n">

Examples

See image below.

The top has a 0% justification (none) applied:

<stylerun justification="0">text here</stylerun>

The middle has a 50% justification applied:

<stylerun justification="0.5">text here</stylerun>

The bottom has 100% (full) justification applied:

<stylerun justification="1">text here</stylerun>

hpos

Sets the horizontal offset (positioning/alignment) for subsequent content. Typically, you will only want to use values of 0 (text aligned left), 0.5 (text centered), or 1 (text aligned right). However, you can enter a decimal value between 0 and 1 to partially adjust the horizontal positioning.

How it's calculated

The offset is measured as a proportion of the distance from the left. (1 = 100% to the right; 0 = 0% removed from the left; etc.)

Format, where n is a number between and including 0 and 1:

<stylerun hpos="n">

Examples

See image below. (The hpos values are included in the image for reference only. They would not actually display when appropriately using the <stylerun hpos="n"> tag.)

The first has an hpos value of 0 (left alignment) applied:

<stylerun hpos="0">text here</stylerun>

The second has an hpos value of 0.5 (center horizontal alignment) applied:

<stylerun hpos="0.5">text here</stylerun>

The third has an hpos value of 0.75 applied:

<stylerun hpos="0.75">text here</stylerun>

The fourth has an hpos value of 1 (right alignment) applied:

<stylerun hpos="1">text here</stylerun>

underline

Sets whether or not subsequent text is underlined.

Format

<stylerun underline="true"> will underline subsequent text.

<stylerun underline="false"> will make subsequent text not be underlined. Use this in situations where you've set an underline in the field's Format tab but need part of the text to be not underlined.

Examples

My favorite book is <stylerun underline="true">War and Peace</stylerun>.

will yield:

My favorite book is War and Peace.

If the Format tab has underline enabled for your scripted field, then

Please do not walk on the grass.<stylerun underline="false"> Herbicide applied today. </stylerun>Thank you!

will yield:
Please do not walk on the grass. Herbicide applied today. Thank you!

strike

Sets whether or not to apply a strike-through effect to subsequent text.

Format

<stylerun strike="true"> will apply strike-through to subsequent text.

<stylerun strike="false"> will make subsequent text not have strike-through. This is not commonly used.

Example

To Do List:<br><stylerun strike="true">1. Make list</stylerun>

will yield:

strike2

Sets whether or not to apply a double strike-through effect to subsequent text.

Format

<stylerun strike2="true"> will apply strike-through to subsequent text.

<stylerun strike2="false"> will make subsequent text not have strike-through. This is not commonly used.

Example

To Do List:<br><stylerun strike2="true">1. Make list</stylerun>

will yield:

outlineWhether to outline subsequent content.
Example

<stylerun outline="1">Outline Text</stylerun> 

will yield:
linespacing

The line spacing for subsequent content. Line spacing is zero by default, and can be positive or negative; it is a number in points that is added to the font size. This example shows 48 point text with linespacing of zero, +20 and -20.

paraspacingThe paragraph spacing for subsequent content.
transformCreates a transformation matrix to adjust text scaling, skew, rotation, and geometric translation. Please click here for additional details on how to use this powerful and complex attribute.
LeftmarginThe left margin for subsequent content.
IndentThe indent for subsequent content.
fixedwidth

A fixed with for the style run. Each style run has a width. The width is normally determined by the size of the characters in the text. Under some situations it can be useful to assign a fixed width to the entire style run. This can be used for aligning text and for bullet pointed lists.

textrise

The text rise for subsequent content. Positive values shift the text upwards. Negative values shift it downwards. The textrise distance is measured in points.

Please note: If you are using underlined text, the textrise attribute does not apply to the underlining; it raises only the text.

annots

Annotations associated with subsequent content. You can use a link annotation to insert a hyperlink (eg annots='link:http://www.google.com/'). You can use a goto annotation to insert a link to another page in the document (eg annots='goto:3'). The number indicates the page number. Note that the destination page must exist at the point at which the text is inserted. You can use a text annotation to insert a textual note (eg annots='text:A note to be inserted'). You can use highlight, squiggly, underline, and strikeout annotations for text markup.

dir

The default reading direction. Bi-directional text such as Hebrew or Arabic is laid out in the context of the default reading direction. You can specify left to right paragraph direction (eg dir=ltr), right to left paragraph direction (eg dir=rtl), or use the default of none (eg dir=none).

canbreakafter

Characters at which lines may be broken. For example to allow a break after hyphens or underscores you might use canbreakafter='-_'.

breakengine

The default line breaking engine. The line breaking engine determines at which points lines can be broken. You can specify the Uniscribe line breaking engine (eg breakengine=uniscribe), the Unicode line breaking engine (eg breakengine=unicode), or use the default of auto (eg breakengine=auto). When auto is specified the Uniscribe engine is used .

<List>

This tag is used to indicate a list of items. Each list item consists of a marker and some text. Markers may be bullet points, numbers or letters.

Lists are types of paragraphs and so they accept the same attributes as paragraph tags. They also accept the following additional attributes.

Attribute

Notes

itemindentThe indent of the item text from the left of the marker. This value is measured in the current units. By altering this property you can change the distance between the marker and the text. The default is dynamically determined based on the type of marker and the size of the text.
markerident

The indent of the left of the marker from the current left of the surrounding text. This value is measured in the current units. By altering this property you can alter the the indent distance for the markers in the list. The default is dynamically determined based on the type of marker and the size of the text.

start

Specifies the starting number for the first item in the list. This is only used when ordered markers are specified. The default is one.

type

Specifies the type of marker to use. You can use either ordered markers or unordered markers. Ordered markers increment for each item in the list. You can use numbers (type=1), lower case roman numerals (type=i), upper case roman numerals (type=I), lower case letters (type='a') or upper case letters (type=A). Unordered markers are the same for each item in the list. You can specify bullet points (type=disk), hollow bullets (type=circle) or squares (type=square). The default type is 'disk'.

<UL>

The UL tag is used to indicate an unordered list. Unordered lists are types of lists and so they accept the same attributes as list tags. The default marker is the bullet point but the marker will change as lists are nested within each other.

<OL>

The OL tag is used to indicate an ordered list. Ordered lists are types of lists and so they accept the same attributes as list tags. The default marker type is numeric.

<LI>

This tag is used to indicate an item within a list. It accepts the following attributes.

Attribute

Notes

valueSpecifies the number for this list item. Subsequent items are numbered incrementally from this new value.
typeSpecifies the type of marker to use. You can use the same types as you find in the type attribute of the list tag.

<B>

This tag is used to apply a bold text style to subsequent content. This tag does not accept any attributes.

<I>

This tag is used to apply an italic text style to subsequent content. This tag does not accept any attributes.

<U>

This tag is used to apply an underline text style to subsequent content. This tag does not accept any attributes.

<Strike>

This tag is used to apply a strike-through text style to subsequent content. This tag does not accept any attributes.

<Sup>

This tag is used to indicate text to be rendered as superscript. This tag does not accept any attributes.

<Sub>

This tag is used to indicate text to be rendered as subscript. This tag does not accept any attributes.

<leader>

This tag is used to insert leader text that will make a line fill the width of a field.

Put the text that should be inserted until the width is filled between the <leader> and </leader> tags. This tag does not accept any attributes.

Example:
Fruit salad<leader>.</leader>$1.99

will yield:
Fruit salad..............................................................$1.99

<Font>

The font tag is used to change the current font style. Fonts are types of styleruns and so they accept the same attributes as stylerun tags. They also accept the following additional attributes.

Attribute

Notes

sizeThe font size for subsequent content. You can set absolute font size by specifying an integer (no decimals) ranging from one to seven (eg size=6). Or you can specify a font size relative to the current base font size (eg size="+1"). The "fontsize" attribute is preferred over this attribute because it specifies the font size in points.
colorThe color for subsequent content. Colors are generally specified as RGB in hexadecimal notation (eg color="#FF0000") or as one of the standard color names (eg color="red"). You can specify grayscale colors by supplying only one component (eg color="#80") and CMYK colors by supplying four (eg color="#10203040"). You can specify an alpha value (i.e. partial transparency) for your color by appending a slash and a hex value to the end of your color string (egcolor="#10203040/C0").
cmyk

The CMYK color for subsequent content may be specified using the syntax: <font CMYK=”0,0,0,0” <Color>/font> Substitute the values for CMYK, in the appropriate position, replacing the zero value.