org.xhtmlrenderer.pdf
Class ITextFontResolver

java.lang.Object  extended by org.xhtmlrenderer.pdf.ITextFontResolver
All Implemented Interfaces:
FontResolver

public class ITextFontResolver
extends Object
implements FontResolver


Nested Class Summary
static classITextFontResolver.FontDescription
           
 
Constructor Summary
ITextFontResolver(SharedContext sharedContext)
           
 
Method Summary
 voidaddFont(String path, boolean embedded)
           
 voidaddFont(String path, String encoding, boolean embedded)
           
 voidaddFont(String path, String encoding, boolean embedded, String pathToPFB)
           
 voidaddFont(String path, String fontFamilyNameOverride, String encoding, boolean embedded, String pathToPFB)
           
 voidaddFontDirectory(String dir, boolean embedded)
           
static intconvertWeightToInt(IdentValue weight)
           
 voidflushCache()
           
 voidflushFontFaceFonts()
           
static SetgetDistinctFontFamilyNames(String path, String encoding, boolean embedded)
          Utility method which uses iText libraries to determine the family name(s) for the font at the given path.
 org.xhtmlrenderer.pdf.ITextFontResolver.FontFamilygetFontFamily(String fontFamilyName)
           
protected static StringgetHashName(String name, IdentValue weight, IdentValue style)
           
 voidimportFontFaces(List fontFaces)
           
 FSFontresolveFont(SharedContext renderingContext, FontSpecification spec)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ITextFontResolver

public ITextFontResolver(SharedContext sharedContext)
Method Detail

getDistinctFontFamilyNames

public static Set getDistinctFontFamilyNames(String path,                                             String encoding,                                             boolean embedded)
Utility method which uses iText libraries to determine the family name(s) for the font at the given path. The iText APIs seem to indicate there can be more than one name, but this method will return a set of them. Use a name from this list when referencing the font in CSS for PDF output. Note that family names as reported by iText may vary from those reported by the AWT Font class, e.g. "Arial Unicode MS" for iText and "ArialUnicodeMS" for AWT.

Parameters:
path - local path to the font file
encoding - same as what you would use for addFont(String, String, boolean)
embedded - same as what you would use for addFont(String, String, boolean)
Returns:
set of all family names for the font file, as reported by iText libraries

resolveFont

public FSFont resolveFont(SharedContext renderingContext,                          FontSpecification spec)
Specified by:
resolveFont in interface FontResolver

flushCache

public void flushCache()
Specified by:
flushCache in interface FontResolver

flushFontFaceFonts

public void flushFontFaceFonts()

importFontFaces

public void importFontFaces(List fontFaces)

addFontDirectory

public void addFontDirectory(String dir,                             boolean embedded)                      throws com.lowagie.text.DocumentException,                             IOException
Throws:
com.lowagie.text.DocumentException
IOException

addFont

public void addFont(String path,                    boolean embedded)             throws com.lowagie.text.DocumentException,                    IOException
Throws:
com.lowagie.text.DocumentException
IOException

addFont

public void addFont(String path,                    String encoding,                    boolean embedded)             throws com.lowagie.text.DocumentException,                    IOException
Throws:
com.lowagie.text.DocumentException
IOException

addFont

public void addFont(String path,                    String encoding,                    boolean embedded,                    String pathToPFB)             throws com.lowagie.text.DocumentException,                    IOException
Throws:
com.lowagie.text.DocumentException
IOException

addFont

public void addFont(String path,                    String fontFamilyNameOverride,                    String encoding,                    boolean embedded,                    String pathToPFB)             throws com.lowagie.text.DocumentException,                    IOException
Throws:
com.lowagie.text.DocumentException
IOException

getFontFamily

public org.xhtmlrenderer.pdf.ITextFontResolver.FontFamily getFontFamily(String fontFamilyName)

convertWeightToInt

public static int convertWeightToInt(IdentValue weight)

getHashName

protected static String getHashName(String name,                                    IdentValue weight,                                    IdentValue style)


Copyright © 2013. All Rights Reserved.


NOTHING
NOTHING
Add the Maven Dependecy to your project: maven dependecy for com.amazonaws : aws-java-sdk : 1.3.14