Skip to content

Tag Definition: registerTTFont

Generated by rlextra version 4.3.0a1

Attributes

Name

Required?

Default_Value

Values

asciiReadable

none

none

['yes', 'no', '0', '1', 'true', 'false', 'none']

faceName

required

None

fileName

required

None

shaped

none

none

['yes', 'no', '0', '1', 'true', 'false', 'none']

subfontIndex

implied

None

Can contain
EMPTY

Purpose

Register a .ttf font for usage in the generated pdf.

Check out our docs page on this.

Example Usage

In the example below you can see us register the font, create an associated style in the stylesheet, and then use it in the story. Multiple fonts can be registered.

<docinit>
    <registerTTFont faceName="Arial-Regular" fileName="{{ DIR }}/fonts/Arial/Arial-Regular.ttf"/>
</docinit>
...
<stylesheet>
    <paraStyle name="text" fontName="Arial-Regular" fontSize="10" leading="11.5" textColor="black"/>
</stylesheet>
<story>
    <para style="text">This text will generate using the font I defined</para>
</story>

To use related variations of a font family, register them all. This can then be combined later with registerFontFamily for the sake of using the associated tags such as italics and bold for text between the <i></i> and <b></b> tags respectively.

Note: Only relevant sections are used in this snippet. Some tags were not included. See some of our samples for further insight of how you may go about setting up a full document using rml.

Example of nesting path from the parent tags to the current tag

<document> ➔ <docinit> ➔ <registerTTFont>