set_font

Summary

Changes the default font.

Usage

pdf(set_font, hash( [ name,          font_name, ]
                    [ size,          font_size, ]
                    [ colorCMYK,     cmyk_color,]
                    [ colorRGB,      rgb_color, ]
                    [ justification, text_justification ] ) )

Parameters

NameTypeDescriptionRequired
name string The font type (name). No.
size integer The size of the font. No.
colorCMYK array The CMYK color. No.
colorRGB array The RGB color. No.
justification string The text alignment. No.

Description

This function makes it possible to change the default/current font and the text color, style, etc. The following list shows the fonts that can be used.

Either the "colorRGB" or the "colorCMYK" parameter can be used to specify the font color. The "colorRGB" parameter must be an array consisting of three integers between 0 and 255. The "colorCMYK" parameter must be an array of four decimal values between 0 and 1.

The justification parameter controls the text alignment, it can be:

Examples

Example 1

{pdf( 'set_font', hash( 'name', 'Times-Roman', 'size', 12 ) )}
 
{pdf( 'text', 'Hello world'|wash( 'pdf' ) )}
 
{pdf( 'new_line' )}
{pdf( 'new_line' )}
{pdf( 'set_font', hash( 'name', 'Times-Italic',
                        'size', 10,
                        'justification', 'full',
                        'colorRGB', array( 255, 255, 128 ) ) )}
 
{pdf( 'text', 'Example'|wash( 'pdf' ) )}

This example demonstrates how to change the default font type, size, style, and color.

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2013 eZ Systems AS (except where otherwise noted). All rights reserved.