The <font-properties/> command

Assigns the current typeface, font and one or more associated font characteristics.

Where allowed

Any mapping.

Range of effect

The assignments remain in effect within the scope of the current element and its descendants.

Typeface and font

The following attributes set properties of the current typeface and font:

typeface

Specifies the name of a typeface or a typeface selection scheme.

size

Defines a measure that sets the font size. Setting the font size in this way resets the horizontal scaling and baseline shift to their default values and automatically disables superscript and subscript.

leading

Defines a measure that sets the current leading. If the size is changed without setting a leading value, the leading is set to the same value as the size.

color

Specifies the current font color. See “Colors” for a description of how colors are specified.

char-space

Specifies an amount to be added to the effective width of each character. See Character spacing for more information.

thinspace

Specifies the width of a thin space expressed as a percentage of the current font size. In TopLeaf, the width of a thin space (U+2009) is equal to the width of a 1/4 em space. For some document styles or languages you may need to redefine the thin space width. The following table shows how to redefine the thin space width to some commonly used alternatives:

Width Command
1/5 em <font-properties thinspace="20" />
1/6 em <font-properties thinspace="16" />

Font characteristics

The following font characteristics are enabled if the assigned value is one of the following: on, yes, 1, or enable. The characteristic is disabled if the assigned value is one of the following: off, no, 0, or disable. The value assigned to a font characteristic is not case sensitive.

bold

Enable or disable boldface characters.

italic

Enable or disable italic (oblique) characters.

small

Enable or disable small characters.

super

Enable or disable superscript mode.

sub

Enable or disable subscript mode.

underline

Enable or disable underlined text.

lowercase

Enable or disable lowercase characters.

uppercase

Enable or disable uppercase characters.

reverse

Enable or disable reversed foreground and background colors .If enabled, automatically disables frame and overbar mode.

frame

Enable or disable inline boxed text. If enabled, automatically disables overbar and reverse mode.

overbar

Enable or disable inline boxed text. If enabled, automatically disables frame and reverse mode.

strikeout

Enable or disable text strike through mode.

The following example shows how to set the state of the italic font characteristic using the values held in the italic attribute :

<font-properties italic="{@italic}" />

Configurable font characteristics

The properties of some font characteristics are configurable. You can use the <font-properties/> directive to configure the properties of a single font characteristic, where:

fptype

Specifies the name of the font characteristic to be configured, and is one of the following: super, sub, small, reverse, or frame.

fpsize

Specifies the relative font size of the characteristic declared by fptype, expressed as a percentage of the current font size. If not specified a predefined algorithm is used to calculate the size.

fpvshift

Specifies the baseline position for the characteristic for a superscript or subscript effect. The value is a percentage of the current font size. A positive value causes the effect to appear lower on the page, while a negative value raises it. If not specified a predefined algorithm is used to calculate the baseline position.

fpabove

Specifies the distance between the cap height and the top of a reverse or frame effect. The distance is a positive value specified as a percentage of the current font size.

fpbelow

Specifies the distance between the baseline and the bottom of a reverse or frame effect. The distance is a positive value specified as a percentage of the current font size.

Defaults for configurable characteristics

TopLeaf uses a predefined algorithm when calculating the default font size for superscript, subscript, and small fonts. Consequently, the default relative font size for these characteristics is between 66% and 75% of the current font size. By default, superscripts are raised by approximately 40% of the current font size, and subscripts are lowered by approximately 20% of the current font size.

Example

The following command sets the superscript font size to 58% of the current font size, and the superscript position to 33% above the baseline:

<font-properties fptype="super" fpsize="58" fpvshift="-33" />
[Note] Note

You can use multiple <font-properties/> commands if you need to configure more than one font characteristic. The configuration settings remain active within the scope of the current element and its descendants.

Any user configuration of a font characteristic must be declared when mapping an ancestor tag (for example, the parent) of the element in which the configured font characteristic is applied. This means that changing the characteristics of, say, superscript cannot be done by the mapping that selects superscript.

[Note] Note

In previous versions the argument letter-space was allowed. This is deprecated and may be removed in future versions. Use the char-space argument instead.