Composite fonts in Java

Generate QR Code 2d barcode in Java Composite fonts

11.2.2 Composite fonts
QR Code JIS X 0510 Generator In Java
Using Barcode generator for Java Control to generate, create QR Code image in Java applications.
www.OnBarcode.com
QR-Code Recognizer In Java
Using Barcode scanner for Java Control to read, scan read, scan image in Java applications.
www.OnBarcode.com
A composite font obtains its glyphs from a font-like object called a CIDFont. A composite font is represented by a font dictionary with subtype /Type0. The Type 0 font is known as the root font, and its associated CIDFont is called its descendant.
Creating USS Code 128 In Java
Using Barcode printer for Java Control to generate, create Code 128C image in Java applications.
www.OnBarcode.com
Linear 1D Barcode Printer In Java
Using Barcode generation for Java Control to generate, create Linear image in Java applications.
www.OnBarcode.com
Choosing the right font
Generate QR-Code In Java
Using Barcode maker for Java Control to generate, create QR Code image in Java applications.
www.OnBarcode.com
Creating Data Matrix 2d Barcode In Java
Using Barcode creation for Java Control to generate, create Data Matrix image in Java applications.
www.OnBarcode.com
Figure 11.6 Using Identity-H instead of different encodings
UPC-A Creator In Java
Using Barcode generation for Java Control to generate, create UPC-A Supplement 5 image in Java applications.
www.OnBarcode.com
Draw British Royal Mail 4-State Customer Barcode In Java
Using Barcode drawer for Java Control to generate, create Royal Mail Barcode image in Java applications.
www.OnBarcode.com
Please compare figure 11.6 with figure 11.5. The content of the page is identical, but now Arial-BoldMT only appears once in the list of fonts, as a CIDFont with Identity-H encoding. The code to create this PDF is almost identical to the code in listing 11.4; you need only to replace the encoding.
Create Denso QR Bar Code In VS .NET
Using Barcode printer for Reporting Service Control to generate, create Quick Response Code image in Reporting Service applications.
www.OnBarcode.com
Denso QR Bar Code Generation In None
Using Barcode generator for Online Control to generate, create QR Code JIS X 0510 image in Online applications.
www.OnBarcode.com
Listing 11.5 UnicodeExample.java
Barcode Decoder In Java
Using Barcode recognizer for Java Control to read, scan read, scan image in Java applications.
www.OnBarcode.com
Barcode Drawer In Visual C#
Using Barcode creation for Visual Studio .NET Control to generate, create Barcode image in Visual Studio .NET applications.
www.OnBarcode.com
BaseFont bf; for (int i = 0; i < 4; i++) { bf = BaseFont.createFont(FONT, BaseFont.IDENTITY_H, BaseFont.EMBEDDED); document.add(new Paragraph("Font: " + bf.getPostscriptFontName() + " with encoding: " + bf.getEncoding())); document.add(new Paragraph(MOVIES[i][1])); document.add(new Paragraph(MOVIES[i][2])); document.add(new Paragraph(MOVIES[i][3], new Font(bf, 12))); document.add(Chunk.NEWLINE); }
Make GS1 - 13 In None
Using Barcode drawer for Office Word Control to generate, create UPC - 13 image in Word applications.
www.OnBarcode.com
Decode QR Code In .NET Framework
Using Barcode scanner for .NET Control to read, scan read, scan image in Visual Studio .NET applications.
www.OnBarcode.com
CIDFonts are collections of glyphs that can t be used directly. They can only be used as
Generate EAN-13 Supplement 5 In None
Using Barcode printer for Font Control to generate, create European Article Number 13 image in Font applications.
www.OnBarcode.com
UPC A Scanner In None
Using Barcode reader for Software Control to read, scan read, scan image in Software applications.
www.OnBarcode.com
a component of a Type 0 font.
Data Matrix 2d Barcode Drawer In Visual C#
Using Barcode encoder for Visual Studio .NET Control to generate, create ECC200 image in VS .NET applications.
www.OnBarcode.com
UPC - 13 Drawer In Java
Using Barcode encoder for Eclipse BIRT Control to generate, create EAN 13 image in BIRT reports applications.
www.OnBarcode.com
CHARACTER COLLECTION
GTIN - 12 Generation In None
Using Barcode drawer for Software Control to generate, create UCC - 12 image in Software applications.
www.OnBarcode.com
PDF-417 2d Barcode Creation In .NET
Using Barcode printer for Reporting Service Control to generate, create PDF-417 2d barcode image in Reporting Service applications.
www.OnBarcode.com
CID stands for character identifier. A character identifier is used as the index of the char-
acter collection to access the glyphs in the font. For simple fonts, you had an index ranging from 0 to 255; in contrast, a CID can be a number from 0 to 65,535. This is a great advantage when dealing with languages that have huge character sets, such as Chinese, Japanese, and Korean.
Using fonts in iText
CMAP
Note that 65,535 is less than the number of code points available in Unicode (1,114,112). The association between the Unicode code points and their CIDs in the font is specified in a CMap, which is like a very large code page. In listing 11.5, you have used the CMap named Identity-H. This is a generic identity mapping for 2-byte CIDs in a horizontal writing system. The same mapping also exists for vertical writing systems: Identity-V. You ll use Identity-V when we discuss vertical writing systems. You ll use other CMaps in an example that uses a CJKFont.
CIDFONT TYPES
As you can see in table 11.2, there are two types of CIDFonts:
Type 0 CIDFonts These contain glyphs based on the Compact Font Format (CFF; this is a Type 2 font in PostScript terms). If you want to embed such a font, you ll need to buy an .otf file that supports this format. You won t find many free fonts that support this format. Type 2 CIDFonts These contain glyphs based on the TrueType format. You can embed such a font if you have a file containing an OpenType font with TrueType outlines (.ttf) or a TrueType collection (.ttc).
Note that the way fonts are named can be very confusing: Type 0 in the context of CIDFonts has a different meaning than for Type 0 fonts; Type 2 in PostScript has a different meaning than for CIDFonts. Moreover, when you look at the Fonts tab in the Document properties, you ll see that a font with subtype CIDFontType0 is listed as a Type 1 (CID) font. Font technology isn t simple, but it s described in great detail in ISO-32000-1 and in additional technical notes published by Adobe. Right now, we re more interested in the way iText deals with these different types of fonts.
11.3 Using fonts in iText
In the previous sections, we had a short overview of the different font files that can be used to create a BaseFont object, as well as the different font types one can find inside a PDF file. You saw some examples using different files resulting in different font types, but we ve overlooked some types: we haven t discussed Type 3 fonts yet, and we should also take a look at CMaps other than Identity-H. Before we can do this, we must have a look at the different iText classes that deal with fonts.
Copyright © OnBarcode.com . All rights reserved.