DEPRECATION WARNING

This documentation is not using the current rendering mechanism and is probably outdated. The extension maintainer should switch to the new system. Details on how to use the rendering mechanism can be found here.

Custom Fonts

Adding custom fonts is as easy as providing the path to the TTF file within your TypoScript settings. The name of the font is automatically generated by TCPDF using the font file name. Only the characters a-z, 0-9 and _ are allowed and words like bold, oblique, italic or regular are replaced by b, o, i or [empty].

Example: ROBOTObold.ttf becomes robotob

Please note that the TypoScript key you use is not the font name, the font name is generated only based on the font file name!

TypoScript

plugin.tx_pdfviewhelpers.settings.config.fonts {
        addTTFFont {
                roboto {
                        path = EXT:pdfviewhelpers/Resources/Public/Examples/FullFeatureShowCase/Roboto.ttf
                        # it is also possible to define the type of the font
                        # possible values are TrueTypeUnicode, TrueType, Type1, CID0JP = CID-0 Japanese, CID0KR = CID-0 Korean, CID0CS = CID-0 Chinese Simplified, CID0CT = CID-0 Chinese Traditional
                        # can be left out in order for TCPDF to auto detect the type
                        # type = TrueTypeUnicode
                }
                opensans {
                        path = EXT:pdfviewhelpers/Resources/Public/Examples/FullFeatureShowCase/OpenSans.ttf
                }
        }
}

TCPDF fonts

TCPDF comes already with the following fonts installed: courier, helvetica, symbol, times and zapfdingbats

Limitations

TCPDF does not support OpenType fonts with CFF data. If your font can not be added, please try to convert it to TTF, there are a couple of free online converters available.