Pdf |
public static PdfFont CreateEmbeddedFont( PdfDocument doc, byte[] content, FontCharSet charSet, bool bVert )
A font program can be embedded in a PDF file as data contained in a byte array.
Font programs are subject to copyright, and the copyright owner may impose conditions under which a font program can be used.These permissions are recorded either in the font program or as part of a separate license.One of the conditions may be that the font program cannot be embedded, in which case it should not be incorporated into a PDF file.A font program may allow embedding for the sole purpose of viewing and printing the document but not for creating new or modified text that uses the font(in either the same document or other documents). The latter operation would require the user performing the operation to have a licensed copy of the font program, not a copy extracted from the PDF file.In the absence of explicit information to the contrary, a PDF consumer should assume that any embedded font programs are to be used only to view and print the document and not for any other purposes.
The following TrueType tables are always required: “head,” “hhea,” “loca,” “maxp,” “cvt ,” “prep,” “glyf,” “hmtx,” and “fpgm.”
Beginning with PDF 1.6, font programs may be embedded using the OpenType format, which is an extension of the TrueType format that allows inclusion of font programs using the Compact Font Format(CFF). It also allows inclusion of data to describe glyph substitutions, kerning, and baseline adjustments.In addition to rendering glyphs, applications can use the data in OpenType fonts to do advanced line layout, automatically substitute ligatures, provide selections of alternate glyphs to users, and handle complicated writing scripts.
Like TrueType, OpenType font programs contain a number of tables, as defined in the OpenType Font Specification. For OpenType fonts based on TrueType, the “glyf ” table contains the glyph descriptions.For OpenType fonts based on CFF, the “CFF” table is a complete font program containing the glyph descriptions. These tables, as well as the “cmap” table, are required to be present when embedding fonts.In addition, for OpenType fonts based on TrueType, the “head,” “hhea,” “loca,” “maxp,” “cvt ,” “prep,” “hmtx,” and “fpgm” tables are required.
| Note: Other tables, such as those used for advanced line layout, need not be present; however, their absence may prevent editing of text containing the font. |
An embedded font program may contain only the subset of glyphs that are used in the PDF document.