📄 truetypefontunicode.html
字号:
</DL>
<HR>
<A NAME="isFixedPitch"><!-- --></A><H3>
isFixedPitch</H3>
<PRE>
protected boolean <B>isFixedPitch</B></PRE>
<DL>
<DD><CODE>true</CODE> if all the glyphs have the same width.
<P>
<DL>
</DL>
</DL>
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<A NAME="constructor_detail"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=1><FONT SIZE="+2">
<B>Constructor Detail</B></FONT></TD>
</TR>
</TABLE>
<A NAME="TrueTypeFontUnicode(java.lang.String, java.lang.String, boolean, byte[])"><!-- --></A><H3>
TrueTypeFontUnicode</H3>
<PRE>
<B>TrueTypeFontUnicode</B>(<A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/String.html">String</A> ttFile, <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/String.html">String</A> enc, boolean emb, byte[] ttfAfm) throws <A HREF="../../../../com/lowagie/text/DocumentException.html">DocumentException</A>, <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/io/IOException.html">IOException</A></PRE>
<DL>
<DD>Creates a new TrueType font addressed by Unicode characters. The font will always be embedded.
<P>
<DT><B>Parameters:</B><DD><CODE>ttFile</CODE> - the location of the font on file. The file must end in '.ttf'. The modifiers after the name are ignored.<DD><CODE>enc</CODE> - the encoding to be applied to this font<DD><CODE>emb</CODE> - true if the font is to be embedded in the PDF<DD><CODE>ttfAfm</CODE> - the font as a <CODE>byte</CODE> array<DT><B>Throws:</B><DD><CODE><A HREF="../../../../com/lowagie/text/DocumentException.html">DocumentException</A></CODE> - the font is invalid<DD><CODE><A HREF="http://java.sun.com/j2se/1.3/docs/api/java/io/IOException.html">IOException</A></CODE> - the font file could not be read</DL>
<!-- ============ METHOD DETAIL ========== -->
<A NAME="method_detail"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=1><FONT SIZE="+2">
<B>Method Detail</B></FONT></TD>
</TR>
</TABLE>
<A NAME="getWidth(java.lang.String)"><!-- --></A><H3>
getWidth</H3>
<PRE>
public int <B>getWidth</B>(<A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/String.html">String</A> text)</PRE>
<DL>
<DD>Gets the width of a <CODE>String</CODE> in normalized 1000 units.
<P>
<DD><DL>
<DT><B>Overrides:</B><DD><CODE><A HREF="../../../../com/lowagie/text/pdf/BaseFont.html#getWidth(java.lang.String)">getWidth</A></CODE> in class <CODE><A HREF="../../../../com/lowagie/text/pdf/BaseFont.html">BaseFont</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>text</CODE> - the <CODE>String</CODE> to get the witdth of<DT><B>Returns:</B><DD>the width in normalized 1000 units</DL>
</DD>
</DL>
<HR>
<A NAME="getToUnicode(java.lang.Object[])"><!-- --></A><H3>
getToUnicode</H3>
<PRE>
private <A HREF="../../../../com/lowagie/text/pdf/PdfStream.html">PdfStream</A> <B>getToUnicode</B>(<A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html">Object</A>[] metrics) throws <A HREF="../../../../com/lowagie/text/DocumentException.html">DocumentException</A></PRE>
<DL>
<DD>Creates a ToUnicode CMap to allow copy and paste from Acrobat.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>metrics</CODE> - metrics[0] contains the glyph index and metrics[2] contains the Unicode code<DT><B>Returns:</B><DD>the stream representing this CMap or <CODE>null</CODE><DT><B>Throws:</B><DD><CODE><A HREF="../../../../com/lowagie/text/DocumentException.html">DocumentException</A></CODE> - on error</DL>
</DD>
</DL>
<HR>
<A NAME="toHex(int)"><!-- --></A><H3>
toHex</H3>
<PRE>
static <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/String.html">String</A> <B>toHex</B>(int n)</PRE>
<DL>
<DD>Gets an hex string in the format "<HHHH>".
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>n</CODE> - the number<DT><B>Returns:</B><DD>the hex string</DL>
</DD>
</DL>
<HR>
<A NAME="getCIDFontType2(com.lowagie.text.pdf.PdfIndirectReference, java.lang.String, java.lang.Object[])"><!-- --></A><H3>
getCIDFontType2</H3>
<PRE>
private <A HREF="../../../../com/lowagie/text/pdf/PdfDictionary.html">PdfDictionary</A> <B>getCIDFontType2</B>(<A HREF="../../../../com/lowagie/text/pdf/PdfIndirectReference.html">PdfIndirectReference</A> fontDescriptor, <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/String.html">String</A> subsetPrefix, <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html">Object</A>[] metrics)</PRE>
<DL>
<DD>Generates the CIDFontTyte2 dictionary.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>fontDescriptor</CODE> - the indirect reference to the font descriptor<DD><CODE>subsetPrefix</CODE> - the subset prefix<DD><CODE>metrics</CODE> - the horizontal width metrics<DT><B>Returns:</B><DD>a stream</DL>
</DD>
</DL>
<HR>
<A NAME="getFontBaseType(com.lowagie.text.pdf.PdfIndirectReference, java.lang.String, com.lowagie.text.pdf.PdfIndirectReference)"><!-- --></A><H3>
getFontBaseType</H3>
<PRE>
private <A HREF="../../../../com/lowagie/text/pdf/PdfDictionary.html">PdfDictionary</A> <B>getFontBaseType</B>(<A HREF="../../../../com/lowagie/text/pdf/PdfIndirectReference.html">PdfIndirectReference</A> descendant, <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/String.html">String</A> subsetPrefix, <A HREF="../../../../com/lowagie/text/pdf/PdfIndirectReference.html">PdfIndirectReference</A> toUnicode)</PRE>
<DL>
<DD>Generates the font dictionary.
<P>
<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>descendant</CODE> - the descendant dictionary<DD><CODE>subsetPrefix</CODE> - the subset prefix<DD><CODE>toUnicode</CODE> - the ToUnicode stream<DT><B>Returns:</B><DD>the stream</DL>
</DD>
</DL>
<HR>
<A NAME="compare(java.lang.Object, java.lang.Object)"><!-- --></A><H3>
compare</H3>
<PRE>
public int <B>compare</B>(<A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html">Object</A> o1, <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html">Object</A> o2)</PRE>
<DL>
<DD>The method used to sort the metrics array.
<P>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE>compare</CODE> in interface <CODE><A HREF="http://java.sun.com/j2se/1.3/docs/api/java/util/Comparator.html">Comparator</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>o1</CODE> - the first element<DD><CODE>o2</CODE> - the second element<DT><B>Returns:</B><DD>the comparisation</DL>
</DD>
</DL>
<HR>
<A NAME="writeFont(com.lowagie.text.pdf.PdfWriter, com.lowagie.text.pdf.PdfIndirectReference, java.lang.Object[])"><!-- --></A><H3>
writeFont</H3>
<PRE>
void <B>writeFont</B>(<A HREF="../../../../com/lowagie/text/pdf/PdfWriter.html">PdfWriter</A> writer, <A HREF="../../../../com/lowagie/text/pdf/PdfIndirectReference.html">PdfIndirectReference</A> ref, <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html">Object</A>[] params) throws <A HREF="../../../../com/lowagie/text/DocumentException.html">DocumentException</A>, <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/io/IOException.html">IOException</A></PRE>
<DL>
<DD>Outputs to the writer the font dictionaries and streams.
<P>
<DD><DL>
<DT><B>Overrides:</B><DD><CODE><A HREF="../../../../com/lowagie/text/pdf/TrueTypeFont.html#writeFont(com.lowagie.text.pdf.PdfWriter, com.lowagie.text.pdf.PdfIndirectReference, java.lang.Object[])">writeFont</A></CODE> in class <CODE><A HREF="../../../../com/lowagie/text/pdf/TrueTypeFont.html">TrueTypeFont</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>writer</CODE> - the writer for this document<DD><CODE>ref</CODE> - the font indirect reference<DD><CODE>params</CODE> - several parameters that depend on the font type<DT><B>Throws:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.3/docs/api/java/io/IOException.html">IOException</A></CODE> - on error<DD><CODE><A HREF="../../../../com/lowagie/text/DocumentException.html">DocumentException</A></CODE> - error in generating the object</DL>
</DD>
</DL>
<HR>
<A NAME="convertToBytes(java.lang.String)"><!-- --></A><H3>
convertToBytes</H3>
<PRE>
byte[] <B>convertToBytes</B>(<A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/String.html">String</A> text)</PRE>
<DL>
<DD>A forbidden operation. Will throw a null pointer exception.
<P>
<DD><DL>
<DT><B>Overrides:</B><DD><CODE><A HREF="../../../../com/lowagie/text/pdf/BaseFont.html#convertToBytes(java.lang.String)">convertToBytes</A></CODE> in class <CODE><A HREF="../../../../com/lowagie/text/pdf/BaseFont.html">BaseFont</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>text</CODE> - the text<DT><B>Returns:</B><DD>always <CODE>null</CODE></DL>
</DD>
</DL>
<HR>
<A NAME="getTTCName(java.lang.String)"><!-- --></A><H3>
getTTCName</H3>
<PRE>
protected static <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/String.html">String</A> <B>getTTCName</B>(<A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/String.html">String</A> name)</PRE>
<DL>
<DD>Gets the name from a composed TTC file name. If I have for input "myfont.ttc,2" the return will be "myfont.ttc".
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>name</CODE> - the full name<DT><B>Returns:</B><DD>the simple file name</DL>
</DD>
</DL>
<HR>
<A NAME="fillTables()"><!-- --></A><H3>
fillTables</H3>
<PRE>
void <B>fillTables</B>() throws <A HREF="../../../../com/lowagie/text/DocumentException.html">DocumentException</A>, <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/io/IOException.html">IOException</A></PRE>
<DL>
<DD>Reads the tables 'head', 'hhea', 'OS/2' and 'post' filling several variables.
<P>
<DD><DL>
<DT><B>Throws:</B><DD><CODE><A HREF="../../../../com/lowagie/text/DocumentException.html">DocumentException</A></CODE> - the font is invalid<DD><CODE><A HREF="http://java.sun.com/j2se/1.3/docs/api/java/io/IOException.html">IOException</A></CODE> - the font file could not be read</DL>
</DD>
</DL>
<HR>
<A NAME="getBaseFont()"><!-- --></A><H3>
getBaseFont</H3>
<PRE>
<A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/String.html">String</A> <B>getBaseFont</B>() throws <A HREF="../../../../com/lowagie/text/DocumentException.html">DocumentException</A>, <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/io/IOException.html">IOException</A></PRE>
<DL>
<DD>Gets the Postscript font name.
<P>
<DD><DL>
<DT><B>Returns:</B><DD>the Postscript font name<DT><B>Throws:</B><DD><CODE><A HREF="../../../../com/lowagie/text/DocumentException.html">DocumentExceptio
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -