| java.lang.Object com.lowagie.text.pdf.BaseFont com.lowagie.text.pdf.Type1Font
Type1Font | class Type1Font extends BaseFont (Code) | | Reads a Type1 font
author: Paulo Soares (psoares@consiste.pt) |
Field Summary | |
protected byte | pfb The PFB file if the input was made with a byte array. |
Constructor Summary | |
| Type1Font(String afmFile, String enc, boolean emb, byte ttfAfm, byte pfb) Creates a new Type1 font.
Parameters: ttfAfm - the AFM file if the input is made with a byte array Parameters: pfb - the PFB file if the input is made with a byte array Parameters: afmFile - the name of one of the 14 built-in fonts or the location of an AFM file. |
Method Summary | |
public String[][] | getFamilyFontName() Gets the family name of the font. | public float | getFontDescriptor(int key, float fontSize) Gets the font parameter identified by key . | public String[][] | getFullFontName() Gets the full name of the font. | public int | getKerning(char char1, char char2) Gets the kerning between two Unicode characters. | public String | getPostscriptFontName() Gets the postscript font name. | protected int[] | getRawCharBBox(int c, String name) | int | getRawWidth(int c, String name) Gets the width from the font according to the name or,
if the name is null, meaning it is a symbolic font,
the char c . | public boolean | hasKernPairs() Checks if the font has any kerning pairs. | public void | process(RandomAccessFileOrArray rf) | public boolean | setKerning(char char1, char char2, int kern) Sets the kerning between two Unicode chars. | public void | setPostscriptFontName(String name) Sets the font name that will appear in the pdf font dictionary. | void | writeFont(PdfWriter writer, PdfIndirectReference ref, Object params) Outputs to the writer the font dictionaries and streams. |
pfb | protected byte pfb(Code) | | The PFB file if the input was made with a byte array.
|
Type1Font | Type1Font(String afmFile, String enc, boolean emb, byte ttfAfm, byte pfb) throws DocumentException, IOException(Code) | | Creates a new Type1 font.
Parameters: ttfAfm - the AFM file if the input is made with a byte array Parameters: pfb - the PFB file if the input is made with a byte array Parameters: afmFile - the name of one of the 14 built-in fonts or the location of an AFM file. The file must end in '.afm' Parameters: enc - the encoding to be applied to this font Parameters: emb - true if the font is to be embedded in the PDF throws: DocumentException - the AFM file is invalid throws: IOException - the AFM file could not be read |
getFamilyFontName | public String[][] getFamilyFontName()(Code) | | 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}.
the family name of the font |
getFontDescriptor | public float getFontDescriptor(int key, float fontSize)(Code) | | Gets the font parameter identified by key . Valid values
for key are ASCENT , CAPHEIGHT , DESCENT ,
ITALICANGLE , BBOXLLX , BBOXLLY , BBOXURX
and BBOXURY .
Parameters: key - the parameter to be extracted Parameters: fontSize - the font size in points the parameter in points |
getFullFontName | public String[][] getFullFontName()(Code) | | 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}.
the full name of the font |
getKerning | public int getKerning(char char1, char char2)(Code) | | Gets the kerning between two Unicode characters. The characters
are converted to names and this names are used to find the kerning
pairs in the HashMap KernPairs .
Parameters: char1 - the first char Parameters: char2 - the second char the kerning to be applied |
getPostscriptFontName | public String getPostscriptFontName()(Code) | | Gets the postscript font name.
the postscript font name |
getRawCharBBox | protected int[] getRawCharBBox(int c, String name)(Code) | | |
getRawWidth | int getRawWidth(int c, String name)(Code) | | Gets the width from the font according to the name or,
if the name is null, meaning it is a symbolic font,
the char c .
Parameters: c - the char if the font is symbolic Parameters: name - the glyph name the width of the char |
hasKernPairs | public boolean hasKernPairs()(Code) | | Checks if the font has any kerning pairs.
true if the font has any kerning pairs |
setKerning | public boolean setKerning(char char1, char char2, int kern)(Code) | | Sets the kerning between two Unicode chars.
Parameters: char1 - the first char Parameters: char2 - the second char Parameters: kern - the kerning to apply in normalized 1000 units true if the kerning was applied, false otherwise |
setPostscriptFontName | public void setPostscriptFontName(String name)(Code) | | 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.
Parameters: name - the new font name |
Methods inherited from com.lowagie.text.pdf.BaseFont | public void addSubsetRange(int[] range)(Code)(Java Doc) public boolean charExists(char c)(Code)(Java Doc) byte[] convertToBytes(String text)(Code)(Java Doc) byte[] convertToBytes(char char1)(Code)(Java Doc) public void correctArabicAdvance()(Code)(Java Doc) protected void createEncoding()(Code)(Java Doc) public static BaseFont createFont(String name, String encoding, boolean embedded) throws DocumentException, IOException(Code)(Java Doc) public static BaseFont createFont(String name, String encoding, boolean embedded, boolean cached, byte ttfAfm, byte pfb) throws DocumentException, IOException(Code)(Java Doc) public static BaseFont createFont(String name, String encoding, boolean embedded, boolean cached, byte ttfAfm, byte pfb, boolean noThrow) throws DocumentException, IOException(Code)(Java Doc) public static BaseFont createFont(PRIndirectReference fontRef)(Code)(Java Doc) public static String createSubsetPrefix()(Code)(Java Doc) public static String[] enumerateTTCNames(String ttcFile) throws DocumentException, IOException(Code)(Java Doc) public static String[] enumerateTTCNames(byte ttcArray) throws DocumentException, IOException(Code)(Java Doc) public static Object[] getAllFontNames(String name, String encoding, byte ttfAfm) throws DocumentException, IOException(Code)(Java Doc) public int getAscent(String text)(Code)(Java Doc) public float getAscentPoint(String text, float fontSize)(Code)(Java Doc) protected static String getBaseName(String name)(Code)(Java Doc) public int[] getCharBBox(char c)(Code)(Java Doc) public char getCidCode(char c)(Code)(Java Doc) public String[] getCodePagesSupported()(Code)(Java Doc) public int getDescent(String text)(Code)(Java Doc) public float getDescentPoint(String text, float fontSize)(Code)(Java Doc) public String[] getDifferences()(Code)(Java Doc) public static ArrayList getDocumentFonts(PdfReader reader)(Code)(Java Doc) public static ArrayList getDocumentFonts(PdfReader reader, int page)(Code)(Java Doc) public String getEncoding()(Code)(Java Doc) abstract public String[][] getFamilyFontName()(Code)(Java Doc) abstract public float getFontDescriptor(int key, float fontSize)(Code)(Java Doc) public int getFontType()(Code)(Java Doc) abstract public String[][] getFullFontName()(Code)(Java Doc) public static String[][] getFullFontName(String name, String encoding, byte ttfAfm) throws DocumentException, IOException(Code)(Java Doc) abstract public int getKerning(char char1, char char2)(Code)(Java Doc) abstract public String getPostscriptFontName()(Code)(Java Doc) abstract protected int[] getRawCharBBox(int c, String name)(Code)(Java Doc) abstract int getRawWidth(int c, String name)(Code)(Java Doc) public static InputStream getResourceStream(String key)(Code)(Java Doc) public static InputStream getResourceStream(String key, ClassLoader loader)(Code)(Java Doc) char getUnicodeDifferences(int index)(Code)(Java Doc) public char[] getUnicodeDifferences()(Code)(Java Doc) public char getUnicodeEquivalent(char c)(Code)(Java Doc) public int getWidth(char char1)(Code)(Java Doc) public int getWidth(String text)(Code)(Java Doc) public float getWidthPoint(String text, float fontSize)(Code)(Java Doc) public float getWidthPoint(char char1, float fontSize)(Code)(Java Doc) public float getWidthPointKerned(String text, float fontSize)(Code)(Java Doc) public int[] getWidths()(Code)(Java Doc) abstract public boolean hasKernPairs()(Code)(Java Doc) public boolean isDirectTextToByte()(Code)(Java Doc) public boolean isEmbedded()(Code)(Java Doc) public boolean isFontSpecific()(Code)(Java Doc) public boolean isForceWidthsOutput()(Code)(Java Doc) public boolean isSubset()(Code)(Java Doc) protected static String normalizeEncoding(String enc)(Code)(Java Doc) public boolean setCharAdvance(char c, int advance)(Code)(Java Doc) public void setDirectTextToByte(boolean directTextToByte)(Code)(Java Doc) public void setForceWidthsOutput(boolean forceWidthsOutput)(Code)(Java Doc) abstract public boolean setKerning(char char1, char char2, int kern)(Code)(Java Doc) abstract public void setPostscriptFontName(String name)(Code)(Java Doc) public void setSubset(boolean subset)(Code)(Java Doc) abstract void writeFont(PdfWriter writer, PdfIndirectReference ref, Object params) throws DocumentException, IOException(Code)(Java Doc)
|
|
|