@Immutable @MustImplementEqualsAndHashcode public class LoadedFont extends Object
PDFont that is uniquely
assigned to a PDDocument.| Constructor and Description |
|---|
LoadedFont(org.apache.pdfbox.pdmodel.font.PDFont aFont) |
| Modifier and Type | Method and Description |
|---|---|
static com.helger.pdflayout.spec.LoadedFont.EncodedCodePoint |
encodeCodepointWithFallback(org.apache.pdfbox.pdmodel.font.PDFont aFont,
int nCodepoint,
int nFallbackCodepoint) |
boolean |
equals(Object o) |
byte[] |
getEncodedForPageContentStream(String sText)
A quick version to encode the passed text so that it can be written with
COSWriter.writeString |
com.helger.commons.collection.ext.ICommonsList<TextAndWidthSpec> |
getFitToWidth(String sText,
float fFontSize,
float fMaxWidth) |
org.apache.pdfbox.pdmodel.font.PDFont |
getFont() |
float |
getLineHeight(float fFontSize) |
float |
getStringWidth(String sText,
float fFontSize) |
float |
getTextHeight(float fFontSize) |
int |
hashCode() |
String |
toString() |
public LoadedFont(@Nonnull org.apache.pdfbox.pdmodel.font.PDFont aFont)
@Nonnull public org.apache.pdfbox.pdmodel.font.PDFont getFont()
null.@Nonnegative public float getTextHeight(@Nonnegative float fFontSize)
@Nonnegative public float getLineHeight(@Nonnegative float fFontSize)
@Nonnull public static com.helger.pdflayout.spec.LoadedFont.EncodedCodePoint encodeCodepointWithFallback(@Nonnull org.apache.pdfbox.pdmodel.font.PDFont aFont, int nCodepoint, int nFallbackCodepoint) throws IOException
IOException@Nonnegative public float getStringWidth(@Nonnull String sText, @Nonnegative float fFontSize) throws IOException
IOException@Nonnull public byte[] getEncodedForPageContentStream(@Nonnull String sText) throws IOException
COSWriter.writeStringsText - Text to be written.null.IOException - In case something goes wrong@Nonnull @ReturnsMutableCopy public com.helger.commons.collection.ext.ICommonsList<TextAndWidthSpec> getFitToWidth(@Nullable String sText, @Nonnegative float fFontSize, @Nonnegative float fMaxWidth) throws IOException
IOExceptionCopyright © 2014–2016 Philip Helger. All rights reserved.