⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 standardcjkfont.java

📁 Java生成PDF Java生成PDF Java生成PDF
💻 JAVA
字号:
// $Id: StandardCJKFont.java,v 1.4 2003/11/04 17:16:01 mike Exp $package org.faceless.pdf;import java.util.*;import java.io.*;/** * <p> * A subclass of PDFFont representing the "standard" Chinese, Japanese and * Korean fonts which are available as part of the Acrobat Reader for those * countries, or as optional "language packs" for other locales. Without * the language pack installed, Acrobat will throw an error message when * trying to display a page containing one of these fonts. They can be * can be downloaded from * <a href="http://www.adobe.com/products/acrobat/acrrasianfontpack.html">http://www.adobe.com/products/acrobat/acrrasianfontpack.html</a> * </p><p> * The following fonts are available: * <ul> * <li><i>Simplified Chinese</i>: STSong-Light</li> * <li><i>Traditional Chinese</i>: MSung-Light, MHei-Medium</li> * <li><i>Japanese</i>: HeiseiMin-W3, HeiseiKakuGo-W5</li> * <li><i>Korean</i>: HYGoThic-Medium, HYSMyeongJo-Medium</li> * </ul> * Each of these fonts may be used as is, or in <i>italic</i> or <b>bold</b>. * </p><p> * In the same way as the {@link PDFSimpleFont} class, all characters are * represented by their Unicode codepoint. Since version 1.2.1, users from Hong Kong * can use characters from the Hong Kong Supplementary Character Set (HKSCS), which * are mapped to the "private character" range from U+E000 to U+F848 * in ISO10646-1:2000(E) - which is functionally equivalent to Unicode 3.0. Earlier * versions of Unicode (as supported by Java prior to J2SE 1.4) can also use these * characters. It's important to note that the viewing application (Acrobat) must have * an up-to-date font and character map for these characters to appear. The Chinese * language pack supplied with Acrobat 5.0 supports the HKSCS characters in the "MSung" * font, but earlier viewers will need to be updated with the latest language pack to * support these characters. * </p><p> * The current version of the library only handles horizontal text. * </p> * * @version $Revision: 1.4 $ * @since 1.1 */public class StandardCJKFont extends PDFFont implements Cloneable{    /**     * Represents the STSong-Light font, a Simplified Chinese font     */    public static final int STSONG = 0;    /**     * Represents the MSung-Light font, a Traditional Chinese font with variable width strokes     */    public static final int MSUNG = 1;    /**     * Represents the MHei-Medium font, a Traditional Chinese font with fixed width strokes     */    public static final int MHEI = 2;    /**     * Represents the HeiseiMin-W3 font, a Japanese font with variable width strokes     */    public static final int HEISEIMIN = 3;    /**     * Represents the HeiseiKakuGo-W5 font, a Japanese font with fixed width strokes     */    public static final int HEISEIKAKUGO = 4;        /**     * Represents the HYGoThic-Medium font, a Korean font with fixed width strokes     */    public static final int HYGOTHIC = 5;        /**     * Represents the HYSMyeongJo-Medium font, a Korean font with variable with strokes     */    public static final int HYSMYEONGJO = 6;    /**     * A "style" parameter to the constructor requesting the text to     * regular - i.e. not bold or italic.     */    public static final int REGULAR = 0;    /**     * A "style" parameter to the constructor requesting a <b>bold</b> font     */    public static final int BOLD = 1;        /**     * A "style" parameter to the constructor requesting an <i>italic</i> font     */    public static final int ITALIC = 2;    /**     * Create a new CJK Font.     * @param font The font to create. Can be one of {@link #STSONG}, {@link #MHEI},     * {@link #MSUNG}, {@link #HEISEIMIN}, {@link #HEISEIKAKUGO}, {@link #HYGOTHIC},     * or {@link #HYSMYEONGJO}.     * @param style a logical-OR of any of {@link #BOLD}, {@link #ITALIC} or {@link #REGULAR}     */    public StandardCJKFont(int font, int style)    {	super(new org.faceless.pdf2.StandardCJKFont(font,style));    }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -