Save This Page
Home » iText-src-2.1.3 » com.lowagie » text » pdf » [javadoc | source]
com.lowagie.text.pdf
class: CJKFont [javadoc | source]
java.lang.Object
   com.lowagie.text.pdf.BaseFont
      com.lowagie.text.pdf.CJKFont
Creates a CJK font compatible with the fonts in the Adobe Asian font Pack.
Field Summary
static final  String CJK_ENCODING    The encoding used in the PDF document for CJK fonts 
static  Properties cjkFonts     
static  Properties cjkEncodings     
static  Hashtable allCMaps     
static  Hashtable allFonts     
Fields inherited from com.lowagie.text.pdf.BaseFont:
COURIER,  COURIER_BOLD,  COURIER_OBLIQUE,  COURIER_BOLDOBLIQUE,  HELVETICA,  HELVETICA_BOLD,  HELVETICA_OBLIQUE,  HELVETICA_BOLDOBLIQUE,  SYMBOL,  TIMES_ROMAN,  TIMES_BOLD,  TIMES_ITALIC,  TIMES_BOLDITALIC,  ZAPFDINGBATS,  ASCENT,  CAPHEIGHT,  DESCENT,  ITALICANGLE,  BBOXLLX,  BBOXLLY,  BBOXURX,  BBOXURY,  AWT_ASCENT,  AWT_DESCENT,  AWT_LEADING,  AWT_MAXADVANCE,  UNDERLINE_POSITION,  UNDERLINE_THICKNESS,  STRIKETHROUGH_POSITION,  STRIKETHROUGH_THICKNESS,  SUBSCRIPT_SIZE,  SUBSCRIPT_OFFSET,  SUPERSCRIPT_SIZE,  SUPERSCRIPT_OFFSET,  FONT_TYPE_T1,  FONT_TYPE_TT,  FONT_TYPE_CJK,  FONT_TYPE_TTUNI,  FONT_TYPE_DOCUMENT,  FONT_TYPE_T3,  IDENTITY_H,  IDENTITY_V,  CP1250,  CP1252,  CP1257,  WINANSI,  MACROMAN,  CHAR_RANGE_LATIN,  CHAR_RANGE_ARABIC,  CHAR_RANGE_HEBREW,  CHAR_RANGE_CYRILLIC,  EMBEDDED,  NOT_EMBEDDED,  CACHED,  NOT_CACHED,  RESOURCE_PATH,  CID_NEWLINE,  subsetRanges,  fontType,  notdef,  widths,  differences,  unicodeDifferences,  charBBoxes,  encoding,  embedded,  compressionLevel,  fontSpecific,  fontCache,  BuiltinFonts14,  forceWidthsOutput,  directTextToByte,  subset,  fastWinansi,  specialMap
Constructor:
 CJKFont(String fontName,
    String enc,
    boolean emb) throws DocumentException 
    Creates a CJK font.
    Parameters:
    fontName - the name of the font
    enc - the encoding of the font
    emb - always false. CJK font and not embedded
    Throws:
    DocumentException - on error
