×
Menu
Index

Font

 
 
  • Font( [compound fontname], [Encoding], [Embed], [translate], [lfixed], [nScale] ) => specify the wanted font according to Xbase syntax, nominal point size followed by dot followed by font name. If none provided defaults to “10.Courier New”, with WinAnsiEncoding. Basic fonts are included in the Xbase PDF Class, but with version 3, any True Type font can be used to create your document, (see FontDef bellow), also any size can be used, there is no limitation to maximum size or the number of fonts used in one document. The existing fonts can be combined with Bold and or Italic, and “Underscore” can be added to any combination, providing underlining of text.
 
Compound fontname (character) : is the font compound name, point size, followed by font family name. Point size can be any number, including non integer number. Valid fonts are any true type font instaled in your system, combined to Bold, Italic or Bold Italic. Underscore can be added to any of the available fonts, like Font( “8.5.Arial Underscore” ) or Font( “12.Helvetica Bold Underscore”). Other fonts might be used using the FontDef method.
 
Encoding (character) : This parameter can be used to specify different encoding for the chosen font, one of the following values should be used :
 
Encoding
Comments
WinAnsiEncoding
Normal Windows encoding
CP1250
Central Europe
CP1251
Cyrillic
CP1253
Greek
CP1254
Turkish
CP1255
Hebrew
CP1256
Arabic
CP1257
Baltic
CP1258
Vietnam
 
Embed (logical) : specify if the font file is to be embedded in the document, or not. Embedding the font makes the document larger in size, but assures that the font will be respected, if not embedded, the reader may chose a similar font for displaying the document.
 
Translate (character) : specify a translation routine from DOS characters to Windows characters, according to national accented characters, valid options are : PTB for Portuguese, POL for Central European and GRM for German characters
 
lFixed (logical) : TRUE (FIXED) will print a constant number of characters per line, according to the columns parameter from the NewPage call.  The text will be automatically scaled to fit the line. If FALSE is used, characters will be printed in the same proportion as the chosen font.
 
nScale (numerical) : sets the scale for the font, 100 (default) is the normal scale, and it can be enlarged or reduced to fit the text in the desired space.
 
Examples :  oPdf:Font( “10.Arial” ) will print with Arial fonts using 10 point size characters like => abcdefABCDEF12345.
 
oPdf:Font( “16.Tahoma Bold Underscore”, “CP1250” ) will use 16 size characters in Tahoma font, bold and underlined, special characters will be used from the central European alphabet, like => abcdefABCDEF12345ăšåý