Package com.teamten.font
Class DummyFont
java.lang.Object
com.teamten.font.AbstractFont
com.teamten.font.DummyFont
- All Implemented Interfaces:
Font
A font for testing.
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.teamten.font.Font
Font.Metrics -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddraw(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.longThe width of a space for a 1pt font, in scaled points.booleanhasCharacter(int ch) Whether this font handles this character.toString()Methods inherited from class com.teamten.font.AbstractFont
getKerning, setLigatures, transformLigaturesMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.teamten.font.Font
getStringMetrics
-
Constructor Details
-
DummyFont
Dummy font with reasonable sizes.- Parameters:
ligatures- the ligature list, or null for none.
-
DummyFont
- Parameters:
ligatures- the ligature list, or null for none.width- width of every character for a 1pt font.height- height of every character for a 1pt font.depth- depth of every character for a 1pt font.
-
-
Method Details
-
hasCharacter
public boolean hasCharacter(int ch) Description copied from interface:FontWhether this font handles this character. -
getSpaceWidth
public long getSpaceWidth()Description copied from interface:FontThe width of a space for a 1pt font, in scaled points. -
getCharacterMetrics
Description copied from interface:FontReturn 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:FontDraw 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
-
toString
-