com.lowagie.text.pdf
class TrueTypeFontUnicode extends TrueTypeFont implements Comparator
Field Summary | |
---|---|
boolean | verticaltrue if the encoding is vertical. |
Constructor Summary | |
---|---|
TrueTypeFontUnicode(String ttFile, String enc, boolean emb, byte[] ttfAfm) Creates a new TrueType font addressed by Unicode characters. |
Method Summary | |
---|---|
boolean | charExists(char c)
Checks if a character exists in this font. |
int | compare(Object o1, Object o2) The method used to sort the metrics array. |
byte[] | convertToBytes(String text) A forbidden operation. |
int[] | getCharBBox(char c) |
PdfDictionary | getCIDFontType2(PdfIndirectReference fontDescriptor, String subsetPrefix, Object[] metrics) Generates the CIDFontTyte2 dictionary. |
PdfDictionary | getFontBaseType(PdfIndirectReference descendant, String subsetPrefix, PdfIndirectReference toUnicode) Generates the font dictionary. |
PdfStream | getToUnicode(Object[] metrics) Creates a ToUnicode CMap to allow copy and paste from Acrobat. |
int | getWidth(String text)
Gets the width of a String in normalized 1000 units. |
boolean | setCharAdvance(char c, int advance)
Sets the character advance. |
static String | toHex(int n) Gets an hex string in the format "<HHHH>". |
void | writeFont(PdfWriter writer, PdfIndirectReference ref, Object[] params) Outputs to the writer the font dictionaries and streams. |
true
if the encoding is vertical.Parameters: ttFile the location of the font on file. The file must end in '.ttf'.
The modifiers after the name are ignored. enc the encoding to be applied to this font emb true if the font is to be embedded in the PDF ttfAfm the font as a byte
array
Throws: DocumentException the font is invalid IOException the font file could not be read
Parameters: c the character to check
Returns: true
if the character has a glyph,
false
otherwise
Parameters: o1 the first element o2 the second element
Returns: the comparisation
Parameters: text the text
Returns: always null
Parameters: fontDescriptor the indirect reference to the font descriptor subsetPrefix the subset prefix metrics the horizontal width metrics
Returns: a stream
Parameters: descendant the descendant dictionary subsetPrefix the subset prefix toUnicode the ToUnicode stream
Returns: the stream
Parameters: metrics metrics[0] contains the glyph index and metrics[2] contains the Unicode code
Returns: the stream representing this CMap or null
Throws: DocumentException on error
String
in normalized 1000 units.Parameters: text the String
to get the witdth of
Returns: the width in normalized 1000 units
Parameters: c the character advance the character advance normalized to 1000 units
Returns: true
if the advance was set,
false
otherwise
Parameters: n the number
Returns: the hex string
Parameters: writer the writer for this document ref the font indirect reference params several parameters that depend on the font type
Throws: IOException on error DocumentException error in generating the object