PDFium Delphi Component Docs

AddStandardFontText method

Component: TPdf  ·  Unit: PDFium
Draw text with one of the 14 standard PDF fonts, embedding no font program

Syntax

procedure AddStandardFontText(const Text: WString; StandardFont: TPdfStandardFont; FontSize: Single; X, Y: Double; Color: TColor; Alpha: Byte; Angle: Double = 0.0);

TextWString. Text to draw
StandardFontTPdfStandardFont. One of the 14 standard faces: sfCourier, sfCourierBold, sfCourierBoldOblique, sfCourierOblique, sfHelvetica, sfHelveticaBold, sfHelveticaBoldOblique, sfHelveticaOblique, sfTimesRoman, sfTimesBold, sfTimesBoldItalic, sfTimesItalic, sfSymbol, sfZapfDingbats
FontSizeSingle. Text size in points
X, YDouble. Position of the text origin in PDF page units, measured from the bottom-left corner of the page
ColorTColor. Fill colour of the glyphs
AlphaByte. Fill opacity, 0 transparent to $FF opaque
AngleDouble. Rotation of the text baseline in degrees, anticlockwise. Defaults to 0

Description

Unlike AddText, which embeds the system font it finds, this embeds no font program: every conforming reader already has these faces, so the file stays smaller

The trade is conformance. PDF/A and PDF/X both require all fonts embedded, so output meant for those profiles has to use AddText instead

The face names are matched against the base font names of ISO 32000-1 Table 109, so the enumeration maps one to one onto the standard 14

Example

Pdf.AddStandardFontText('Draft', sfHelveticaBold, 24, 72, 720,
  clGray, $80);
Pdf.UpdatePage;

See Also

AddText, AddShapedText, AddCidType2Text, FontSize