Fonts and Languages

ABCpdf .net

 
   

 

   
Base  

The base fonts are guaranteed to be available on all systems.

Using the base fonts in your PDF results in a small document which is guaranteed to render in the same way on all systems. However the base fonts do not support complex languages such as Chinese and Japanese and they do not support some characters used in Eastern Europe.

The following are the names of the base fonts.

  • Times-Roman
  • Times-Bold
  • Times-Italic
  • Times-BoldItalic
  • Helvetica
  • Helvetica-Bold
  • Helvetica-Oblique
  • Helvetica-BoldOblique
  • Courier
  • Courier-Bold
  • Courier-Oblique
  • Courier-BoldOblique
  • Symbol
  • ZapfDingbats

Use the AddFont method, with the "Latin" language, to reference these fonts.

 

   

Embed
 

Embedded TrueType or OpenTypeUnicode fonts are generally the most efficient and reliable way of adding complex language support to your PDF documents. However you need to ensure that you have permission to embed and redistribute your chosen font.

ABCpdf includes options to try and protect you from inadvertently embedding copyrighted fonts. However you should not rely on this protection. If you wish to embed fonts It is vitally important that you think about the way these fonts will be used and that you understand the operations permitted by the copyright holder. Ultimately you need to take responsibility for any fonts you embed in your PDF documents.

When embedding large fonts you should generally choose to subset them. Not only does it produce smaller PDF documents but It is also generally faster to embed a subset of a large font than to embed the entire font.

Use the Doc.EmbedFont method to embed fonts.

The table below shows the valid combinations of language and horizontal and vertical writing directions.

Language Horizontal Vertical Notes
"Latin"   The default and most efficient encoding for Western languages.
"Unicode" The setting you will most often want to use when embedding foreign character sets.
"Korean"      
"Japanese"      
"ChineseS"     Simple Chinese
"ChineseT"     Traditional Chinese

 

   

Refs
 

Referenced TrueType or OpenType fonts produce a smaller PDF document. However for complex languages you will need a recent version of Adobe Acrobat and you will need to install the relevant language pack. Without these you will not be able to view your documents and your viewer may report errors.

Use the Doc.AddFont method to reference fonts.

The table below shows the valid combinations of language and horizontal and vertical writing directions.

Language Horizontal Vertical Notes
"Latin"   The default and most efficient encoding for Western languages.
"Unicode"     This selector requires that the font be embedded - it cannot be used for referencing fonts.
"Korean" Requires the relevant Adobe Acrobat Language Pack
"Japanese" Requires the relevant Adobe Acrobat Language Pack
"ChineseS" Simple Chinese requires the relevant Adobe Acrobat Language Pack
"ChineseT" Traditional Chinese requires the relevant Adobe Acrobat Language Pack

 

   

Type 1
 

Sometimes, typically when dealing with the Mac platform, you may need to add or embed Type 1 fonts. You can do this using Doc.EmbedFont or Doc.AddFont in exactly the same way as you would for any other font.

Type 1 fonts contain a limited set of characters. As such the only language which is available is the "Latin" language.

Unlike TrueType fonts you can reuse Type 1 fonts, previously been embedded in a PDF and read using the Doc.Read method.

To access a font which has been previously embedded in the document search through the objects looking for objects of type 'font'. Assign the ID of the object to the Doc.Font property. Note that only standard (WinAnsiEncoding) Type 1 fonts are available in this way.

If you need to obtain the name of the font embedded in a PDF use the following code to get the PostScript name of the font.

theDoc.GetInfo(theID, "/BaseFont:Name")

 

 

   

Issues
 

ABCpdf will allow you to use any valid TrueType or Type 1 (PostScript) font.

If you are having problems accessing a particular font try disabling the ABCpdf font protection functionality. However note that you should not embed and redistribute fonts unless you have permission to do so.

ABCpdf maintains a font cache. This means that for ABCpdf to pick up on a newly installed font you will need to restart any processes that are using ABCpdf.

Alternatively you can pass the path to your font file to the AddFont or EmbedFont method. This will automatically load the font file. Do not move the font file after doing this - ABCpdf relies on fonts staying in place.

Sometimes permissions are placed on individual font files which may restrict access from restricted permission accounts such as ASP or ASP.NET.

Occasionally TrueType fonts are corrupt or non- standard. This can cause problems for ABCpdf (which will refuse to recognize them) or Acrobat (which will refuse to use a font embedded in the PDF). However this type of problem is relatively infrequent and tends to be restricted to unusual fonts such as bar-codes.

If you hit a problem you think is related to a corrupt or nonstandard font please mail us the font and we'll see what we can suggest.