# link element

Type: | Heading Tags
Attributes: | bytes • embed • name • pfbsrc • src-italic • src • subset • subtype • type
See: | style

The link tag is used to include external files into your document - specifically stylesheets and fonts.
Although identical in purpose to the HTML "link" tag, we've given the attributes more appropriate names.
To link an external CSS stylesheet:

- the type attribute must be set to "stylesheet"
- the src attribute must be set to the URL of a CSS stylesheet.

To link an external TrueType font:

- the type attribute must be set to "font"
- the subtype attribute must be set to "TrueType"
- the name attribute must be set the name you will reference the font by.
- the src attribute must be set to the URL of the fontfile.
- the src-italic attribute may optionally be set to the URL of the file containing the italic variation of the font.
- the src-bold attribute may optionally be set to the URL of the file containing the bold variation of the font.
- the src-bolditalic attribute may optionally be set to the URL of the file containing the bold-italic variation of the font.
- the embed attribute may optionally be set to "true" or "false", to embed the font. The default is "true"
- the subset attribute may optionally be set to subset the font if it's embedded. The default is "true". If embed is false, this has no effect

To link an external Type 1 font:

- the type attribute must be set to "font"
- the subtype attribute must be set to "Type1"
- the name attribute must be set the name you will reference the font by.
- the src attribute must be set to the URL of the AFM file for the font.
- the src-italic attribute may optionally be set to the URL of the AFM file for the italic variation of the font.
- the src-bold attribute may optionally be set to the URL of the AFM file for the bold variation of the font.
- the src-bolditalic attribute may optionally be set to the URL of the AFM file for the bold-italic variation of the font.
- the pfbsrc attribute may optionally be set to the URL of the PFB file for the font, if it's to be embedded.
- the pfbsrc-italic attribute may optionally be set to the URL of the PFB file for the italic variation of the font, if it's to be embedded.
- the pfbsrc-bold attribute may optionally be set to the URL of the PFB file for the bold variation of the font, if it's to be embedded.
- the pfbsrc-bolditalic attribute may optionally be set to the URL of the PFB file for the bold-italic variation of the font, if it's to be embedded.

This is how to embed a CSS stylesheet

    <link type="stylesheet" src="styles.css"/>

This is how to embed a TrueType font with all the variations.

    <link type="font" name="mytimes" subtype="TrueType" src="times.ttf" src-bold="timesb.ttf"
                      src-italic="timesi.ttf" src-bolditalic="timesbi.ttf"/>

Or, if you are 100% sure won't need the italic or bold variations, you can leave them out.

    <link type="font" name="ocrfont" subtype="TrueType" src="ocrfont.ttf"/>

This is how to embed a Type1 font with just the basic variation.

    <link type="font" name="charter" subtype="Type1" src="charter.afm" pfbsrc="charter.pfb"/>