PDF Plugin for Xojo |

# PDFDocument.GetFont Method (console safe)

GetsFont built in non unicode front by name.

GetFont(
fontName as String,
encoding as Font.FontEncodingEnum) as Font

#### Parameters

fontName
  The name of the font to get.
encoding
  Desired encoding of the font. Use automatic if you want it to automatically handle encodings. If loading non Latin font then this parameter will be ignored.

#### Returns

Font
  The font if successful, else nil.

#### Remarks

A font can enforce specific encoding, like Japanese font will enforce Japanese encoding.
Creating Helvetica with automatic encoding will enable substitution if hitting text that does not fit the encoding, so if having Chinese Traditional text when Helvetica font is selected then its substituted with MingLiU font. When no good substitution is found then the ResolveFont event is fired so you can for example load unicode TrueType font to handle Thai, Hindi and other such cases.
Built in fonts that PDF has for latin languages:

- Courier
- Courier-Bold
- Courier-Oblique
- Courier-BoldOblique
- Helvetica
- Helvetica-Bold
- Helvetica-Oblique
- Helvetica-BoldOblique
- Times-Roman
- Times-Bold
- Times-Italic
- Times-BoldItalic
- Symbol
- ZapfDingbats
  Built in fonts that PDF has for Japanese:
- MS-Gothic
- MS-PGothic
- MS-Mincho
- MS-PMincho
  Built in fonts that PDF has for Korean:
- DotumChe
- Dotum
  Built in fonts that PDF has for Chinese Traditional:
- MingLiU
  Built in fonts that PDF has for Chinese Simplified:
- SimHei
- SimSun

  #### See Also

  PDFDocument Class