Package com.itextpdf.text.pdf
Class FontSelector
- java.lang.Object
-
- com.itextpdf.text.pdf.FontSelector
-
public class FontSelector extends java.lang.Object
Selects the appropriate fonts that contain the glyphs needed to render text correctly. The fonts are checked in order until the character is found.The built in fonts "Symbol" and "ZapfDingbats", if used, have a special encoding to allow the characters to be referred by Unicode.
-
-
Field Summary
Fields Modifier and Type Field Description protected Font
currentFont
protected java.util.ArrayList<Font>
fonts
private static Logger
LOGGER
protected java.util.ArrayList<Font>
unsupportedFonts
-
Constructor Summary
Constructors Constructor Description FontSelector()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addFont(Font font)
Adds aFont
to be searched for valid characters.protected Font
getFont(int i)
protected int
getSize()
private boolean
isSupported(Font font)
Phrase
process(java.lang.String text)
Process the text so that it will render with a combination of fonts if needed.protected Chunk
processChar(char[] cc, int k, java.lang.StringBuffer sb)
-
-
-
Method Detail
-
addFont
public void addFont(Font font)
Adds aFont
to be searched for valid characters.- Parameters:
font
- theFont
-
process
public Phrase process(java.lang.String text)
Process the text so that it will render with a combination of fonts if needed.- Parameters:
text
- the text- Returns:
- a
Phrase
with one or more chunks
-
processChar
protected Chunk processChar(char[] cc, int k, java.lang.StringBuffer sb)
-
getSize
protected int getSize()
-
getFont
protected Font getFont(int i)
-
isSupported
private boolean isSupported(Font font)
-
-