Sets the font used to print character strings. It is mandatory to call this method at least once before printing text or the resulting document would not be valid.
The font can be either a standard one or a font added via the AddFont() method. Standard fonts use the Windows encoding cp1252 (Western Europe).The method can be called before the first page is created and the font is kept from page to page.
Font writing style.It is also possible to pass an empty string. In that case, the current family is kept. It can be either a name defined by AddFont() or one of the standard families are
Font display style.It is also possible to pass an empty string. In that case, the current family is kept. using default values or any combination.
The default value is regular. Bold and italic styles do not apply to Symbol and ZapfDingbats.
Font display size in points.The default value is the current size. If no size has been specified since the beginning of the document, the value is 12.
Imports a TrueType, OpenType or Type1 font and makes it available. It is necessary to generate a font definition file first with the MakeFont utility. if you want to view the steps of adding fonts Click Here
Font writing style.The name can be chosen arbitrarily. If it is a standard family name, it will override the corresponding font.
Font display style.values are
The font definition file. By default, the name is built from the family and style, in lower case with no space.
<?php require_once "fpdf/fpdf.php"; //fpdf supporting file //Page Creation (Default value is P;Default value is mm;default page size: A4) # $pdf = new FPDF(); //or $pdf = new FPDF('P','mm','A4'); $pdf -> AddPage(); // SetFont(family,style,size) $pdf -> SetFont('Arial','',14); //Using bold,italic,underline the text $pdf -> SetFont('Arial','BIU',14); //B-bold; I-italic; U-underline //addFont(family,style,file) $pdf ->addFont('Roboto','','Roboto.php'); //Adding Custom Font $pdf -> SetFont('Roboto','',10); $pdf -> Output(); // Display output ?>View Demo
Learn All in Tamil © Designed & Developed By Tutor Joes | Privacy Policy | Terms & Conditions