Package org.xhtmlrenderer.pdf
Class TrueTypeUtil
java.lang.Object
org.xhtmlrenderer.pdf.TrueTypeUtil
Uses code from iText's DefaultFontMapper and TrueTypeFont classes. See
http://sourceforge.net/projects/itext/ for license information.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final boolean
Avoid using memory-mapped files for loading fonts. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic FontDescription
extractDescription
(String path, byte[] contents, com.lowagie.text.pdf.BaseFont font, boolean isFromFontFace, @Nullable IdentValue fontWeightOverride, @Nullable IdentValue fontStyleOverride) static FontDescription
extractDescription
(String path, com.lowagie.text.pdf.BaseFont font, @Nullable IdentValue fontWeightOverride) extractTables
(com.lowagie.text.pdf.BaseFont font) static Collection<String>
getFamilyNames
(com.lowagie.text.pdf.BaseFont font) private static String
getTTCName
(String name) private static IdentValue
guessStyle
(com.lowagie.text.pdf.BaseFont font) private static FontDescription.Decorations
readFontDecorations
(String path, byte[] contents, com.lowagie.text.pdf.BaseFont font, @Nullable IdentValue fontWeightOverride) private static FontDescription.Decorations
readFontDecorations
(String path, com.lowagie.text.pdf.BaseFont font, @Nullable IdentValue fontWeightOverride) private static FontDescription.Decorations
readFontDecorations
(String path, com.lowagie.text.pdf.BaseFont font, com.lowagie.text.pdf.RandomAccessFileOrArray rf, @Nullable IdentValue fontWeightOverride)
-
Field Details
-
AVOID_MEMORY_MAPPED_FILES
private static final boolean AVOID_MEMORY_MAPPED_FILESAvoid using memory-mapped files for loading fonts. On Windows, these memory-mapped files are not released from memory, causing memory leaks. See github issue 385.- See Also:
-
-
Constructor Details
-
TrueTypeUtil
public TrueTypeUtil()
-
-
Method Details
-
guessStyle
-
getFamilyNames
-
extractTables
private static Map<String,int[]> extractTables(com.lowagie.text.pdf.BaseFont font) throws SecurityException, NoSuchFieldException, IllegalArgumentException, IllegalAccessException -
getTTCName
-
extractDescription
public static FontDescription extractDescription(String path, com.lowagie.text.pdf.BaseFont font, @Nullable IdentValue fontWeightOverride) -
readFontDecorations
private static FontDescription.Decorations readFontDecorations(String path, com.lowagie.text.pdf.BaseFont font, @Nullable IdentValue fontWeightOverride) throws IOException, NoSuchFieldException, IllegalAccessException, com.lowagie.text.DocumentException - Throws:
IOException
NoSuchFieldException
IllegalAccessException
com.lowagie.text.DocumentException
-
extractDescription
public static FontDescription extractDescription(String path, byte[] contents, com.lowagie.text.pdf.BaseFont font, boolean isFromFontFace, @Nullable IdentValue fontWeightOverride, @Nullable IdentValue fontStyleOverride) -
readFontDecorations
private static FontDescription.Decorations readFontDecorations(String path, byte[] contents, com.lowagie.text.pdf.BaseFont font, @Nullable IdentValue fontWeightOverride) throws IOException, NoSuchFieldException, IllegalAccessException, com.lowagie.text.DocumentException - Throws:
IOException
NoSuchFieldException
IllegalAccessException
com.lowagie.text.DocumentException
-
readFontDecorations
private static FontDescription.Decorations readFontDecorations(String path, com.lowagie.text.pdf.BaseFont font, com.lowagie.text.pdf.RandomAccessFileOrArray rf, @Nullable IdentValue fontWeightOverride) throws NoSuchFieldException, IllegalAccessException, com.lowagie.text.DocumentException, IOException - Throws:
NoSuchFieldException
IllegalAccessException
com.lowagie.text.DocumentException
IOException
-