Method from com.lowagie.text.pdf.CJKFont Summary:
charExists,   convertToHCIDMetrics,   convertToVCIDMetrics,   createMetric,   getAllNameEntries,   getCharBBox,   getCidCode,   getFamilyFontName,   getFontDescriptor,   getFullFontName,   getFullFontStream,   getKerning,   getPostscriptFontName,   getRawCharBBox,   getRawWidth,   getUnicodeEquivalent,   getWidth,   getWidth,   hasKernPairs,   isCJKFont,   readCMap,   readFontProperties,   setCharAdvance,   setKerning,   setPostscriptFontName,   writeFont
Methods from com.lowagie.text.pdf.BaseFont:
addSubsetRange,   charExists,   convertToBytes,   convertToBytes,   correctArabicAdvance,   createEncoding,   createFont,   createFont,   createFont,   createFont,   createFont,   createSubsetPrefix,   enumerateTTCNames,   enumerateTTCNames,   getAllFontNames,   getAllNameEntries,   getAllNameEntries,   getAscent,   getAscentPoint,   getBaseName,   getCharBBox,   getCidCode,   getCodePagesSupported,   getCompressionLevel,   getDescent,   getDescentPoint,   getDifferences,   getDocumentFonts,   getDocumentFonts,   getEncoding,   getFamilyFontName,   getFontDescriptor,   getFontType,   getFullFontName,   getFullFontName,   getFullFontStream,   getKerning,   getPostscriptFontName,   getRawCharBBox,   getRawWidth,   getResourceStream,   getResourceStream,   getUnicodeDifferences,   getUnicodeDifferences,   getUnicodeEquivalent,   getWidth,   getWidth,   getWidthPoint,   getWidthPoint,   getWidthPointKerned,   getWidths,   hasKernPairs,   isDirectTextToByte,   isEmbedded,   isFontSpecific,   isForceWidthsOutput,   isSubset,   normalizeEncoding,   setCharAdvance,   setCompressionLevel,   setDirectTextToByte,   setForceWidthsOutput,   setKerning,   setPostscriptFontName,   setSubset,   writeFont
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from com.lowagie.text.pdf.CJKFont Detail:
 public boolean charExists(int c) 
    Checks if a character exists in this font.
 static String convertToHCIDMetrics(int[] keys,
    IntHashtable h) 
 static String convertToVCIDMetrics(int[] keys,
    IntHashtable v,
    IntHashtable h) 
 static IntHashtable createMetric(String s) 
 public String[][] getAllNameEntries() 
    Gets all the entries of the names-table. If it is a True Type font each array element will have {Name ID, Platform ID, Platform Encoding ID, Language ID, font name}. The interpretation of this values can be found in the Open Type specification, chapter 2, in the 'name' table.
    For the other fonts the array has a single element with {"4", "", "", "", font name}.
 public int[] getCharBBox(int c) 
 public int getCidCode(int c) 
 public String[][] getFamilyFontName() 
    Gets the family name of the font. If it is a True Type font each array element will have {Platform ID, Platform Encoding ID, Language ID, font name}. The interpretation of this values can be found in the Open Type specification, chapter 2, in the 'name' table.
    For the other fonts the array has a single element with {"", "", "", font name}.
 public float getFontDescriptor(int key,
    float fontSize) 
    Gets the font parameter identified by key. Valid values for key are ASCENT, CAPHEIGHT, DESCENT and ITALICANGLE.
 public String[][] getFullFontName() 
    Gets the full name of the font. If it is a True Type font each array element will have {Platform ID, Platform Encoding ID, Language ID, font name}. The interpretation of this values can be found in the Open Type specification, chapter 2, in the 'name' table.
    For the other fonts the array has a single element with {"", "", "", font name}.
 public PdfStream getFullFontStream() 
    You can't get the FontStream of a CJK font (CJK fonts are never embedded), so this method always returns null.
 public int getKerning(int char1,
    int char2) 
 public String getPostscriptFontName() 
 protected int[] getRawCharBBox(int c,
    String name) 
 int getRawWidth(int c,
    String name) 
 public int getUnicodeEquivalent(int c) 
 public int getWidth(int char1) 
    Gets the width of a char in normalized 1000 units.
 public int getWidth(String text) 
 public boolean hasKernPairs() 
    Checks if the font has any kerning pairs.
 public static boolean isCJKFont(String fontName,
    String enc) 
    Checks if its a valid CJK font.
 static char[] readCMap(String name) 
 static HashMap readFontProperties(String name) 
 public boolean setCharAdvance(int c,
    int advance) 
    Sets the character advance.
 public boolean setKerning(int char1,
    int char2,
    int kern) 
 public  void setPostscriptFontName(String name) 
    Sets the font name that will appear in the pdf font dictionary. Use with care as it can easily make a font unreadable if not embedded.
  void writeFont(PdfWriter writer,
    PdfIndirectReference ref,
    Object[] params) throws IOException, DocumentException