Xojo Conferences

DynaPDF Manual - Page 634

Previous Page 633   Index   Next Page 635

Function Reference
Page 634 of 766
The CID-keyed font architecture specifies the external representation of certain font programs, called
CMap and CIDFont files, along with some conventions for combining and using those files. PDF
does not support the entire CID-keyed font architecture, which is independent of PDF; CID-keyed
fonts can also be used in other environments. For complete documentation on the architecture and
the file formats, see Adobe Technical Notes #5092, CID-Keyed Font Technology Overview, and
#5014, Adobe CMap and CIDFont Files Specification.
The term CID-keyed font reflects the fact that CID numbers (character identifiers) are used to index
and access the glyph descriptions in the font. A CID refers always into a predefined character
A character collection is an ordered set of all glyphs needed to support one or more popular
character sets for a particular language. The order of the glyphs in the character collection
determines the CID number for each glyph. Each CID-keyed font explicitly references the character
collection on which its CID numbers are based.
A CMap (character map) file specifies the correspondence between character codes and the CID
numbers used to identify glyphs. It is equivalent to the concept of an encoding in simple fonts.
Whereas a simple font allows a maximum of 256 glyphs to be encoded and accessible at one time, a
CMap can describe a mapping from multiple-byte codes to thousands of glyphs in a large CID-keyed
font. For example, it can describe Shift-JIS, one of several widely used encodings for Japanese. See
also LoadCMap().
The supported character collection of a CID-keyed font must match the one of the CMap file. If the
CMap file provides a mapping into another character collection as the font supports, then the
function returns with an error and the font will not be loaded.
Although TrueType fonts have no native notation of CIDs it is also possible to use TrueType fonts
with external CMaps as long as the font contains a CMap in the format 0, 4, 6, 10, or 12. TrueType
fonts which contain only a CMap in format 2 cannot be used with external CMap files (format 2 is a
mixed 8/16 bit encoding that is supported in certain pure CJK fonts). However, such fonts can be
loaded with SetFont().
A key feature of the CID-keyed font architecture is that it works also with non-embedded fonts. Due
the predefined character collections it is possible to display the text also if the font is not available on
the system.
Documents in western writing systems use about 80 through 100 glyphs of a font on average, while
Asian documents use often more than 400 through several thousand glyphs in one document. The
amount of font data that must be stored in Asian documents is not comparable with western
Although font embedding is still recommended, the amount of data is sometimes too large to embed
all fonts. If font embedding is not possible it is recommended to use fonts which are probably
available on the user's operating system.

Previous topic: SetCIDFont

Next topic: Encodings Identity-H and Identity-V