Skip to content

Tag Definition: registerFontFamily

Generated by rlextra version 3.6.13

Attributes

Name

Required?

Default_Value

Values

bold

implied

None

boldItalic

implied

None

italic

implied

None

normal

required

None

Can contain
EMPTY

Purpose

Link fonts to make it easier to apply bold and italic font effects easier.

Example Usage

This lets us use related variations of a font family. We register them all, then we use the registerFontFamily tag with attributes for normal, bold, italic and potentially boldItalic to register a font for each variation.

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

As you see from the above, since text uses "Arial-Regular" you would expect that font, but since we've added <b> tags, we'll actually get the related "Arial-Bold" instead

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> ➔ <registerFontFamily>