You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pdfbox.apache.org by le...@apache.org on 2022/11/07 16:35:16 UTC
svn commit: r1905126 - /pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/
Author: lehmi
Date: Mon Nov 7 16:35:16 2022
New Revision: 1905126
URL: http://svn.apache.org/viewvc?rev=1905126&view=rev
Log:
PDFBOX-4892: fix javadoc
Modified:
pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/FontMappers.java
pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDCIDFontType0.java
pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDCIDFontType2.java
pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDFont.java
pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDFontDescriptor.java
pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDFontLike.java
pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDMMType1Font.java
pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDSimpleFont.java
pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDType1Font.java
pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDVectorFont.java
Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/FontMappers.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/FontMappers.java?rev=1905126&r1=1905125&r2=1905126&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/FontMappers.java (original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/FontMappers.java Mon Nov 7 16:35:16 2022
@@ -38,6 +38,8 @@ public final class FontMappers
/**
* Returns the singleton FontMapper instance.
+ *
+ * @return a singleton FontMapper instance
*/
public static FontMapper instance()
{
@@ -50,6 +52,8 @@ public final class FontMappers
/**
* Sets the singleton FontMapper instance.
+ *
+ * @param fontMapper the singleton FontMapper instance to be stored
*/
public static synchronized void set(FontMapper fontMapper)
{
Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDCIDFontType0.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDCIDFontType0.java?rev=1905126&r1=1905125&r2=1905126&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDCIDFontType0.java (original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDCIDFontType0.java Mon Nov 7 16:35:16 2022
@@ -68,6 +68,8 @@ public class PDCIDFontType0 extends PDCI
*
* @param fontDictionary The font dictionary according to the PDF specification.
* @param parent The parent font.
+ *
+ * @throws IOException if the font could not be read
*/
public PDCIDFontType0(COSDictionary fontDictionary, PDType0Font parent) throws IOException
{
@@ -237,6 +239,8 @@ public class PDCIDFontType0 extends PDCI
/**
* Returns the embedded CFF CIDFont, or null if the substitute is not a CFF font.
+ *
+ * @return the embedded CFF CIDFont or null
*/
public CFFFont getCFFFont()
{
@@ -256,6 +260,8 @@ public class PDCIDFontType0 extends PDCI
/**
* Returns the embedded or substituted font.
+ *
+ * @return the embedded or substituted font
*/
public FontBoxFont getFontBoxFont()
{
Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDCIDFontType2.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDCIDFontType2.java?rev=1905126&r1=1905125&r2=1905126&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDCIDFontType2.java (original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDCIDFontType2.java Mon Nov 7 16:35:16 2022
@@ -60,7 +60,7 @@ public class PDCIDFontType2 extends PDCI
*
* @param fontDictionary The font dictionary according to the PDF specification.
* @param parent The parent font.
- * @throws IOException
+ * @throws IOException if the font could not be read
*/
public PDCIDFontType2(COSDictionary fontDictionary, PDType0Font parent) throws IOException
{
@@ -73,7 +73,7 @@ public class PDCIDFontType2 extends PDCI
* @param fontDictionary The font dictionary according to the PDF specification.
* @param parent The parent font.
* @param trueTypeFont The true type font used to create the parent font
- * @throws IOException
+ * @throws IOException if the font could not be read
*/
public PDCIDFontType2(COSDictionary fontDictionary, PDType0Font parent, TrueTypeFont trueTypeFont) throws IOException
{
@@ -224,7 +224,7 @@ public class PDCIDFontType2 extends PDCI
*
* @param code character code
* @return GID
- * @throws IOException
+ * @throws IOException if the mapping could not be read
*/
@Override
public int codeToGID(int code) throws IOException
@@ -404,8 +404,9 @@ public class PDCIDFontType2 extends PDCI
}
/**
- * Returns the embedded or substituted TrueType font. May be an OpenType font if the font is
- * not embedded.
+ * Returns the embedded or substituted TrueType font. May be an OpenType font if the font is not embedded.
+ *
+ * @return the embedded or substituted TrueType font
*/
public TrueTypeFont getTrueTypeFont()
{
Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDFont.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDFont.java?rev=1905126&r1=1905125&r2=1905126&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDFont.java (original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDFont.java Mon Nov 7 16:35:16 2022
@@ -168,6 +168,8 @@ public abstract class PDFont implements
/**
* Returns the AFM if this is a Standard 14 font.
+ *
+ * @return the AFM
*/
protected final FontMetrics getStandard14AFM()
{
@@ -183,7 +185,7 @@ public abstract class PDFont implements
/**
* Sets the font descriptor when embedding a font.
*
- * @param fontDescriptor
+ * @param fontDescriptor font descriptor of the embedded font
*/
protected final void setFontDescriptor(PDFontDescriptor fontDescriptor)
{
@@ -194,7 +196,9 @@ public abstract class PDFont implements
* Reads a CMap given a COS Stream or Name. May return null if a predefined CMap does not exist.
*
* @param base COSName or COSStream
- * @throws IOException
+ * @return the CMap if present
+ *
+ * @throws IOException if the CMap could not be read
*/
protected final CMap readCMap(COSBase base) throws IOException
{
@@ -231,12 +235,12 @@ public abstract class PDFont implements
}
/**
- * Returns the displacement vector (w0, w1) in text space, for the given character.
- * For horizontal text only the x component is used, for vertical text only the y component.
+ * Returns the displacement vector (w0, w1) in text space, for the given character. For horizontal text only the x
+ * component is used, for vertical text only the y component.
*
* @param code character code
* @return displacement vector
- * @throws IOException
+ * @throws IOException if the data could not be read
*/
public Vector getDisplacement(int code) throws IOException
{
@@ -500,6 +504,8 @@ public abstract class PDFont implements
/**
* This will get the subtype of font.
+ *
+ * @return the subtype
*/
public String getSubType()
{
@@ -580,11 +586,15 @@ public abstract class PDFont implements
/**
* Returns true if the font uses vertical writing mode.
+ *
+ * @return true if the font uses vertical writing mode
*/
public abstract boolean isVertical();
/**
* Returns true if this font is one of the "Standard 14" fonts and receives special handling.
+ *
+ * @return true if this font is one of the "Standard 14" fonts
*/
public boolean isStandard14()
{
@@ -616,6 +626,8 @@ public abstract class PDFont implements
/**
* Returns true if this font will be subset when embedded.
+ *
+ * @return true if this font will be subset when embedded
*/
public abstract boolean willBeSubset();
Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDFontDescriptor.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDFontDescriptor.java?rev=1905126&r1=1905125&r2=1905126&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDFontDescriptor.java (original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDFontDescriptor.java Mon Nov 7 16:35:16 2022
@@ -655,6 +655,8 @@ public final class PDFontDescriptor impl
/**
* Returns true if widths are present in the font descriptor.
+ *
+ * @return true if widths are present in the font descriptor
*/
public boolean hasWidths()
{
@@ -663,6 +665,8 @@ public final class PDFontDescriptor impl
/**
* Returns true if the missing widths entry is present in the font descriptor.
+ *
+ * @return true if the missing widths entry is present in the font descriptor
*/
public boolean hasMissingWidth()
{
Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDFontLike.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDFontLike.java?rev=1905126&r1=1905125&r2=1905126&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDFontLike.java (original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDFontLike.java Mon Nov 7 16:35:16 2022
@@ -83,6 +83,7 @@ public interface PDFontLike
*
* @param code character code
* @return the height of the given character
+ * @throws IOException if the height could not be read
*
* @deprecated Use {@link #getBoundingBox() getBoundingBox()}.{@link BoundingBox#getHeight() getHeight()} instead.
*/
@@ -99,6 +100,8 @@ public interface PDFontLike
*
* @param code character code
* @return the width of the given character
+ *
+ * @throws IOException if the width could not be read
*/
float getWidth(int code) throws IOException;
Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDMMType1Font.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDMMType1Font.java?rev=1905126&r1=1905125&r2=1905126&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDMMType1Font.java (original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDMMType1Font.java Mon Nov 7 16:35:16 2022
@@ -31,6 +31,8 @@ public class PDMMType1Font extends PDTyp
* Creates an MMType1Font from a Font dictionary in a PDF.
*
* @param fontDictionary font dictionary
+ *
+ * @throws IOException if the font could not be read
*/
public PDMMType1Font(COSDictionary fontDictionary) throws IOException
{
Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDSimpleFont.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDSimpleFont.java?rev=1905126&r1=1905125&r2=1905126&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDSimpleFont.java (original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDSimpleFont.java Mon Nov 7 16:35:16 2022
@@ -129,12 +129,16 @@ public abstract class PDSimpleFont exten
/**
* Called by readEncoding() if the encoding needs to be extracted from the font file.
*
+ * @return encoding of the font
+ *
* @throws IOException if the font file could not be read.
*/
protected abstract Encoding readEncodingFromFont() throws IOException;
/**
- * Returns the Encoding vector.
+ * Returns the Encoding.
+ *
+ * @return encoding
*/
public Encoding getEncoding()
{
@@ -142,7 +146,9 @@ public abstract class PDSimpleFont exten
}
/**
- * Returns the Encoding vector.
+ * Returns the glyphlist.
+ *
+ * @return the glyphlist
*/
public GlyphList getGlyphList()
{
@@ -150,8 +156,9 @@ public abstract class PDSimpleFont exten
}
/**
- * Returns true the font is a symbolic (that is, it does not use the Adobe Standard Roman
- * character set).
+ * Returns true if the font is a symbolic (that is, it does not use the Adobe Standard Roman character set).
+ *
+ * @return true if the font is a symbolic
*/
public final boolean isSymbolic()
{
@@ -172,8 +179,9 @@ public abstract class PDSimpleFont exten
}
/**
- * Internal implementation of isSymbolic, allowing for the fact that the result may be
- * indeterminate.
+ * Internal implementation of isSymbolic, allowing for the fact that the result may be indeterminate.
+ *
+ * @return true if isSymbolic
*/
protected Boolean isFontSymbolic()
{
@@ -234,8 +242,9 @@ public abstract class PDSimpleFont exten
}
/**
- * Returns the value of the symbolic flag, allowing for the fact that the result may be
- * indeterminate.
+ * Returns the value of the symbolic flag, allowing for the fact that the result may be indeterminate.
+ *
+ * @return the value of the isSymbolic flag form the font descriptor
*/
protected final Boolean getSymbolicFlag()
{
@@ -385,10 +394,12 @@ public abstract class PDSimpleFont exten
}
/**
- * Returns the path for the character with the given name. For some fonts, GIDs may be used
- * instead of names when calling this method.
- *
- * @return glyph path
+ * Returns the path for the character with the given name. For some fonts, GIDs may be used instead of names when
+ * calling this method. *
+ *
+ * @param name glyph name
+ * @return glyph path of the character with the given name
+ *
* @throws IOException if the path could not be read
*/
public abstract GeneralPath getPath(String name) throws IOException;
@@ -396,12 +407,17 @@ public abstract class PDSimpleFont exten
/**
* Returns true if the font contains the character with the given name.
*
+ * @param name glyph name
+ * @return true if the font contains the character with the given name
+ *
* @throws IOException if the path could not be read
*/
public abstract boolean hasGlyph(String name) throws IOException;
/**
* Returns the embedded or system font used for rendering. This is never null.
+ *
+ * @return the embedded or system font used for rendering
*/
public abstract FontBoxFont getFontBoxFont();
Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDType1Font.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDType1Font.java?rev=1905126&r1=1905125&r2=1905126&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDType1Font.java (original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDType1Font.java Mon Nov 7 16:35:16 2022
@@ -152,7 +152,7 @@ public class PDType1Font extends PDSimpl
*
* @param doc PDF document to write to
* @param pfbIn PFB file stream
- * @throws IOException
+ * @throws IOException if the font could not be read
*/
public PDType1Font(PDDocument doc, InputStream pfbIn) throws IOException
{
@@ -164,8 +164,8 @@ public class PDType1Font extends PDSimpl
*
* @param doc PDF document to write to
* @param pfbIn PFB file stream
- * @param encoding
- * @throws IOException
+ * @param encoding encoding to be used for the font
+ * @throws IOException if the font could not be read
*/
public PDType1Font(PDDocument doc, InputStream pfbIn, Encoding encoding) throws IOException
{
@@ -365,6 +365,8 @@ public class PDType1Font extends PDSimpl
/**
* Returns the PostScript name of the font.
+ *
+ * @return the PostScript name of the font
*/
public final String getBaseFont()
{
@@ -512,6 +514,8 @@ public class PDType1Font extends PDSimpl
/**
* Returns the embedded or substituted Type 1 font, or null if there is none.
+ *
+ * @return the embedded or substituted Type 1 font or null
*/
public Type1Font getType1Font()
{
Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDVectorFont.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDVectorFont.java?rev=1905126&r1=1905125&r2=1905126&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDVectorFont.java (original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDVectorFont.java Mon Nov 7 16:35:16 2022
@@ -51,6 +51,7 @@ public interface PDVectorFont
*
* @param code character code in a PDF. Not to be confused with unicode.
* @return true if this font contains a glyph for the given character code
+ * @throws java.io.IOException if the font could not be read
*/
boolean hasGlyph(int code) throws IOException;
}