Mark Stephens Mark founded the company and has worked with Java and PDF since 1997. The original creator of the core code, he is also a NetBeans enthusiast who enjoys speaking at conferences and reading. He holds an Athletics Blue and an MA in Mediaeval History from St. Andrews University.

What are CID fonts?

1 min read

Understanding CID Fonts in PDFs

CID fonts play a crucial role in supporting Asian and multi-byte character sets within PDF files. This article explains what CID fonts are, how they differ from standard font technologies, and why they’re important for modern digital documents.

Types on PDF Fonts

There are 2 main font technologies used in PDF font files:

  • PostScript/Type1: Widely used for European languages; supports standard character sets but is limited to 256 glyphs.
  • TrueType: Similar in usage and limitation, designed for efficient rendering of Western text.

There is also a ‘merged’ format which borrows features from both (OpenType).

Both however are very good for displaying European style text (ie French, English, German) with limited numbers of characters. They are less suited to languages such as Chinese or Japanese. This is where CID fonts come in – they are extensions of these font technologies to provide better support for these languages. CidFontType0 extends Type1 (Postscript) while CidFontType2 extends TrueType.

CID Font Features

The main features that CID fonts add are the ability to have 16bit values (so 65535 separate CID characters rather than 256) and much more sophisticated and more flexible unicode settings for extraction. Predefined CMAPs (or custom ones embedded by the user) allow for text extraction to provide appropriate values.

Encoding is far more elaborate for CID fonts with the CIDSystemInfo key allowing a number of preset values for common languages (ie Korean, Japanese, Chinese) and the CIDtoGIDMap in Type2 fonts allowing custom control.

CID fonts are also better at allowing for text which does not have a left to right flow. There is even a vertical writing mode.

Adding these features onto the technically tried and test Type1/Truetype font technologies offers a very elegant way to display Chinese and Japanese characters. Which is another reason for the PDF file format’s popularity.

FAQs

Q: Should CID fonts be fully embedded or subsetted in PDFs?

A: Fully embedding CID fonts is recommended to ensure that all document characters display correctly across different devices and platforms. Subsetting can reduce file size but may cause issues if the document is edited or pages are combined from different PDF sources.

Q: Why can CID font embedding make PDF files larger?

A: If the CID font doesn’t contain all needed characters, the PDF may embed each character as a graphic glyph, increasing the file size. This usually happens with non-Unicode fonts or when using complex scripts and symbols, so choosing appropriate fonts with broad character support is important.

Q: Are CID fonts necessary for multilingual or form-heavy PDFs?

A: Yes, CID fonts offer extensive character support for Asian and multi-script documents. They’re especially useful for multilingual PDFs or forms requiring user input in diverse languages, ensuring consistent rendering and accurate search capabilities.



BuildVu allows you to

View PDF files in a Web app
Convert PDF documents to HTML5
Parse PDF documents as HTML
Mark Stephens Mark founded the company and has worked with Java and PDF since 1997. The original creator of the core code, he is also a NetBeans enthusiast who enjoys speaking at conferences and reading. He holds an Athletics Blue and an MA in Mediaeval History from St. Andrews University.