Class TrueTypeFontUnicode
java.lang.Object
com.lowagie.text.pdf.BaseFont
com.lowagie.text.pdf.TrueTypeFont
com.lowagie.text.pdf.TrueTypeFontUnicode
- All Implemented Interfaces:
Comparator<int[]>
Deprecated.
Represents a True Type font with Unicode encoding. All the character in the font can be used directly by using the
encoding Identity-H or Identity-V. This is the only way to represent some character sets such as Thai.
-
Nested Class Summary
Nested classes/interfaces inherited from class TrueTypeFont
TrueTypeFont.FontHeader, TrueTypeFont.HorizontalHeader, TrueTypeFont.WindowsMetricsNested classes/interfaces inherited from class BaseFont
BaseFont.StreamFont -
Field Summary
FieldsModifier and TypeFieldDescriptionDeprecated.private static final byte[]Deprecated.(package private) booleanDeprecated.trueif the encoding is vertical.Fields inherited from class TrueTypeFont
allNameEntries, bboxes, cff, cffLength, cffOffset, cmap10, cmap31, cmapExt, codePages, directoryOffset, familyName, fileName, fontName, fullName, GlyphWidths, head, hhea, isFixedPitch, italicAngle, justNames, kerning, os_2, rf, style, tables, ttcIndex, underlinePosition, underlineThicknessFields inherited from class BaseFont
ASCENT, AWT_ASCENT, AWT_DESCENT, AWT_LEADING, AWT_MAXADVANCE, BBOXLLX, BBOXLLY, BBOXURX, BBOXURY, BuiltinFonts14, CACHED, CAPHEIGHT, CHAR_RANGE_ARABIC, CHAR_RANGE_CYRILLIC, CHAR_RANGE_HEBREW, CHAR_RANGE_LATIN, charBBoxes, CID_NEWLINE, compressionLevel, COURIER, COURIER_BOLD, COURIER_BOLDOBLIQUE, COURIER_OBLIQUE, CP1250, CP1252, CP1257, DESCENT, differences, directTextToByte, embedded, EMBEDDED, encoding, fastWinansi, FONT_TYPE_CJK, FONT_TYPE_DOCUMENT, FONT_TYPE_T1, FONT_TYPE_T3, FONT_TYPE_TT, FONT_TYPE_TTUNI, fontCache, fontSpecific, fontType, forceWidthsOutput, HELVETICA, HELVETICA_BOLD, HELVETICA_BOLDOBLIQUE, HELVETICA_OBLIQUE, IDENTITY_H, IDENTITY_V, includeCidSet, ITALICANGLE, MACROMAN, NOT_CACHED, NOT_EMBEDDED, notdef, RESOURCE_PATH, secureRandom, specialMap, STRIKETHROUGH_POSITION, STRIKETHROUGH_THICKNESS, SUBSCRIPT_OFFSET, SUBSCRIPT_SIZE, subset, subsetRanges, SUPERSCRIPT_OFFSET, SUPERSCRIPT_SIZE, SYMBOL, TIMES_BOLD, TIMES_BOLDITALIC, TIMES_ITALIC, TIMES_ROMAN, UNDERLINE_POSITION, UNDERLINE_THICKNESS, unicodeDifferences, widths, WINANSI, ZAPFDINGBATS -
Constructor Summary
ConstructorsConstructorDescriptionTrueTypeFontUnicode(String ttFile, String enc, boolean emb, byte[] ttfAfm, boolean forceRead) Deprecated.Creates a new TrueType font addressed by Unicode characters. -
Method Summary
Modifier and TypeMethodDescriptionbooleancharExists(int c) Deprecated.Checks if a character exists in this font.intcompare(int[] o1, int[] o2) Deprecated.The method used to sort the metrics array.(package private) byte[]convertToBytes(int char1) Deprecated.Converts acharto abytearray according to the font's encoding.(package private) byte[]convertToBytes(String text) Deprecated.A forbidden operation.private int[][]filterCmapMetrics(int[][] metrics) Deprecated.protected IntegergetCharacterCode(int code) Deprecated.int[]getCharBBox(int c) Deprecated.Gets the smallest box enclosing the character contours.private PdfDictionarygetCIDFontType2(PdfIndirectReference fontDescriptor, String subsetPrefix, int[][] metrics) Deprecated.Generates the CIDFontTyte2 dictionary.private PdfDictionarygetFontBaseType(PdfIndirectReference descendant, String subsetPrefix, PdfIndirectReference toUnicode) Deprecated.Generates the font dictionary.Deprecated.Returns a PdfStream object with the full font program.int[]getMetricsTT(int c) Deprecated.Gets the glyph index and metrics for a character.(package private) int[][]getSentenceMissingCmap(String text, GlyphVector glyphVector) Deprecated.private PdfStreamgetToUnicode(int[][] metrics) Deprecated.Creates a ToUnicode CMap to allow copy and paste from Acrobat.intgetWidth(int char1) Deprecated.Gets the width of acharin normalized 1000 units.intDeprecated.Gets the width of aStringin normalized 1000 units.int[][]mergeMetricsAndFillerCmap(int[][] metric, Map<Integer, int[]> fillerCmap) Deprecated.(package private) voidDeprecated.Reads the several maps from the table 'cmap'.booleansetCharAdvance(int c, int advance) Deprecated.Sets the character advance.(package private) static StringtoHex(int n) Deprecated.Gets an hex string in the format "<HHHH>".private static StringtoHex4(int n) Deprecated.(package private) voidwriteFont(PdfWriter writer, PdfIndirectReference ref, Object[] params) Deprecated.Outputs to the writer the font dictionaries and streams.Methods inherited from class TrueTypeFont
addRangeUni, checkCff, compactRanges, fillTables, getAllNameEntries, getAllNames, getBaseFont, getCodePagesSupported, getFamilyFontName, getFontBaseType, getFontDescriptor, getFontDescriptor, getFullFont, getFullFontName, getGlyphWidth, getKerning, getNames, getPostscriptFontName, getRawCharBBox, getRawWidth, getTTCName, hasKernPairs, process, readCffFont, readFormat0, readFormat12, readFormat4, readFormat6, readGlyphWidths, readKerning, readStandardString, readUnicodeString, setKerning, setPostscriptFontNameMethods inherited from class BaseFont
addSubsetRange, correctArabicAdvance, createEncoding, createFont, createFont, createFont, createFont, createFont, createFont, createFont, createSubsetPrefix, enumerateTTCNames, enumerateTTCNames, getAllFontNames, getAllNameEntries, getAscent, getAscentPoint, getBaseName, getCidCode, getCompressionLevel, getDescent, getDescentPoint, getDifferences, getDocumentFonts, getDocumentFonts, getEncoding, getFontType, getFullFontName, getResourceStream, getResourceStream, getSecureRandom, getUnicodeDifferences, getUnicodeDifferences, getUnicodeEquivalent, getWidthPoint, getWidthPoint, getWidthPointKerned, getWidths, isDirectTextToByte, isEmbedded, isFontSpecific, isForceWidthsOutput, isIncludeCidSet, isSubset, normalizeEncoding, setCompressionLevel, setDirectTextToByte, setForceWidthsOutput, setIncludeCidSet, setSecureRandom, setSubsetMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Comparator
equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
Field Details
-
rotbits
private static final byte[] rotbitsDeprecated. -
vertical
boolean verticalDeprecated.trueif the encoding is vertical. -
inverseCmap
-
-
Constructor Details
-
TrueTypeFontUnicode
TrueTypeFontUnicode(String ttFile, String enc, boolean emb, byte[] ttfAfm, boolean forceRead) throws DocumentException, IOException Deprecated.Creates a new TrueType font addressed by Unicode characters. The font will always be embedded.- 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 fontemb- true if the font is to be embedded in the PDFttfAfm- the font as abytearray- Throws:
DocumentException- the font is invalidIOException- the font file could not be read
-
-
Method Details
-
toHex4
Deprecated. -
toHex
Deprecated.Gets an hex string in the format "<HHHH>".- Parameters:
n- the number- Returns:
- the hex string
-
readCMaps
Deprecated.Description copied from class:TrueTypeFontReads the several maps from the table 'cmap'. The maps of interest are 1.0 for symbolic fonts and 3.1 for all others. A symbolic font is defined as having the map 3.0.- Overrides:
readCMapsin classTrueTypeFont- Throws:
DocumentException- the font is invalidIOException- the font file could not be read
-
getCharacterCode
Deprecated. -
getWidth
-
getWidth
-
getSentenceMissingCmap
Deprecated. -
getToUnicode
Deprecated.Creates a ToUnicode CMap to allow copy and paste from Acrobat.- Parameters:
metrics- metrics[0] contains the glyph index and metrics[2] contains the Unicode code- Returns:
- the stream representing this CMap or
null
-
filterCmapMetrics
private int[][] filterCmapMetrics(int[][] metrics) Deprecated. -
getCIDFontType2
private PdfDictionary getCIDFontType2(PdfIndirectReference fontDescriptor, String subsetPrefix, int[][] metrics) Deprecated.Generates the CIDFontTyte2 dictionary.- Parameters:
fontDescriptor- the indirect reference to the font descriptorsubsetPrefix- the subset prefixmetrics- the horizontal width metrics- Returns:
- a stream
-
getFontBaseType
private PdfDictionary getFontBaseType(PdfIndirectReference descendant, String subsetPrefix, PdfIndirectReference toUnicode) Deprecated.Generates the font dictionary.- Parameters:
descendant- the descendant dictionarysubsetPrefix- the subset prefixtoUnicode- the ToUnicode stream- Returns:
- the stream
-
compare
public int compare(int[] o1, int[] o2) Deprecated.The method used to sort the metrics array.- Specified by:
comparein interfaceComparator<int[]>- Parameters:
o1- the first elemento2- the second element- Returns:
- the comparison
-
writeFont
void writeFont(PdfWriter writer, PdfIndirectReference ref, Object[] params) throws DocumentException, IOException Deprecated.Outputs to the writer the font dictionaries and streams.- Overrides:
writeFontin classTrueTypeFont- Parameters:
writer- the writer for this documentref- the font indirect referenceparams- several parameters that depend on the font type- Throws:
IOException- on errorDocumentException- error in generating the object
-
mergeMetricsAndFillerCmap
-
getFullFontStream
Deprecated.Returns a PdfStream object with the full font program.- Overrides:
getFullFontStreamin classTrueTypeFont- Returns:
- a PdfStream with the font program
- Throws:
IOException- on errorDocumentException- on error- Since:
- 2.1.3
-
convertToBytes
Deprecated.A forbidden operation. Will throw a null pointer exception.- Overrides:
convertToBytesin classBaseFont- Parameters:
text- the text- Returns:
- always
null
-
convertToBytes
byte[] convertToBytes(int char1) Deprecated.Description copied from class:BaseFontConverts acharto abytearray according to the font's encoding.- Overrides:
convertToBytesin classBaseFont- Parameters:
char1- thecharto be converted- Returns:
- an array of
byterepresenting the conversion according to the font's encoding
-
getMetricsTT
public int[] getMetricsTT(int c) Deprecated.Gets the glyph index and metrics for a character.- Overrides:
getMetricsTTin classTrueTypeFont- Parameters:
c- the character- Returns:
- an
intarray with {glyph index, width}
-
charExists
public boolean charExists(int c) Deprecated.Checks if a character exists in this font.- Overrides:
charExistsin classBaseFont- Parameters:
c- the character to check- Returns:
trueif the character has a glyph,falseotherwise
-
setCharAdvance
public boolean setCharAdvance(int c, int advance) Deprecated.Sets the character advance.- Overrides:
setCharAdvancein classBaseFont- Parameters:
c- the characteradvance- the character advance normalized to 1000 units- Returns:
trueif the advance was set,falseotherwise
-
getCharBBox
public int[] getCharBBox(int c) Deprecated.Description copied from class:BaseFontGets the smallest box enclosing the character contours. It will returnnullif the font has not the information or the character has no contours, as in the case of the space, for example. Characters with no contours may also return [0,0,0,0].- Overrides:
getCharBBoxin classBaseFont- Parameters:
c- the character to get the contour bounding box from- Returns:
- an array of four floats with the bounding box in the format [llx,lly,urx,ury] or
null
-