org.allcolor.yahp.cl.converter
Class FontResolver

java.lang.Object
  extended by ITextFontResolver
      extended by org.allcolor.yahp.cl.converter.FontResolver

public class FontResolver
extends ITextFontResolver


Nested Class Summary
private static class FontResolver.FontFamily
           
 
Field Summary
private  java.util.Map _fontCache
           
private  java.util.Map _fontFamilies
           
 
Constructor Summary
FontResolver(SharedContext sharedContext)
           
 
Method Summary
private static void addCourier(java.util.HashMap result)
           
 void addFont(SharedContext ctx, java.lang.String path, boolean embedded)
           
 void addFont(java.lang.String path, boolean embedded)
           
 void addFontDirectory(SharedContext ctx, java.lang.String dir, boolean embedded)
           
 void addFontDirectory(java.lang.String dir, boolean embedded)
           
private static void addHelvetica(java.util.HashMap result)
           
private static void addTimes(java.util.HashMap result)
           
private  int convertWeightToInt(IdentValue weight)
           
private static com.lowagie.text.pdf.BaseFont createFont(java.lang.String name)
           
private static java.util.Map createInitialFontMap()
           
 void flushCache()
           
protected static java.lang.String getHashName(java.lang.String name, IdentValue weight, IdentValue style)
           
private  java.lang.String normalizeFontFamily(java.lang.String fontFamily)
           
 FSFont resolveFont(SharedContext renderingContext, FontSpecification spec)
           
private  FSFont resolveFont(SharedContext ctx, java.lang.String[] families, float size, IdentValue weight, IdentValue style, IdentValue variant)
           
private  FSFont resolveFont(SharedContext ctx, java.lang.String fontFamily, float size, IdentValue weight, IdentValue style, IdentValue variant)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_fontFamilies

private java.util.Map _fontFamilies

_fontCache

private java.util.Map _fontCache
Constructor Detail

FontResolver

public FontResolver(SharedContext sharedContext)
Parameters:
sharedContext -
Method Detail

resolveFont

public FSFont resolveFont(SharedContext renderingContext,
                          FontSpecification spec)

flushCache

public void flushCache()

addFontDirectory

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

addFontDirectory

public void addFontDirectory(SharedContext ctx,
                             java.lang.String dir,
                             boolean embedded)
                      throws com.lowagie.text.DocumentException,
                             java.io.IOException
Throws:
com.lowagie.text.DocumentException
java.io.IOException

addFont

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

addFont

public void addFont(SharedContext ctx,
                    java.lang.String path,
                    boolean embedded)
             throws com.lowagie.text.DocumentException,
                    java.io.IOException
Throws:
com.lowagie.text.DocumentException
java.io.IOException

resolveFont

private FSFont resolveFont(SharedContext ctx,
                           java.lang.String[] families,
                           float size,
                           IdentValue weight,
                           IdentValue style,
                           IdentValue variant)

normalizeFontFamily

private java.lang.String normalizeFontFamily(java.lang.String fontFamily)

resolveFont

private FSFont resolveFont(SharedContext ctx,
                           java.lang.String fontFamily,
                           float size,
                           IdentValue weight,
                           IdentValue style,
                           IdentValue variant)

convertWeightToInt

private int convertWeightToInt(IdentValue weight)

getHashName

protected static java.lang.String getHashName(java.lang.String name,
                                              IdentValue weight,
                                              IdentValue style)

createInitialFontMap

private static java.util.Map createInitialFontMap()

createFont

private static com.lowagie.text.pdf.BaseFont createFont(java.lang.String name)
                                                 throws com.lowagie.text.DocumentException,
                                                        java.io.IOException
Throws:
com.lowagie.text.DocumentException
java.io.IOException

addCourier

private static void addCourier(java.util.HashMap result)
                        throws com.lowagie.text.DocumentException,
                               java.io.IOException
Throws:
com.lowagie.text.DocumentException
java.io.IOException

addTimes

private static void addTimes(java.util.HashMap result)
                      throws com.lowagie.text.DocumentException,
                             java.io.IOException
Throws:
com.lowagie.text.DocumentException
java.io.IOException

addHelvetica

private static void addHelvetica(java.util.HashMap result)
                          throws com.lowagie.text.DocumentException,
                                 java.io.IOException
Throws:
com.lowagie.text.DocumentException
java.io.IOException