📄 type1font.java
字号:
// $Id: Type1Font.java,v 1.4 2003/11/04 17:16:01 mike Exp $package org.faceless.pdf;import java.util.*;import java.io.*;/** * <p> * Create a new PostScript Type 1 font. This class of font is commonly * used on UNIX systems. The standard 14 fonts are a special class of * Type 1 font. * </p> * <p> * Type 1 fonts give each character shape, or "glyph", a name, in the * same way the PDF documents refer to glyphs by name (hardly surprising * really, seeing as both Type 1 fonts and PDF documents are defined by * Adobe). Because text written to the PDF via this library is specified * in Unicode, Type 1 fonts need a "mapping" from Unicode character to * Glyph name. * </p> * <p> * For many fonts this isn't a problem. Font's based on the latin character * set (more specifically, fonts implementing a subset of the Adobe * Standard Glyph List) already have their mapping defined. Adobe have a * naming standard for glyphs outside that list * (the {@link PDFEncoding#ADOBE_EXTENDEDMAP}), and if that is followed * then no further thought needs to be given to this issue. * </p> * <p> * If the standard is not followed, it is necessary for the developer to * supply a mapping from Unicode character to Glyph name. This takes the * form of a <code>java.util.Map</code>, with a * <code>java.lang.Character</code> representing a Unicode character as * the key, and a corresponding <code>java.lang.String</code> representing * the name of the glyph as the value. More information on mappings and * encodings in general is given in the preamble to the {@link PDFEncoding} * class. * </p> * @see PDFEncoding * @see TrueTypeFont * @see StandardFont * @version $Revision: 1.4 $ */public class Type1Font extends PDFSimpleFont{ /** * Create a new Type 1 font, using the standard * {@link PDFEncoding#ADOBE_EXTENDEDMAP} mapping from unicode to glyph name. * * @param afm The <code>.afm</code> (Adobe Font Metrics) file specifying * the metrics for this font * * @param pfb The <code>.pfb</code> or <code>.pfa</code> file containing * the glyph shapes to be embedded in the PDF. If the font is not to be * embedded, this should be null. * * @exception IOException If the <code>.afm</code> or </code>.pfb</code> * InputStream can't be read or parsed */ public Type1Font(InputStream afm, InputStream pfb) throws IOException { super(new org.faceless.pdf2.Type1Font(afm,pfb)); } /** * <p> * Create a new Type 1 font, using a user defined mapping from unicode to glyph name. The font * can be embedded, which ensures that your viewers will see exactly the font you specified, at * the cost of increasing the file size. If a font is not embedded and the viewer does not have * the same font installed, the viewing software will substitute an "appropriate" font. * </p> * * @param afm The <code>.afm</code> (Adobe Font Metrics) file specifying the * metrics for this font * * @param pfb The <code>.pfb</code> or <code>.pfa</code> file containing the glyph * shapes to be embedded in the PDF. If the font is not to be embedded, this should be null. * * @param mapping The mapping from unicode->glyph, as described in the class header above. * @exception IOException If the <code>.afm</code> or </code>.pfb</code> file can't be read or parsed */ public Type1Font(InputStream afm, InputStream pfb, Map mapping) throws IOException { super(new org.faceless.pdf2.Type1Font(afm,pfb, mapping)); }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -