Package com.teamten.font
Class FailoverFont
java.lang.Object
com.teamten.font.AbstractFont
com.teamten.font.FailoverFont
- All Implemented Interfaces:
Font
Font that has a primary font and a fallback font. All operations
forward to the primary font, except characters and parts of
strings that aren't handled by the primary font, which are
forwarded to the fallback font. This is useful for things
like Hebrew that might not be handled by our preferred font.
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.teamten.font.Font
Font.Metrics
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
draw
(String text, double fontSize, long x, long y, org.apache.pdfbox.pdmodel.PDPageContentStream contents) Draw the text.getCharacterMetrics
(int ch, double fontSize) Return the size of a code point in the specified font size.long
The width of a space for a 1pt font, in scaled points.boolean
hasCharacter
(int ch) Whether this font handles this character.Methods inherited from class com.teamten.font.AbstractFont
getKerning, setLigatures, transformLigatures
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.teamten.font.Font
getStringMetrics
-
Constructor Details
-
FailoverFont
-
-
Method Details
-
hasCharacter
public boolean hasCharacter(int ch) Description copied from interface:Font
Whether this font handles this character. -
getSpaceWidth
public long getSpaceWidth()Description copied from interface:Font
The width of a space for a 1pt font, in scaled points. -
getCharacterMetrics
Description copied from interface:Font
Return the size of a code point in the specified font size. -
draw
public void draw(String text, double fontSize, long x, long y, org.apache.pdfbox.pdmodel.PDPageContentStream contents) throws IOException Description copied from interface:Font
Draw the text.- Parameters:
text
- the text to draw.fontSize
- the size in points.x
- the left-hand edge of the text in scaled points.y
- the baseline of the text in scaled points.contents
- the stream to write to.- Throws:
IOException
-